توقعات سلسلة الفوركس
توقعات سلسلة الوقت (تسف)
تسف، مؤشر توقعات السلسلة الزمنية، يتكون من قياسات الانحدار الخطي باستخدام طريقة المربعات الأقل. الانحدار الخطي هو أداة إحصائية للتنبؤ بقيم سوق الفوركس المستقبلية مقارنة بالقيم السابقة. تسف يحاول التنبؤ بقيمة سوق الفوركس التالية. ولهذا الغرض، فإنه يحدد الانحدار التصاعدي أو الهابط للاتجاه ويمتد تلك النتائج إلى المستقبل. على سبيل المثال، عندما تتحرك الأسعار صعودا، يحاول تسف تحديد الانحراف التصاعدي للسعر مقارنة بالسعر الجاري وتمديد هذا الحساب إلى الأمام.
وينخفض هذا الاتجاه عندما ينخفض سعر سوق الفوركس تحت المؤشر، ويعتبر الاتجاه عند ارتفاع سعر سوق الفوركس فوق المؤشر. إلى جانب ذلك، يعتقد الكثير من المحللين أنه بمجرد أن تتحول الأسعار فوق أو تندرج تحت خط المؤشر؛ من المرجح أن تتحرك الأسعار مرة أخرى إلى الخط. ويحدد مؤشر تسف أيضا ما إذا كان التغيير في الاتجاه قد رصد الاتجاه الجاري.
ويشبه مؤشر توقعات السلاسل الزمنية مؤشر الانحدار الخطي باستثناء اثنين من الفروق الهامة. ويتمثل أحد التمايز في أن قيمة إدخال الطول الافتراضية المستخدمة في تسف أقصر بكثير لأن خط المؤامرة ممتد للأمام. وثمة تمييز آخر هو أن تسف رسم خطها إلى الأمام، على يمين الرسم البياني، من خلال عدد من الحانات المحددة من قبل البارات زائد المدخلات. ولن تكون المدخلات ذات الطول الأكبر جديرة بالثقة مثل طول المدة الأقصر أثناء تحليل نشاط الأسعار واتجاهاتها وستشكل مؤامرة مبالغ فيها إلى حد كبير.
توقعات سلسلة الوقت.
تستخدم توقعات سلسلة الوقت الانحدار الخطي لحساب أفضل خط مناسب خلال فترة زمنية محددة؛ ثم يتم رسم هذا الخط إلى الأمام فترة زمنية محددة من قبل المستخدم.
يظهر الرسم البياني أدناه لعقود العقود الآجلة ميني-داو مؤشر توقعات سلسلة الوقت:
يوضح الرسم البياني أعلاه كيف تم رسم خط توقعات سلسلة الوقت إلى الأمام (في المثال أعلاه، 7 أيام).
وبصفة عامة، قد يتوقع المتداولون أن يعود السعر إلى خط توقعات السلاسل الزمنية عندما تتضخم الأسعار. لذلك، يمكن أن تحدث إشارة شراء محتملة غامضة عندما يكون السعر أقل من الخط ويمكن أن تحدث إشارة بيع محتملة عندما يكون السعر أعلى بكثير من الخط. ومع ذلك، فإن مدى السعر يحتاج إلى أن تختلف من خط غير موضوعي جدا.
مؤشر تقني مماثل ويمكن القول عنه، هو منحنى الانحدار الخطي (انظر: منحنى الانحدار الخطي).
التنبؤ المالية سلسلة الوقت.
المقدمة.
تتناول هذه المقالة واحدة من التطبيقات العملية الأكثر شعبية من الشبكات العصبية، والتنبؤ السلاسل الزمنية في السوق. وفي هذا المجال، يرتبط التنبؤ ارتباطا وثيقا بالربحية ويمكن اعتباره واحدا من الأنشطة التجارية.
إن التنبؤ بالسلسلة الزمنية المالية عنصر ضروري في أي نشاط استثماري. ويستند مفهوم الاستثمار نفسه - طرح المال الآن لكسب الأرباح في المستقبل - على مفهوم التنبؤ بالمستقبل. ولذلك، فإن التنبؤ بالسلسلة الزمنية المالية يكمن في أنشطة صناعة الاستثمار بأكملها - جميع البورصات المنظمة ونظم التداول الأخرى للأوراق المالية.
دعونا نعطي بعض الأرقام التي توضح حجم هذه الصناعة التنبؤ (شارب، 1997). وتتجاوز قيمة التداول اليومي لسوق الاسهم الامريكية 10 مليارات دولار امريكى. يذكر ان شركة الوديعة الاستئمانية فى الولايات المتحدة حيث سجلت الاوراق المالية التى تبلغ قيمتها 11 تريليون دولار امريكى / من اجمالى حجمها 18 تريليون دولار امريكى / مسجلة حوالى 250 مليار دولار امريكى يوميا. تجارة الفوركس العالم هو أكثر نشاطا. وتتجاوز عائداتها اليومية 1000 مليار دولار امريكى. وهو ما يقرب من 1/50 من رأس المال المجمع العالمي.
99٪ من جميع المعاملات معروفة بأنها مضاربة، أي أنها لا تهدف إلى خدمة تداول السلع الحقيقية، ولكن يتم تنفيذها لكسب الأرباح من المخطط: "اشترى أرخص وباعت أفضل". وتستند جميعها إلى تنبؤات المتعاملين بشأن تغيرات الأسعار. وفي الوقت نفسه، ومن المهم جدا، والتنبؤات التي أدلى بها المشاركين في كل معاملة هي القطبية. ومن ثم، فإن حجم المعاملات المضاربية يميز مقياس التناقضات في توقعات المشاركين في السوق، أي في الواقع، مقياس عدم القدرة على التنبؤ بالسلاسل الزمنية المالية.
هذه الخاصية الأكثر أهمية لسلسلة زمنية السوق تكمن وراء فرضية السوق الفعالة التي طرحها لويس باشلييه في أطروحته في عام 1900. ووفقا لهذا المبدأ، يمكن للمستثمر أن يأمل فقط في متوسط الربحية المقدرة باستخدام مؤشرات مثل داو جونز أو S & أمب؛ P500 (لبورصة نيويورك). ومع ذلك، كل الربح المضاربة يحدث عشوائيا ويشبه مقامرة. يتم تحديد عدم القدرة على التنبؤ منحنيات السوق من قبل نفس السبب الذي لا يمكن العثور على المال بالكاد على الأرض في الشوارع المزدحمة: هناك الكثير من المتطوعين لاستلامه.
نظرية السوق الفعالة غير مدعومة، من الطبيعي جدا، من قبل المشاركين في السوق أنفسهم (لأنها هي بالضبط في البحث عن هذا "الكذب" المال). معظمهم على يقين من أن سلسلة الوقت السوق، على الرغم من أنها تبدو عشوائية، مليئة انتظام مخفي، أي أنها على الأقل يمكن التنبؤ بها جزئيا. كان رالف إليوت، مؤسس التحليل الفني، الذي حاول اكتشاف هذه الانتظامات التجريبية المخفية في الثلاثينيات.
في الثمانينات، وجدت وجهة النظر هذه دعما مذهلا في نظرية الفوضى الديناميكية التي حدثت قبل فترة وجيزة. وتستند النظرية على المعارضة من حالة الفوضى والمؤشر العشوائي (العشوائية). سلسلة الفوضى تظهر فقط عشوائي، ولكن، كعملية ديناميكية مصممة، فإنها تترك مجالا تماما للتنبؤ على المدى القصير. إن مجال التنبؤات الممكنة محدود في الوقت المناسب من خلال أفق التنبؤ، ولكن قد يكون كافيا لتحقيق أرباح حقيقية بسبب التنبؤ (تشورافاس، 1994). ثم أولئك الذين لديهم أساليب رياضية أفضل لاستخراج الانتظامات من سلسلة فوضوية صاخبة قد نأمل في معدل ربح أفضل - على حساب زملائهم المجهزين أسوأ.
في هذه المقالة، سنقدم وقائع محددة تؤكد قابلية التنبؤ الجزئي للسلاسل الزمنية المالية وحتى تقييم هذا التنبؤ العددي.
التحليل الفني والشبكات العصبية.
في العقود الأخيرة، التحليل الفني - مجموعة من القواعد التجريبية على أساس مختلف مؤشرات سلوك السوق - يصبح أكثر وأكثر شعبية. ويركز التحليل الفني على السلوك الفردي لأمن معين، بشكل غير متكافئ للأوراق المالية الأخرى (برينغ، 1991).
هذا النهج يعتمد نفسيا على تركيز الوسطاء على الأمن الذي يعملون معهم في لحظة معينة. وفقا لألكسندر إلدر، وهو محلل تقني معروف (مدرب في البداية كمعالج نفسي)، فإن سلوك مجتمع السوق هو إلى حد كبير نفس سلوك الحشود الذي يتميز بقوانين خاصة لعلم النفس الجماعي. تأثير الحشد يبسط التفكير، والدرجات أسفل خصوصيات الفردية وتنتج أشكال السلوك الجماعي، الذي هو أكثر بدائية الجرادية من الفرد. وعلى وجه الخصوص، تعزز الغريزة الاجتماعية دور القائد، وهو رجل / أنثى ألفا. ومنحنى السعر، وفقا ل إلدر، هو بالضبط هذا الزعيم التركيز على الوعي الجماعي السوق على نفسها. هذا التفسير النفسي لسلوك سعر السوق يثبت أن تطبيق نظرية الفوضى الديناميكية. يتم تحديد قابلية التنبؤ الجزئي للسوق من خلال سلوك جماعي بدائي نسبيا من اللاعبين التي تشكل نظام ديناميكي الفوضى واحد مع كمية صغيرة نسبيا من درجات داخلية من الحرية.
وفقا لهذا المبدأ، عليك أن "كسر من السندات" من الحشد، ترتفع فوقه وتصبح أكثر ذكاء من الحشد لتكون قادرة على التنبؤ منحنيات السوق. لهذا الغرض، كنت من المفترض أن تطوير نظام القمار تقييمها على السلوك السابق من سلسلة زمنية واتباع هذا النظام بدقة، كونها لا تتأثر العواطف والشائعات المتداولة في السوق معين. وبعبارة أخرى، يجب أن تستند التنبؤات إلى خوارزمية، أي أنها يمكن بل ويجب تسليمها إلى جهاز كمبيوتر (ليبيو، 1992). يجب على الرجل فقط إنشاء هذه الخوارزمية، لأي غرض لديه منتجات البرمجيات المختلفة التي تسهل تطوير ودعم المزيد من الاستراتيجيات المبرمجة على أساس أدوات التحليل الفني.
وفقا لهذا المنطق، لماذا لا تستخدم جهاز الكمبيوتر في مرحلة تطوير الاستراتيجية، مع كونه ليس مساعد حساب مؤشرات السوق المعروفة واختبار استراتيجيات معينة، ولكن للعثور على المؤشرات المثلى والاستراتيجيات المثلى للمؤشرات وجدت. هذا النهج بدعم من تطبيق تقنيات الشبكات العصبية وقد كسب المزيد والمزيد من أتباع منذ أوائل 90 (بلتراتي، 1995، بيستانز، 1997)، لأنه يحتوي على عدد من المزايا التي لا جدال فيها.
أولا وقبل كل شيء، تحليل الشبكة العصبية، على عكس واحد التقنية، لا تتحمل أي قيود على طبيعة البيانات المدخلات. ويمكن أن يكون كل من مؤشرات سلسلة زمنية معينة والمعلومات عن سلوك الأوراق المالية الأخرى في السوق. ليس من دون سبب، هؤلاء المستثمرين من المؤسسات (على سبيل المثال، صناديق المعاشات التقاعدية الكبيرة) التي تستخدم بنشاط الشبكات العصبية. ويعمل هؤالء املستثمرون مع محافظ كبيرة، حيث تكون عالقات االرتباط بني األسواق املختلفة ذات أهمية قصوى.
ثانيا، خلافا للتحليل الفني القائم على التوصيات العامة، يمكن للشبكات العصبية أن تجد مؤشرات مثالية للأمن وقاعدة معينة لها استراتيجية التنبؤ الأمثل، مرة أخرى، لسلسلة زمنية معينة. وعلاوة على ذلك، يمكن لهذه الاستراتيجيات أن تكون قابلة للتكيف مع التغير في السوق، وهو أمر ذو أهمية قصوى بالنسبة للأسواق النامية الشبابية، ولا سيما الأسواق الروسية.
تعتمد نمذجة الشبكات العصبية وحدها على البيانات دون أن تنطوي على أي اعتبارات مسبقة. هناك تكمن قوتها، وفي الوقت نفسه، كعب أخيل. قد تكون البيانات المتاحة غير كافية للتعلم، قد تكون أبعاد المدخلات المحتملة عالية جدا. وعلاوة على ذلك في هذه المقالة، سوف نبين كيف أن الخبرة المتراكمة من خلال التحليل الفني يمكن أن تساعد في التغلب على هذه الصعوبات، نموذجية في مجال التنبؤات المالية.
تقنية التنبؤ بالسلاسل الزمنية.
كخطوة أولى، دعونا نصف المخطط العام للتنبؤ بالسلاسل الزمنية باستخدام الشبكات العصبية (الشكل 1).
الشكل 1. مخطط الدورة التكنولوجية للتسلسل الزمني.
وعلاوة على ذلك في هذه المقالة، وسوف نناقش بإيجاز جميع مراحل هذه العملية تدفق. وعلى الرغم من أن المبادئ العامة لنمذجة الشبكات العصبية تنطبق بالكامل على هذه المهمة، فإن التنبؤ بالمسلسل الزمني المالي له طابعه الخاص. هذه هي هذه الميزات المحددة التي سيتم وصفها في هذه المقالة إلى أقصى حد ممكن.
تقنية الغمر. نظرية تاكنز.
دعونا نبدأ بمرحلة الغمر. وكما سنرى الآن، بالنسبة لجميع تلك التنبؤات يبدو أنها استقراء البيانات، الشبكات العصبية، في الواقع، حل مشكلة الاستيفاء، مما يزيد بشكل كبير من صحة الحل. إن التنبؤ بسلسلة زمنية يحل نفسه في المشكلة الروتينية للتحليل العصبي - تقريب الدالة متعددة المتغيرات لمجموعة معينة من الأمثلة - باستخدام إجراء غمر السلاسل الزمنية في فضاء متعدد الأبعاد (ويجند، 1994). فعلى سبيل المثال، تتكون مساحة التأخر البعدية من السلاسل الزمنية من قيم السلاسل الزمنية في مثيلات متتالية من الزمن:
يتم إثبات نظرية تاكينس التالية للنظم الديناميكية: إذا تم إنشاء سلسلة زمنية من قبل نظام ديناميكي، أي قيم هي وظيفة التعسفي للدولة من مثل هذا النظام، وهناك عمق الغمر هذا (يساوي تقريبا فعالية عدد درجات حرية هذا النظام الديناميكي) الذي يوفر تنبؤا لا لبس فيه للقيمة التالية للسلسلة الزمنية (سور، 1991). وبالتالي، بعد أن اخترت كبيرة نوعا ما، يمكنك ضمان الاعتماد لا لبس فيه بين القيمة المستقبلية للسلاسل الزمنية والقيم السابقة لها:، أي التنبؤ سلسلة زمنية يحل نفسه في مشكلة الاستيفاء وظيفة متعددة المتغيرات. ثم يمكنك استخدام الشبكة العصبية لاستعادة هذه الوظيفة غير معروف على أساس مجموعة من الأمثلة التي يحددها تاريخ هذه السلسلة الزمنية.
على العكس من ذلك، بالنسبة لسلسلة زمنية عشوائية، فإن معرفة الماضي لا تقدم أي تلميحات مفيدة للتنبؤ بالمستقبل. لذلك، وفقا لنظرية السوق كفاءة، فإن تشتت القيم المتوقعة من السلاسل الزمنية لن تتغير عند غمر في الفضاء تأخر.
ويبين الشكل 2 الفرق بين ديناميات الفوضى والدين العشوائي (العشوائي) الذي تم اكتشافه أثناء الغمر.
الشكل 2. الفرق بين العملية العشوائية وديناميكيات الفوضى المكتشفة أثناء الغمر.
تأكيد تجريبي من سلسلة الوقت التنبؤ.
وتسمح لنا طريقة الانغماس بأن نقيس كميا إمكانية التنبؤ بالأوراق المالية الحقيقية، أي إثبات أو دحض فرضية السوق الفعالة. وفقا لهذه الأخيرة، تشتت النقاط في جميع الإحداثيات مساحة متخلفة متطابقة (إذا كانت النقاط موزعة بشكل عشوائي قيم عشوائية مستقلة). بل على العكس من ذلك، فإن الديناميات الفوضوية التي توفر إمكانية توقع معينة يجب أن تؤدي إلى تجميع الملاحظات حول سطح مفرط معين، أي أن العينة التجريبية تشكل مجموعة ذات أبعاد أصغر من أبعاد مساحة التأخر بأكملها.
لقياس الأبعاد، يمكنك استخدام خاصية بديهية التالية: إذا كانت مجموعة لها البعد D، ثم، شريطة أن يتم تقسيمها إلى أسطح مكعبة أصغر وأصغر مع جانب من، وعدد من هذه المكعبات سوف تنمو كما. وتكمن هذه الحقيقة في الكشف عن أبعاد المجموعات بواسطة طريقة عد الصندوق التي نعرفها من الاعتبارات السابقة. يتم الكشف عن البعد من مجموعة من النقاط بمعدل تزايد عدد الصناديق التي تحتوي على جميع النقاط من مجموعة. لتسريع الخوارزمية، ونحن نأخذ أبعاد كما مضاعفات من 2، أي، يتم قياس مقياس القرار بت.
وكمثال على سلسلة زمنية نموذجية في السوق، دعونا نأخذ مثل هذه الأداة المالية المعروفة كمؤشر S & أمب؛ P500 الذي يعكس متوسط ديناميات الأسعار في بورصة نيويورك. ويبين الشكل 3 ديناميات المؤشر للفترة 679 شهرا. ويوضح الشكل 4 البعد (بعد المعلومات) من الزيادات في هذه السلسلة الزمنية، المحسوبة بطريقة حساب الصناديق.
الشكل 4. البعد المعلوماتي للزيادات الزمنية للسلسلة الزمنية S & أمب؛ P500.
على النحو التالي من الشكل 4، وتشكل النقاط التجريبية مجموعة من البعد من حوالي 4 في مساحة الغمر 15 الأبعاد. وهذا أقل بكثير من 15 سنحصل عليه استنادا إلى نظرية السوق الفعالة التي تعتبر السلسلة الزمنية للزيادات كقيم عشوائية مستقلة.
وهكذا، فإن البيانات التجريبية توفر دليلا مقنعا على وجود عنصر معين يمكن التنبؤ به في سلسلة زمنية مالية، على الرغم من أننا لا نستطيع أن نذكر أن هناك ديناميات الفوضوية المحددة تماما هنا. ثم تستند محاولات تطبيق تحليل الشبكة العصبية للتنبؤ بالسوق إلى أسباب قوية.
ومع ذلك، تجدر الإشارة إلى أن القدرة على التنبؤ النظرية لا تضمن إمكانية بلوغ مستوى كبير من التنبؤات من الناحية العملية. ويمكن الحصول على تقدير كمي لإمكانية التنبؤ بسلاسل زمنية محددة عن طريق قياس الانتروبيا المتبادل، وهو أمر ممكن أيضا باستخدام تقنية عد الصندوق. على سبيل المثال، سوف نقوم بقياس إمكانية التنبؤ بزيادات S & أمب؛ P500 المتعلقة بعمق الغمر. عبر الكون.
(الشكل 5) يقيس المعلومات الإضافية عن القيمة التالية للمسلسلات الزمنية المدعومة بمعرفة القيم السابقة لهذه السلسلة الزمنية.
الشكل 5. قابلية التنبؤ لعلامات الزيادة لسلسلة زمنية S & أمب؛ P500 المتعلقة بعمق الغمر (عرض "النافذة").
زيادة عمق الغمر أكثر من 25 سيكون مصحوبا بانخفاض إمكانية التنبؤ.
وسوف نقوم كذلك بتقييم الربح الذي يمكن الوصول إليه عمليا عند هذا المستوى من القدرة على التنبؤ.
تشكيل مساحة الإدخال من السمات.
في الشكل 5، يمكنك أن ترى أن العرض المتزايد لنافذة غمر السلاسل الزمنية يؤدي في النهاية إلى تقليل قابلية التنبؤ - عندما لا يتم تعويض أبعاد المدخلات المتزايدة بقيم المعلومات الخاصة بهم بعد الآن. في هذه الحالة، إذا كان البعد مساحة تأخر كبير جدا بالنسبة لعدد معين من الأمثلة، علينا أن نستخدم أساليب خاصة لتشكيل مساحة من الصفات مع أبعاد أصغر. وسوف يرد أدناه وصف للطرق الخاصة بالسلاسل الزمنية المحددة لاختيار السمات و / أو زيادة كمية الأمثلة المتاحة.
اختيار إرور فونكتيونال.
لجعل التعلم الشبكة العصبية، فإنه لا يكفي لتشكيل مجموعات تدريس المدخلات / المخرجات. ويجب تحديد خطأ التنبؤ بالشبكات أيضا. خطأ الجذر متوسط مربع المستخدمة في معظم تطبيقات الشبكة العصبية بشكل افتراضي ليس لديها الكثير من "المعنى المالي" لسلسلة زمنية السوق. هذا هو السبب في أننا سوف ننظر في قسم خاص من المادة الأخطاء المحددة للسلاسل الزمنية المالية وإظهار كيف أنها ترتبط بمعدل الربح ممكن.
على سبيل المثال، لاختيار موقع السوق، وكشف موثوق به من علامة التغيرات معدل هو أكثر أهمية بكثير من انخفاض متوسط الانحراف مربع. على الرغم من أن هذه المؤشرات ترتبط ببعضها البعض، فإن الشبكات الأمثل لأحدها سوف توفر توقعات أسوأ من الآخر. اختيار وظيفة خطأ كافية، كما نثبت ذلك أكثر في هذه المقالة، يجب أن تقوم على استراتيجية مثالية معينة وتملي، على سبيل المثال، عن طريق الرغبة في تعظيم الأرباح (أو تقليل الخسائر المحتملة).
الشبكات العصبية التعلم.
وتتمثل السمات الرئيسية الرئيسية للتنبؤ بالسلاسل الزمنية في مجال تجهيز البيانات المسبق. إجراء التدريس للشبكات العصبية منفصلة هو المعيار. وكالمعتاد، يتم تقسيم المعلمات المتاحة إلى ثلاث عينات: التعلم، والتحقق من صحة والاختبار. يتم استخدام أول واحد لتعلم الشبكة، والثاني هو لاختيار بنية الشبكة الأمثل و / أو لاختيار لحظة لوقف تعليم الشبكة. وأخيرا، فإن الثالث الذي لم يستخدم في التدريس على الإطلاق يخدم لمراقبة جودة التنبؤ من الشبكة العصبية "المدربة".
ومع ذلك، لسلسلة زمنية مالية صاخبة جدا، واستخدام الشبكات العصبية زمرة قد يؤدي إلى زيادة كبيرة في موثوقية التنبؤ. سننهي هذه المقالة بمناقشة هذه التقنية.
في بعض الأبحاث، يمكننا أن نجد أدلة على جودة التنبؤ أفضل بسبب استخدام الشبكات العصبية ردود الفعل. ويمكن لهذه الشبكات أن تحتوي على ذاكرة محلية تحفظ بيانات الماضي البعيد عن تلك المتوفرة صراحة في المدخلات. ومع ذلك، وبالنظر إلى هذه المعماريات من شأنه أن يجعلنا الحفر من الموضوع الرئيسي، وأكثر من ذلك لأن هناك بعض الطرق البديلة لتوسيع كفاءة "الأفق" الشبكة بسبب تقنيات الغمر سلسلة زمنية خاصة وصفها أدناه.
تشكيل مساحة من السمات.
ويعتبر التشفير الفعال للمدخلات مفتاحا لتحسين جودة التنبؤ. ومن الأهمية بمكان بالنسبة لسلسلة زمنية مالية لا يمكن التنبؤ بها. جميع التوصيات القياسية حول المعالجة المسبقة للبيانات تنطبق هنا أيضا. ومع ذلك، هناك أساليب زمنية محددة سلسلة المالية للمعالجة المسبقة للبيانات، ونحن سوف تنظر في مزيد من التفاصيل في هذا القسم.
طرق إمرزينغ سلسلة الوقت.
أولا وقبل كل شيء، يجب أن نبقي العقل الأيوني أننا يجب أن لا تستخدم قيم يقتبس أنفسهم، والتي نعينها، والمدخلات أو مخرجات الشبكة العصبية. هذه هي التغييرات الاقتباس التي هي كبيرة حقا للتنبؤ. وبما أن هذه التغييرات تكمن، كقاعدة عامة، في نطاق أصغر بكثير من الاقتباسات نفسها، هناك علاقة قوية بين قيم المعدلات - القيمة التالية الأكثر احتمالا للمعدل تساوي قيمتها السابقة. وفي الوقت نفسه، وكما أكدنا مرارا وتكرارا، من أجل زيادة جودة التعلم، ينبغي أن نعمل من أجل الاستقلال الإحصائي للمدخلات، أي لعدم وجود مثل هذه الترابطات.
هذا هو السبب في أنه من المنطقي لتحديد القيم الأكثر إحصائيا مستقلة كمدخلات، على سبيل المثال، تغييرات الاقتباس أو لوغاريتم الزيادة النسبية. هذا الخيار الأخير هو جيد لسلسلة زمنية طويلة الأمد، حيث يؤثر التضخم تصبح ملحوظة جدا. في هذه الحالة، سوف الاختلافات البسيطة في أجزاء مختلفة من سلسلة تقع في نطاقات مختلفة، لأنه، في الواقع، يتم قياسها في وحدات مختلفة. على العكس من ذلك، فإن النسب بين الاقتباسات المتتالية لا تعتمد على وحدات القياس وأنها ستكون من نفس المقياس، على الرغم من أن وحدات القياس تغير بسبب التضخم. ونتيجة لذلك، فإن زيادة الترابط في السلاسل الزمنية تسمح لنا باستخدام تاريخ أكبر للتدريس وتوفير تعليم أفضل.
ومن عيوب الانغماس في حيز متخلف هو "آفاق" الشبكة المحدودة. على العكس من ذلك، التحليل الفني لا يحدد النافذة في الماضي، ويستخدم أحيانا القيم البعيدة جدا للسلاسل الزمنية. على سبيل المثال، يتم التأكيد على القيم القصوى والقصوى لسلسلة زمنية، حتى مأخوذة من الماضي البعيد نسبيا، لتأثير قوي بدلا من علم النفس التجار، وبالتالي، يجب أن هذه القيم لا تزال كبيرة للتنبؤ. لا يمكن أن توفر نافذة واسعة بما فيه الكفاية للغمر في الفضاء المتأخر مثل هذه المعلومات، والتي، بطبيعة الحال، يقلل من كفاءة التنبؤ. ومن ناحية أخرى، فإن توسيع النافذة إلى القيم التي تغطي القيم البعيدة والقصوى للسلاسل الزمنية سيزيد من أبعاد الشبكة. هذا، بدوره، سوف يؤدي إلى انخفاض دقة التنبؤات الشبكة العصبية - ويرجع ذلك الآن إلى نمو الشبكة.
ويمكن إيجاد طريقة للخروج من هذا الوضع الذي يبدو أنه طريق مسدود في الطرق البديلة لترميز السلوك السابق للسلسلة الزمنية. ومن البديهي أن المزيد من التاريخ السلاسل الزمنية يعود مرة أخرى، وأقل من تفاصيل سلوكها تؤثر على نتائج التنبؤ. ويتحدد ذلك من خلال التصور الذاتي من الماضي من قبل التجار التي، بالمعنى الدقيق للكلمة، تشكل المستقبل. ولذلك، ينبغي أن نجد مثل هذا التمثيل لديناميات السلاسل الزمنية، والتي سيكون لها دقة انتقائية: وإلى الماضي، وتفاصيل أقل. وفي الوقت نفسه، يجب أن يبقى المظهر العام للمنحنى سليما. ما يسمى التحلل المويجة يمكن أن يكون واعدة جدا هنا. وهو ما يعادل في قيمة المعلومات الخاصة به إلى الغمر تأخر، لكنه يجعل من أسهل لضغط البيانات في مثل هذه الطريقة التي يتم وصف الماضي مع دقة انتقائية.
تقليل أبعاد المدخلات: السمات.
ويعتبر ضغط البيانات هذا مثالا على استخراج السمات الأكثر أهمية للتنبؤ من عدد كبير جدا من متغيرات المدخلات. وقد سبق وصف طرق الاستخلاص المنهجي للصفات أعلاه. يمكن (ويجب) أن تطبق تباعا على التنبؤ السلاسل الزمنية أيضا.
ومن المهم أن يسهم تمثيل المدخلات في تيسير استخراج البيانات. تمثيل المويجة هو مثال جيد (من وجهة نظر سمات استخراج) الترميز (كايزر، 1995). على سبيل المثال، يظهر الرسم البياني التالي (الشكل 6) قسما من 50 قيمة لسلسلة زمنية مع إعادة إعمارها من قبل 10 معاملات مويجات مختارة خصيصا. يرجى ملاحظة أنه على الرغم من أنه يحتاج إلى بيانات أقل بخمسة أضعاف، إلا أنه يتم إعادة بناء الماضي القريب للمسلسلات الزمنية بدقة، في حين يتم استعادة الماضي البعيد في المخطط العام، وينعكس الارتفاع والهبوط بشكل صحيح. لذلك، فمن الممكن لوصف نافذة 50 الأبعاد مع ناقلات الإدخال 10 الأبعاد فقط مع دقة مقبولة.
الشكل 6. مثال على نافذة 50-الأبعاد (خط صلب) وإعادة إعمارها من قبل 10 معاملات المويجة (س).
وهناك نهج آخر ممكن يستخدم، كمرشحين محتملين لفضاء السمات، مختلف المؤشرات الفنية التي تحسب تلقائيا في حزم البرامج المناسبة (مثل ميتاستوك أو ويندوز في وول ستريت). إن العدد الكبير من هذه الصفات التجريبية (كولبي، 1988) يجعل استخدامها صعبا، على الرغم من أن كل منها قد يكون مفيدا إذا ما طبق على سلسلة زمنية معينة. سوف الطرق المذكورة أعلاه تسمح لك لتحديد مجموعة أهم من المؤشرات الفنية لاستخدامها كمدخلات في الشبكة العصبية.
طريقة تلميحات.
واحدة من أضعف النقاط في التنبؤ المالي هو عدم وجود أمثلة لتعلم الشبكة العصبية. وبوجه عام، فإن الأسواق المالية (وخاصة الأسواق الروسية) ليست ثابتة. هناك مؤشرات جديدة هناك والتي لم يتم تراكم أي تاريخ حتى الآن، وطبيعة التداول في الأسواق القديمة يتغير مع الوقت. في هذه الظروف، طول السلسلة الزمنية المتاحة لتعلم الشبكة العصبية محدودة نوعا ما.
ومع ذلك، يمكننا زيادة عدد الأمثلة باستخدام بعض الاعتبارات المسبقة حول المتغيرات من ديناميات السلاسل الزمنية. هذا هو مصطلح فيزيائي رياضي آخر يمكن أن يحسن إلى حد كبير نوعية التنبؤ المالي. المسألة هي توليد أمثلة اصطناعية (تلميحات) تم الحصول عليها من تلك الموجودة من خلال التحولات المختلفة المطبقة عليها.
دعونا شرح الفكرة الرئيسية مع مثال. الافتراض التالي هو معقول من الناحية النفسية: التجار يدفعون في الغالب انتباههم إلى شكل منحنى السعر، وليس إلى قيم محددة على المحاور. لذلك، إذا كنا تمتد سلسلة الوقت كله قليلا على طول محور يقتبس، ونحن سوف تكون قادرة على استخدام السلاسل الزمنية الناتجة عن هذا التحول (جنبا إلى جنب مع واحد الأولية) لتعلم الشبكة العصبية. وهكذا، فقد ضاعفنا عدد الأمثلة بسبب استخدام معلومات مسبقة ناتجة عن السمات النفسية لكيفية نظر المتداولين إلى السلاسل الزمنية. وعلاوة على ذلك، جنبا إلى جنب مع زيادة عدد الأمثلة، ونحن محدودة فئة من وظائف للبحث في الحل بين، مما يزيد أيضا من جودة التنبؤ (إذا، بطبيعة الحال، ثابت ثابت هو الصحيح للحقيقة).
وتوضح نتائج حساب إمكانية التنبؤ ب S & أمب؛ P500 بواسطة طريقة عد مربع مبينة أدناه (انظر الشكل 7، 8) دور التلميحات. تم تشكيل مساحة السمات، في هذه الحالة، بواسطة تقنية التعامد. استخدمنا 30 عنصر رئيسي كمتغيرات المدخلات في مساحة التأخر 100 الأبعاد. ثم اخترنا 7 سمات هذه المكونات الرئيسية - أهم تركيبات الخطية المتعامدة. كما ترون من الأشكال أدناه، تبين فقط تطبيق تلميحات، في هذه الحالة، لتكون قادرة على توفير إمكانية التنبؤ ملحوظ.
الشكل 7. التنبؤ بتغيير علامات الاقتباس ل S & أمب؛ P500.
الشكل 8. توقع علامة تغيير علامات الاقتباس ل S & أمبير؛ P500 بعد عدد من الأمثلة تم كوادروبليكاتد من خلال تمتد على محور السعر.
يرجى ملاحظة أن استخدام المساحات المتعامدة أدى إلى زيادة معينة في القدرة على التنبؤ بالمقارنة مع طريقة الغمر القياسية: من 0.12 بتة (الشكل 5) إلى 0.17 بتة (الشكل 8). في وقت لاحق قليلا، عندما نبدأ مناقشة تأثير القدرة على التنبؤ على الأرباح، ونحن سوف تثبت أنه بسبب هذا، فإن معدل الربح يمكن أن تصبح نصف كبيرة مرة أخرى.
وهناك مثال آخر أقل تفاؤلا لنجاح استخدام مثل هذه التلميحات لشبكة عصبية في أي اتجاه للبحث عن حل هو استخدام التناظر الخفي في تداول العملات الأجنبية. والشعور بهذا التناظر هو أنه يمكن النظر في اقتباسات الفوركس من "وجهة نظر" اثنين، على سبيل المثال، سلسلة من دم / $ أو سلسلة من $ / دم. زيادة واحد منهم يتوافق مع انخفاض واحد آخر. ويمكن استخدام هذه الخاصية لمضاعفة عدد الأمثلة: إضافة إلى كل مثال مثل التناظرية التناظرية. وأظهرت التجارب في التنبؤ بالشبكات العصبية أنه بالنسبة لأسواق الفوركس الأساسية، فإن النظر في التناظر يزيد من معدل الربح تقريبا مرتين، وتحديدا: من 5٪ إلى 10٪ سنويا بالنظر إلى تكاليف المعاملات الحقيقية (أبو مصطفى، 1995).
قياس جودة التنبؤ.
وعلى الرغم من أن التنبؤ بالسلسلة الزمنية المالية يحل نفسه في مشكلة تقريب وظيفة متعددة الأبعاد، فإنه يتميز بخصائص خاصة به عند تشكيل المدخلات واختيار النواتج للشبكة العصبية. وقد نظرنا بالفعل في المدخلات الواردة أعلاه. حتى الآن دعونا دراسة الميزات الخاصة لاختيار المتغيرات الناتج. ومع ذلك، أولا وقبل كل شيء، يجب علينا الإجابة على السؤال الرئيسي: كيف يمكن قياس نوعية التنبؤ المالي؟ وهذا سوف يساعدنا على العثور على أفضل استراتيجية التعلم الشبكة العصبية.
العلاقة بين قابلية التنبؤ ومعدل الربح.
ومن السمات الخاصة للتنبؤ بالسلاسل الزمنية المالية العمل على تحقيق أقصى قدر من الأرباح، وليس التقليل إلى أدنى حد من متوسط الانحراف المربعة، كما هو الحال في تقريب المهام.
في أبسط حالة من التداول اليومي، تعتمد الأرباح على علامة التنبؤ بشكل صحيح من تغيير الاقتباس. وهذا هو السبب في أن الشبكة العصبية يجب أن تهدف إلى التنبؤ الدقيق للعلامة، وليس القيمة نفسها. الآن دعونا نجد كيف يرتبط معدل الربح لدقة الكشف عن علامة في أبسط أداء من دخول السوق اليومي (الشكل 9).
الشكل 9. دخول السوق يوميا.
دعونا تعيين، اعتبارا من لحظة: رأس المال الكامل للتاجر هو، تغيير النسبية النسبية، وكما إخراج الشبكة دعونا نأخذ مستوى ثقتهم لعلامة هذا التغيير:. هذه الشبكة مع الإخراج اللاخطية من شكل يتعلم كيفية التنبؤ علامة التغيير وتوقع علامة مع مجموعة متناسبة مع احتمالها. ثم يتم تسجيل مكاسب رأس المال عند الخطوة كما يلي:
حيث حصة رأس المال "في اللعب". هذا هو الربح لفترة التداول بأكملها:
والربح نفسه سيكون أعلى قيمة ومتوسط:
هنا أدخلنا معامل. على سبيل المثال، لتوزيع غاوس،. ويرتبط مستوى القدرة على التنبؤ بالعلاقة مباشرة بالإنتروبيا المتبادل الذي يمكن تقديره مسبقا بطريقة حساب الصناديق. وفيما يتعلق بالمخرجات الثنائية (انظر الشكل 10):
الشكل 10. جزء من الاتجاهات المتوقعة بشكل صحيح من الاختلافات السلاسل الزمنية كدالة عبر الانتروبيا من علامة الإخراج للمدخلات المعروفة.
وفي نهاية المطاف، نحصل على التقدير التالي لمعدل الربح لقيمة توقع الإشارة المعينة التي أعبر عنها بتات:
وهو ما يعني أنه من حيث المبدأ بالنسبة للمسلسلات الزمنية مع إمكانية التنبؤ I، فمن الممكن مبدئيا مضاعفة رأس المال داخل الإدخالات إلى السوق. وهكذا، على سبيل المثال، تفترض القدرة على التنبؤ بالتسلسل الزمني S & أمب؛ P500 المحسوبة سابقا والتي تساوي I = 0.17 (انظر الشكل 8) مضاعفة رأس المال في المتوسط بالنسبة إلى الإدخالات في السوق. وهكذا، حتى علامة اقتباس تغيير أثر صغير يمكن أن توفر معدل ربح ملحوظ جدا.
هنا يجب أن نؤكد أن معدل الربح الأمثل يتطلب اللعب متأنية جدا عندما، في كل دخول إلى السوق، لاعب خطر حصة محددة بدقة من رأس المال:
حيث يكون حجم الربح / الخسارة النموذجي لهذا التقلب في السوق. كل من القيم الأصغر والأكبر من المعدلات سوف تقلل من الربح، وهو خطر كبير جدا التداول يمكن أن يؤدي إلى فقدان المال في أي إمكانية التنبؤ. وهذه الحقيقة مبينة في الشكل 11.
الشكل 11. الاعتماد على متوسط معدل الربح من حصة مختارة من رأس المال "في كيتي".
هذا هو السبب في أن التقديرات المذكورة أعلاه تعطي نظرة ثاقبة فقط في الحد الأعلى من معدل الربح. دراسة أكثر حذرا بالنظر إلى تأثير التذبذب خارج نطاق هذه المقالة. ومع ذلك، فمن الواضح نوعيا أن اختيار أحجام العقود الأمثل يتطلب تقدير دقة التنبؤ في كل خطوة.
اختيار إرور فونكتيونال.
إذا أخذنا الغرض من التنبؤ السلاسل الزمنية المالية لتحقيق أقصى قدر من الأرباح، فمن المنطقي لضبط الشبكة العصبية لهذه النتيجة النهائية. على سبيل المثال، إذا كنت التجارة وفقا للمخطط أعلاه، يمكنك اختيار للشبكة العصبية تعلم وظيفة خطأ التعلم التالية متوسطه من قبل جميع الأمثلة من عينة التعلم:
هنا، يتم عرض حصة رأس المال في اللعب كما إخراج شبكة إضافية ليتم تعديلها أثناء التعلم. For this approach, the first neuron, , with activation function will give us the probability of increasing or decreasing rate, while the second network output, , will produce the recommended share of the capital to be invested at the given stage.
However, since this share, according to the preceding analysis, must be proportional to the forecasting confidence level, you can replace two network outputs with only one by placing and limit yourselves to the optimization of only one global parameter, , that will minimize the error:
This produces an opportunity to regulate the rate according to the risk level predicted by the network. Playing with variable rates produces more profits than playing with fixed rates. Indeed, if you fix the rate having defined it by its average predictability, then the capital growth rate will be proportional to , while, if you select the optimal rate at each step, it will be proportional to .
Using Coterie Networks.
Generally speaking, the predictions made by different networks trained on the same sample will be different due to the random nature of choosing the initial values of synaptic weights. This disadvantage (an element of uncertainty) can be turned out into an advantage having organized a coterie neural expert consisting of different neural networks. The dispersion of experts' predictions will give an idea of the confidence level of these predictions, which can be used for choosing a correct trading strategy.
It is easy to prove that the average of the coterie values must produce better forecasting than an average expert of the same coterie. Let the error of the i th expert for the input value of be equal to . An average error of a coterie is always less than the mean-square error of individual experts in view of Cauchy inequality:
It must be noted that the reduction of error can be rather essential. If the errors of individual experts don't correlate with each other, i. e., , the mean-square error of a coterie consisting of L experts is times smaller than the average individual error of one expert!
This is why it would be better to base one's forecasting on the average values of the whole coterie. This fact is illustrated by Fig. 12.
Fig. 12. Profit rate for the last 100 values of time-series sp500 when forecasting with a coterie of 10 networks.
The profit of the coterie (circles) is higher than that of an average expert. The score of correctly predicted signs for the coterie is 59:41.
As you can see from Fig. 12, in this case, the profit of the coterie is even higher than that of each expert. Thus, the coterie method can essentially improve the forecasting quality. Please note the absolute value of profit rate: The capital of the coterie increased 3.25 times at 100 entries to the market (this rate will, of course, be lower if transactional costs are considered).
The predictions were obtained at network learning on the 30 consecutive exponential moving averages (EMA 1 … EMA 30) of the index increment time-series. The increment sign at the next step was predicted.
In this experiment, the rate was fixed at the level of close to the optimal one for the given forecasting accuracy (59 correctly predicted signs vs. 41 incorrectly predicted ones), i. e., . In Fig. 13, you can see the results of a riskier trading on the same predictions , namely with .
Fig. 13. Profit rate for the last 100 values of time-series sp500 when forecasting with the same coterie of 10 networks, but with a riskier strategy.
The profit of the coterie remains at the same level (a bit increased) since this risk value is as close to optimum as the preceding one. However, for most networks, the predictions of which are less accurate than those of the coterie as a whole, such rates turned out to be too risky, which resulted to their practically full ruining.
The above examples demonstrate how important it is to be able to correctly estimate the forecasting quality and how this estimate can be used to increase the profitability of the same predictions.
We can go to even greater extremes and use the weighted opinions of expert networks instead of the average ones. The weights should be chosen adaptively maximizing the predictive ability of the coterie on the learning sample. As a result, worse trained networks of a coterie make a smaller contribution and don't spoil the prediction.
The possibilities of this method are illustrated by the below comparison of predictions made by two types of coterie networks consisting of 25 experts (see Fig. 14 and 15). The predictions were made according to the same scheme: as inputs, the exponential moving averages of the time-series were used with periods equal to the first 10 Fibonacci numbers. According to the results obtained from 100 experiments, the weighted prediction provides an average excess of correctly predicted signs over the incorrectly predicted ones, approximately equal to 15, while for the average prediction this factor is about 12. It should be noted that the total amount of price rises as compared to declining rates within the given period is exactly equal to 12. Therefore, considering the main tendency to increasing as a trivial constant prediction of the sign of "+" gives the same result for the percentage of correctly predicted signs as the weighted opinion of 25 experts.
Possible Profit Rate of Neural Network Predictions.
Up to now, we have formulated the results of numeric experiments as the percentage of correctly predicted signs. Now let's find out about the really reachable profit rate when trading using neural networks. The upper limits of the profit rate, obtained above without considering fluctuations, are hardly reachable in practice, the more so that we have not considered transaction costs before which can cancel out the reached predictability level.
Indeed, considering the commissions results in appearance of a decay constant:
Moreover, unlike the predictability level , commission enters linearly, not quadratically. Thus, in the above example, the typical values of predictability cannot exceed commission .
To give an idea of the real possibilities of neural networks in this field, we will give the results of automated trading using neural networks on three indexes with different typical times: the values of index S$P500 with monthly intervals between readings, daily quotes of DM/$, and hourly readings of futures for Lukoil shares on the Russian Exchange. The statistics of forecasting was collected on 50 different neural network systems (containing coteries of 50 neural networks each). The time-series themselves and the results of forecasting the signs on a test set of the last 100 values of each time-series are shown in Fig. 16.
Fig. 16. Average values and histograms of the number of correctly ( ) and incorrectly ( ) predicted signs on testing samples of 100 values of three real financial indexes.
These results confirm the intuitively obvious regularity: the time-series are the more predictable, the less time elapses between the readings. Indeed, the more time passes between the consecutive values of a time-series, the more information, external towards its dynamics, is available for the market participants and, therefore, the less information about the future is in the time-series itself.
Then the predictions obtained above were used for trading on a test set. At the same time, the size of the contract at each step was chosen in proportion to the confidence degree of the prediction, while the value of global parameter was optimized on the learning sample. Besides, according to its success, each network in the coterie had its own floating rating. In the forecasting at each step, we used only the actually "best" part of networks. The results of such "neural" traders are shown in Fig. 17.
Fig. 17. Winning statistics of 50 realizations according to the amount of commissions.
Real values of commissions drawn in dashed lines show the area of really reachable profit rates.
The final win (like the game strategy itself), of course, depends on the commission size. It is this dependence that is shown in the above diagrams. The realistic values of commissions in the chosen units of measurement known to the author are marked in the figure. It must be refined that the "quantized" nature of the real trading was not considered in those experiments, i. e., we didn't consider that fact that the size of trades must be equal to the integer number of typical contracts . This case corresponds with trading large capitals where the typical trades contain many contracts. Besides, the guaranteed trading was implied, i. e., the profit rate was calculated as a ratio to the security capital that is much smaller than the scaling of contracts themselves.
The above results show that trading based on neural networks is really promising, at least for short terms. Moreover, in view of the self-similarity of financial time-series (Peters, 1994), the profit rate per time unit will be the higher, the less the typical trading time is. Thus, automated traders using neural networks turn out to be most efficient when trading in the real time mode where their advantages over typical brokers are most noticeable: fatigue-proof, nonsusceptibility to emotions, potentially much higher response rate. A well-trained neural network connected to an automated trading system can make decisions much earlier than a human broker recognizes price changes in the charts of his or her terminal.
استنتاج.
We demonstrated that (at least some of) market time-series were partly predictable. Like any other kind of neural analysis, the forecasting time-series requires a rather complicated and careful data pre-processing. However, working with time-series has its own specific character that can be used to increase profits. This relates to both the selection of inputs (using special methods of data representation) and the selection of outputs, and the use of specific error functionals. Lastly, we demonstrated how more profitable it is to use coterie neural experts as compared to separate neural networks, and also provided the data of real profit rates on several real securities.
References:
Sharpe, W. F., Alexander, G. J., Bailey, J. W. (1997). Investments . - 6th edition, Prentice Hall, Inc., 1998. Abu-Mostafa, Y. S. (1995). "Financial market applications of learning from hints”. In Neural Networks in Capital Markets. Apostolos-Paul Refenes (Ed.), Wiley, 221-232. Beltratti, A., Margarita, S., and Terna, P. (1995). Neural Networks for Economic and Financial Modeling . ITCP. Chorafas, D. N. (1994). Chaos Theory in the Financial Markets . Probus Publishing. Colby, R. W., Meyers, T. A. (1988). The Encyclopedia of Technical Market Indicators . IRWIN Professional Publishing. Ehlers, J. F. (1992). MESA and Trading Market Cycles . Wiley. Kaiser, G. (1995). A Friendly Guide to Wavelets . Birk. LeBeau, C., and Lucas, D. W. (1992). Technical traders guide to computer analysis of futures market . Business One Irwin. Peters, E. E. (1994). Fractal Market Analysis . Wiley. Pring, M. G. (1991). Technical Analysis Explained . McGraw Hill. Plummer, T. (1989). Forecasting Financial Markets . Kogan Page. Sauer, T., Yorke, J. A., and Casdagli, M. (1991). "Embedology". Journal of Statistical Physics . 65 , 579-616. Vemuri, V. R., and Rogers, R. D., eds. (1993). Artificial Neural Networks. Forecasting Time Series. IEEE Comp. Soc. Press. Weigend, A and Gershenfield, eds. (1994). Times series prediction: Forecasting the future and understanding the past . Addison-Wesley. Baestaens, D.-E., Van Den Bergh, W.-M., Wood, D. Neural Network Solutions for Trading in Financial Markets . Financial Times Management (July 1994).
The article is published with consent of the author.
About the author: Sergey Shumskiy is the senior research associate at the Physics Institute of the Russian Academy of Sciences, Cand. Sc. (Physics and Mathematics), machine learning and artificial intelligence technician, Presidium member of the Russian Neural Networks Society, the CEO of the IQMen Corp. that develops enterprise expert systems using machine learning technologies. Mr. Shumskiy is a co-author of over 50 scientific publications.
ترجمة من الروسية من قبل شركة ميتاكوتس سوفتوار Corp.
توقعات سلسلة الوقت.
Time Series Forecast ( TSF) is the instrument of technical analysis including linear measurement of regression computed as per the method of least-squares. Time Series Forecast is similar to linear regression in the part of determining presence/absence of trend on a considered time-frame. On chart TSF is drawn as the curve consisting of the last points of several lines of linear regression trend.
Besides, Time Series Forecast defines incline angle for Forex trend (ascending or descending) and is able to forecast further movement of price on market. That is to say, under ascending trend, T ime Series Forecast defines its incline angle and through matching it with real price calculates its value in the next period of time. If tendency of price movement remains, the indicator is able to define course of its movement at a rather high precision.
ليس عميل حتى الآن؟
يصبح حساب تجريبي.
يسمح بنسخ المحتويات فقط مع ارتباط تشعبي نشط بالمصدر الأصلي.
يتم تقديم الخدمات المالية من قبل شركة ريستون كابيتال المحدودة. الخدمات الموصوفة على موقعنا الإلكتروني غير متوفرة في العراق واليابان وكوريا الشمالية والاتحاد الأوروبي والمملكة المتحدة والولايات المتحدة الأمريكية.
روبوت الثروة.
Posted on February 4, 2018 by Kris Longmore.
Recently, I wrote about fitting mean-reversion time series models to financial data and using the models’ predictions as the basis of a trading strategy. Continuing my exploration of time series modelling, I decided to research the autoregressive and conditionally heteroskedastic family of time series models. In particular, I wanted to understand the autogressive integrated moving average (ARIMA) and generalized autoregressive conditional heteroskedasticity (GARCH) models, since they are referenced frequently in the quantitative finance literature, and its about time I got up to speed. What follows is a summary of what I learned about these models, a general fitting procedure and a simple trading strategy based on the forecasts of a fitted model.
Several definitions are necessary to set the scene. I don’t want to reproduce the theory I’ve been wading through; rather here is my very high level summary of what I’ve learned about time series modelling, in particular the ARIMA and GARCH models and how they are related to their component models:
At its most basic level, fitting ARIMA and GARCH models is an exercise in uncovering the way in which observations, noise and variance in a time series affect subsequent values of the time series. Such a model, properly fitted, would have some predictive utility, assuming of course that the model remained a good fit for the underlying process for some time in the future.
An ARMA model (note: no “I”) is a linear combination of an autoregressive (AR) model and moving average (MA) model. An AR model is one whose predictors are the previous values of the series. An MA model is structurally similar to an AR model, except the predictors are the noise terms. An autoregressive moving average model of order p, q – ARMA(p, q) – is a linear combination of the two and can be defined as:
where $w_ $ is white noise and $a_ $ and $ b_ $ are coefficients of the model.
An ARIMA(p, d,q) model is simply an ARMA(p, q) model differenced ‘d’ times – or integrated (I)- to produce a stationary series.
Finally, a GARCH model attempts to also explain the heteroskedastic behavior of a time series (that is, the characteristic of volatility clustering) as well as the serial influences of the previous values of the series (explained by the AR component) and the noise terms (explained by the MA component). A GARCH model uses an autoregressive process for the variance itself, that is, it uses past values of the variance to account for changes to the variance over time.
With that context setting out of the way, I next fit an ARIMA/GARCH model to the EUR/USD exchange rate and use it as the basis of a trading system. The model’s parameters for each day are estimated using a fitting procedure, that model is then used to predict the next day’s return and a position is entered accordingly and held for one trading day. If the prediction is the same as for the previous day, the existing position is maintained.
A rolling window of log returns is used to fit an optimal ARIMA/GARCH model at the close of each trading day. The fitting procedure is based on a brute force search of the parameters that minimize the Aikake Information Criterion, but other methods can be used. For example, we could choose parameters that minimize the Bayesian Information Criterion, which may help to reduce overfitting by penalizing complex models (that is, models with a large number of parameters). This fitting procedure was inspired by Michael Halls-Moore’s post about an ARIMA+GARCH trading strategy for the S&P500, and I borrowed some of his code.
I chose to use a rolling window of 1000 days to fit the model, but this is a parameter for optimization. There is a case for using as much data as possible in the rolling window, but this may fail to capture the evolving model parameters quickly enough to adapt to a changing market. I won’t explore this too much here, but it would be interesting to investigate the strategy’s performance as a function of the lookback window. Here’s the code:
First, the directional predictions only: buy when a positive return is forecast and sell when a negative return is forecast. The results of this approach are shown below (no allowance for transaction costs):
You might have noticed that in the model fitting procedure above, I retained the actual forecast return values as well as the direction of the forecast return. I want to investigate the predictive power of the magnitude of the forecast return value. Specifically, does filtering trades when the magnitude of the forecast return is below a certain threshold improve the performance of the strategy? The code below performs this analysis for a small return threshold. For simplicity, I converted the forecast log returns to simple returns to enable manipulation of the sign of the forecast and easy implementation.
And the results overlaid with the raw strategy:
It occurred to me that the ARIMA/GARCH model we fit on certain days may be a better or worse representation of the underlying process than other days. Perhaps filtering trades when we have less confidence in our model would improve performance. This approach requires that the statistical significance of each day’s model fit be evaluated, and a trade only entered when this significance exceeds a certain threshold. There are a number of ways this could be accomplished. Firstly, we could visually examine the correlogram of the model residuals and make a judgement on the goodness of fit on that basis. Ideally, the correlogram of the residuals would resemble a white noise process, showing no serial correlation. The correlogram of the residuals can be constructed in R as follows:
acf ( fit @ fit $ residuals , main = 'ACF of Model Residuals' )
While this correlogram suggests a good model fit, it is obviously not a great approach as it relies on subjective judgement, not to mention the availability of a human to review each day’s model. A better approach would be to examine the Ljung-Box statistics for the model fit. The Ljung-Box is a hypothesis test for evaluating whether the autocorrelations of the residuals of a fitted model differ significantly from zero. In this test, the null hypothesis is that the autocorrelation of the residuals is zero; the alternate is that the series possesses serial correlation. Rejection of the null and confirmation of the alternate would imply that the model is not a good fit, as there is unexplained structure in the residuals. The Ljung-Box statistic is calculated in R as follows:
The p-value in this case provides evidence that the residuals are independent and that this particular model is a good fit. By way of explanation, the Ljung-Box test statistic (X-squared in the code output above) grows larger for increasing autocorrelation of the residuals. The p-value is the probability of obtaining a value as large or larger than the test statistic under the null hypothesis. Therefore, a high p-value in this case is evidence for independence of the residuals. Note that it applies to all lags up to the one specified in the Box . test ( ) function.
Applying the Ljung-Box test to each day’s model fit reveals very few days where the null hypothesis of independent residuals is rejected, so extending the strategy to also filter any trades triggered by a poor model fit is unlikely to add much value:
Conclusions and future work.
The performance of the ARIMA/GARCH strategy outperforms a buy and hold strategy on the EUR/USD for the backtest period, however the performance is nothing spectacular. It seems that it is possible to improve the performance of the strategy by filtering on characteristics such as the magnitude of the prediction and the goodness of fit of the model, although the latter does not add much value in this particular example. Another filtering option could be to calculate the 95% confidence interval for each day’s forecast and only enter a trade when the sign of each limit is the same, although this would greatly reduce the number of trades actually taken.
There are many other varieties of the GARCH model, for example exponential, integrated, quadratic, threshold, structural and switching to name a few. These may or may not provide a better representation of the underlying process than the simple GARCH (1,1) model used in this example. For an exposition of these and other flavors of GARCH, see Bollerslev et. الله. (1994).
An area of research that I have found highly interesting recently is time series forecasting through the intelligent combination of disparate models, for example by taking the average of the individual predictions of several models or seeking consensus or a majority vote on the sign of the prediction. To borrow some machine learning nomenclature, this ‘ensembling’ of models can often produce more accurate forecasts than any of the constituent models. Perhaps a useful approach would be to ensemble the predictions of the ARIMA/GARCH model presented here with a suitably trained artificial neural network or other statistical learning method. We could perhaps expect the ARIMA/GARCH model to capture any linear characteristics of the time series, while the neural network may be a good fit for the non-linear characteristics. This is all pure speculation, potentially with some backing from this paper, but an interesting research avenue nevertheless.
If you have any ideas for improving the forecast accuracy of time series models, I’d love to hear about them in the comments.
Finally, credit where credit is due: although I worked my way through numerous sources of information on financial time series modelling, I found Michael Halls-Moore’s detailed posts on the subject extremely helpful. He starts from the beginning and works through various models of increasing complexity. As stated in the main post, I also borrowed from his ARIMA + GARCH trading strategy for the S&P500 in designing the EUR/USD strategy presented here, particularly the approach to determining model parameters through iterative minimization of the Aikake Information Criterion. The ideas around filtering trades on the basis of the results of the Ljung-Box test and the absolute magnitude of the forecast value were my own (although I’m sure I’m not the first to come up with them).
Other references I found particularly useful:
Bollerslev, T. (2001). Financial Econometrics: Past Developments and Future Challenges , in Journal of Econometrics, Vol. 100, 41-51.
Bollerslev, T., Engle, R. F. and Nelson, D. B. (1994). GARCH Models , in: Engle, R. F., and McFadden, D. L. (eds.) Handbook of Econometrics, Vol. 4, Elsevier, Amsterdam, 2961-3038.
Engle, R. (2002). New Frontiers for ARCH Models , in Journal of Applied Econometrics, Vol. 17, 425-466.
Qi, M. and Zhang, G. P. (2008). Trend Time Series Modelling and Forecasting with Neural Networks , in IEEE Transactions on Nerual Networks, Vol. 19, No. 5, 8-8-816.
Tsay, R. (2018). Conditional Heteroscedastic Models , in Tsay, R. Analysis of Financial Time Series, Third Edition, Wiley, 109-174.
Here you can download the code and data used in this analysis: arima_garch.
Matt haines.
I was literally struggling through a bunch of ARMA ARIMA GARCH box test reading and then took a break to read your blog post. “Yes!” I shouted (in my head) when I read about you pondering all those big words and acronyms I’ve been struggling with. And then I realized you were also basing your work off Michaels writings. Damn stuff hurts my head. But I’m slowly getting it. You’re about 4 parsecs ahead of me so I’m going to have to keep an eye on your work as well. ؟ شكر.
Kris Longmore.
Hey Matt, thanks for the comment! I hope my article was useful for you. Yes, I learned a lot from Michael’s posts on this subject. He’s heavy on the detail and presents it in a logical way that continuously builds on the previous information. I recently purchased the rough cut of his latest book and refer to it often. Very much looking forward to the final release. In my article, I was aiming to succinctly summarise the theory and focus on some trading ideas that seem a fairly natural extension. Hopefully it was helpful!
شكرا على مشاركتك. Could you say what the Sharpe ratios of the tested strategies were?
Kris Longmore.
I didn’t calculate Sharpe ratios when I ran these strategies. You could easily do this yourself by running the script (available via the download link, along with the data I used) and using the performanceAnalytics package in R.
Hello, I am new to time series fitting and found your article very interesting. My question is: Is there not a random value involved in the prediction of the price per definition of a GARCH series ? If so, would it not make sense to calculate the probability for the forecast to be long or short by using the ARMA value as mean and the standard deviation and maybe apply a filter then by accepting only values above a certain threshold ?
Kris Longmore.
Hey, thanks for reading my blog. I think you are referring to the noise term in the GARCH definition? You could certainly experiment with an ARMA model – I’d love to hear about the results – but I’m not sure how that relates to the noise term in the GARCH model?
شكرا على البرنامج التعليمي. What line(s) of code would we need to account for transaction costs?
Kris Longmore.
There’s a few ways to do it, depending on how accurate or complex a transaction cost model you want. If a fixed transaction cost model would suffice, you could simply subtract this fixed transaction cost from each of your returns. For example, if a round turn on the EUR/USD costs you 1.5 pips, you simply do returns.
Of course, in reality you would get variable spread and variable slippage depending on factors such as real-time volatility and liquidity, so this may or may not be accurate enough for your purposes.
Kris Longmore.
In this example, I first fit an ARMA model of order (p, q) where (p, q) ∈ and (p, q) are chosen such that they minimzie the Aikake Information Criterion. Then we fit a model using GARCH (1,1) for the variance and ARMA(p, q) for the mean. A new model is constructed for each period in the simulation using the previous 1,000 periods. Each model is used once (to predict the next period’s return) and then discarded. So to answer your question, the approach used here doesn’t look for parameters that ‘work’ generally, rather we find the best parameters from our lookback window and assume they will hold for the next period.
This assumption may or may not be valid. And if this assumption is valid, while time series modeling is super interesting from a theoretical perspective, it may or may not be of practical use in a trading strategy. At the very least, there are certainly other considerations beyond the optimal model parameters. For example, from my own experience building trading models for the forex markets, I can share that the choice of sampling time (that is, the time you choose as the open/close of your daily bars) is of critical significance in the success or otherwise of the model.
Your comment is actually very timely! I recently built a GARCH backtesting framework for a client that enables efficient experimentation with these and other parameters, such as exit conditions and capital allocation. An efficient experimentation framework is really important for effective and practical research. If you are interested in something similar, ping me at kris[at]robotwealth.
امل ان يساعد.
The price data EURUSD. csv… How is the data structure in the file? Can you display the headers/first few rows so I can parse my data accordingly.
آسف. After posting my question I saw the download link for the file. Doooh!
Regarding your code how did you handle negative values for the returns? Because you are using the log for the ag. curve and with negative values you will have NaN.
Kris Longmore.
I honestly don’t remember…I’d have to re-run the code. But yes, you are correct – it makes more sense to use log returns which are additive. Multiplying simple returns is problematic in creating an equity curve when you have neutral positions. I’ve updated the post.
you can use this : ag. curve <- cumsum( ag. direction. returns)
I have studied Time Series Econometrics as part of my PhD specialization and I have found that simply drawing trends and patterns on a chart is a far superior approach than the most advanced statistical techniques such as Markov Switching Multivariate GARCH or Multivariate Autoregressive State Space Models. I feel kind of uneasy that all my efforts and sleepless nights were for nothing. But at least I know what the best approaches are.
Kris Longmore.
Great to hear that you’ve found something that works for you. I agree, sometimes simpler can be better.
Comments
Post a Comment