محمدرضا داودابادی

محمدرضا داودابادی

عنوان پایان‌نامه

پیشبینی مقدار شاخص های بازارهای مالی با استفاده از یک مدل مبتنی بر ترنسفورمر



    استاد راهنما
    فرزام متین فر
    استاد داور
    نویده مدرسی
    رشته تحصیلی
    مقطع تحصیلی
    کارشناسی ارشد
    ساعت دفاع

    چکیده

    در عصر کنونی بازارهای مالی ایفا کننده‏ی نقشی مهم در اقتصاد جهانی هستند و به عنوان قلب تپنده‏ی آن شناخته می‏شوند. بازارهای مالی از چند جنبه‏ی تخصیص بهینه منابع، تسهیل جریان سرمایه‏گذاری در صنعت، تعیین ارزش واقعی دارایی، کمک به توسعه اقتصادی و مدیریت ریسک دارای اهمیت حیاتی هستند و به عنوان موتور متحرک اقتصاد عمل می‏کنند. همچنین وجود بازارهای مالی کارآمد نشان دهنده‏ی پویایی و سلامت اقتصاد یک جامعه می‏باشد و تغییرات آن می‏تواند زندگی عده‏ی زیادی از افراد را تحت تاثیر قرار می‏دهد. به همین دلیل پیش‏بینی شاخص‏‏ها به عنوان نشانگر وضعیت بازارهای مالی از اهمیت بالایی برخوردار است و می‏تواند به تصمیم‏گیری آگاهانه، سرمایه‏گذاری صحیح منابع، کاهش ریسک سرمایه‏گذاران و کسب بازدهی بهینه کمک کند. هدف از پیش‌بینی بازارهای مالی، پیش‌بینی قیمت‌ها، بازدهی‌ و روندهای بازار است تا بتوان از این اطلاعات برای تصمیم‌گیری‌های مالی و سرمایه‌گذاری استفاده کرد.

    تاکنون رویکردهای مختلفی مانند رویکردهای آماری و اقتصادی جهت پیش‏بینی بازارهای مالی معرفی و توسعه یافته‏اند که هر کدام دارای نقاط ضعف و قوت خود می‏باشند اما با ظهور الگوریتم‏های یادگیری ماشین و یادگیری عمیق و افزایش قدرت محاسباتی کامپیوتر‏ها و همچنین دسترسی به داده‏های با حجم زیاد، روش‏های پیش‏بینی سری‏های زمانی بازارهای مالی با استفاده از روش‏های جدید مبتنی بر یادگیری ماشین و یادگیری عمیق به دلیل دقت و سرعت بالاتر در توسعه مدل‏های پیش‏بینی مورد توجه جامعه‏ی علمی قرار گرفتند و باعث بهبود دقت پیش‏بینی‏ها شده‏اند.  

    از بین این روش‏ها طی سال‏های اخیر مدل‏های مبتنی بر ترنسفورمرها به دلیل توانایی یادگیری وابستگی‏های بلند مدت و همچنین افزایش قابلیت تفسیرپذیری مدل‏ها با استفاده از مکانیزم توجه، در حوزه‏های مختلف پردازش زبان طبیعی، بینایی ماشین و سری‏های‏زمانی مورد توجه قرار گرفته‏اند.

    در این پژوهش از مدل Temporal Fusion Transformer که یک مدل مبتنی بر ترنسفورمر می‏باشد جهت پیش‏بینی مقدار شاخص‏ S&am   ۵۰۰ و شاخص کل بورس ایران استفاده شده است تا میزان کارایی آن در پیش‏بینی این شاخص‏ها مورد سنجش قرار گیرد. همچنین به جهت بررسی میزان کارایی مدل TFT ، نتایج این مدل با مدل های شناخته شده‏ی LSTM و میانگین متحرک ساده و رگرسیون بردار پشتیبان مقایسه شده است. مدل‎های LSTM و TFT در مقایسه با میانگین متحرک ساده و رگرسیون بردار پشتیبان خطای کمتری داشتند. خطای مدل TFT در پیش‏بینی شاخص کل بورس ایران کمتر از LSTM بود ولی در پیش‏بینی شاخص S&am   ۵۰۰ مدل LSTM خطای کمتری را در دو معیار ارزیابی بدست آورد.


    Abstract

    In the current era, financial markets play a crucial role in the global economy and are recognized as its beating heart. Financial markets are critically important in several aspects, including optimal resource allocation, facilitating investment flows in industries, determining the true value of assets, contributing to economic development, and risk management, acting as the driving engine of the economy. Additionally, the existence of efficient financial markets reflects the dynamism and health of a society's economy, and changes in these markets can significantly impact the lives of many individuals. For this reason, predicting indicators as markers of financial market conditions is of great importance and can aid in informed decision-making, proper resource allocation, risk reduction for investors, and achieving optimal returns. The goal of forecasting financial markets is to predict prices, returns, and market trends so that this information can be used for financial decision-making and investment.

    To date, various approaches, such as statistical and economic methods, have been introduced and developed for forecasting financial markets, each with its own strengths and weaknesses. However, with the emergence of machine learning and deep learning algorithms, increased computational power, and access to large volumes of data, time series forecasting methods for financial markets using new machine learning and deep learning-based approaches have gained attention in the scientific community due to their higher accuracy and speed in developing predictive models, leading to improved forecasting accuracy.

    Among these methods, transformer-based models have gained attention in recent years due to their ability to learn long-term dependencies and enhance model interpretability through attention mechanisms, particularly in fields such as natural language processing, computer vision, and time series analysis.

    In this research, the Temporal Fusion Transformer (TFT) model, a transformer-based model, has been used to forecast the S&am   ۵۰۰ index and the Tehran Stock Exchange's overall index to evaluate its effectiveness in predicting these indices. Additionally, to assess the performance of the TFT model, its results have been compared with well-known models such as LSTM, simple moving average, and support vector regression. The LSTM and TFT models had lower errors compared to the simple moving average and support vector regression. The error of the TFT model in predicting the overall index of the Iranian stock market was lower than that of LSTM, but in predicting the S&am   ۵۰۰ index, the LSTM model achieved lower error in both evaluation metrics.