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

نوع مقاله : علمی - پژوهشی

نویسندگان

1 دانشکده مدیریت و حسابداری، دانشگاه علامه طباطبایی، تهران، ایران

2 گروه مالی و بانکداری، دانشگاه علامه طباطبایی، تهران، ایران

3 دانشیار گروه مالی و بانکداری، دانشگاه علامه طباطبایی، تهران، ایران

4 استادیار گروه مالی و بانکداری، دانشگاه علامه طباطبایی، تهران، ایران.

چکیده

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

روش: با توجه به اینکه در این مدل‌ها انتخاب ویژگی‌های ورودی از اهمیت بسیار زیادی در شکل‌دهی خروجی مدل برخوردار است، در این پژوهش با روشی نظام‌مند، از طریق مرور سیستماتیک ویژگی‌های به کارگرفته شده در پژوهش‌های مرتبط در پنج سال اخیر استخراج شده و نهایتاً 34 ویژگی که داده‌های آنها به شکل روزانه موجود می‌باشند به عنوان ورودی مدل انتخاب شده‌اند. در گام بعد، از مدل تقویت گرادیان طبیعی برای پیش‌بینی داده‌های شاخص کل بورس اوراق بهادار تهران از ابتدای سال 1389 تا سال 1403 استفاده شده است. عملکرد این مدل با استفاده از معیارهای RMSE، MAE و MAPE سنجیده شده و با جدیدترین روش‌های یادگیری ماشین برای پیش‌بینی سری‌های زمانی مقایسه شده است. در ادامه از مقادیر SHAP برای تفسیر نتایج مدل تقویت گرادیان طبیعی استفاده شده است و سهم هر یک از ویژگی‌ها در تخمین خروجی مدل ارزیابی شده است. مقادیر SHAP ابزاری قدرتمند برای سنجش اثرگذاری هر یک از ویژگی‌های ورودی بر تخمین خروجی فراهم می‌آورد که اطلاعات ارزشمندی را در اختیار کاربران مدل‌های یادگیری ماشین قرار می‌دهد.

یافته‌ها: مقایسه مقادیر خطای مدل ارائه شده با سایر مدل‌های یادگیری ماشین، نشان از عملکرد بهتر این مدل در پیش‌بینی دارد. این مدل، برخلاف سایر مدل‌های یادگیری ماشین که یک پیش‌بینی به عنوان بهترین حدس را به عنوان خروجی ارائه می‌دهند، یک توزیع احتمال که بر اساس پارامترهای آن قابل توصیف است ارائه می‌دهد. شکل توزیع پارامتریک در نظر گرفته شده در این پژوهش تابع توزیع نرمال است که با پارامترهای میانگین و انحراف معیار قابل توصیف می‌باشد. در واقع مقدار پیش‌بینی شده، همان میانگین توزیع تخمین زده شده می‌باشد. برای پیش‌بینی شاخص بورس اوراق بهادار تهران، اثرگذارترین ویژگی‌ها قیمت پایانی، اندیکاتور EMA و اندیکاتور SMA هستند. تفسیر پارامتر انحراف معیار پیش‌بینی انجام شده، نشان می‌دهد که بیشترین اثرگذاری در این پارامتر را اندیکاتور ATR، قیمت پایانی و TEMA دارند که هر چقدر مقدار نسبی این متغیرها بیشتر باشد، انحراف معیار توزیع تخمینی بیشتر بوده و بنابراین پیش‌بینی انجام شده قابلیت اتکای کمتری خواهد داشت.

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

کلیدواژه‌ها


عنوان مقاله [English]

Prediction of Tehran Stock Exchange Total Index Using Natural Gradient Boosting and SHAP Values

نویسندگان [English]

  • Madjid Ghods 1
  • Meysam Amiry 2
  • Moslem Peymani Forooshani 3
  • Mohammadali Dehghan Dehnavi 4
1 Department of Finance and Banking, University of Allameh Tabataba’i ,Tehran, Iran
2 Department of Finance and Banking, University of Allameh Tabataba’i ,Tehran, Iran
3 Department of Finance and Banking, University of Allameh Tabataba’i ,Tehran, Iran
4 Department of Finance and Banking, University of Allameh Tabataba’i ,Tehran, Iran
چکیده [English]

Purpose: The stock market represents one of the most pivotal components of developing economies. Consequently, extensive research employing both technical and fundamental analyses has sought to predict financial time series in order to assist investors with their trading decisions. In this regard, machine learning models have emerged as effective tools for addressing a variety of challenges. Nevertheless, despite the notable performance of machine learning models in this area, two significant criticisms persist. The first concerns the lack of interpretability of the results; in such models, the process by which inputs are transformed into outputs, as well as the contribution of each input to the model’s output, is not clearly defined. The second issue pertains to the reliability of the predictions generated by these models, as this reliability cannot be directly inferred from the model itself. Accordingly, this study utilizes the latest methods developed in the field of machine learning to address these two issues.



Methods: Considering that the selection of input features plays a crucial role in shaping the output of these models, this study employs a systematic approach to extract features used in related research over the past five years through a systematic review using the Scopus scientific database. Ultimately, 34 features with daily available data were selected as inputs for the model. In the next step, the Natural Gradient Boosting model was utilized to predict the data of the Tehran Stock Exchange Total Index from March 2010 to January 2025. The performance of this model was evaluated using the RMSE, MAE, and MAPE metrics and compared with the latest machine learning methods for time series prediction. Subsequently, SHAP values were employed to interpret the results of the Natural Gradient Boosting model. This approach allowed for the assessment of the contribution of each feature to the estimation of the model’s output. SHAP values provide a powerful tool for evaluating the impact of each input feature on the output estimation, offering valuable insights to users of machine learning models.



Findings: A comparison of the error values of the proposed model with those of other machine learning models indicates superior predictive performance for the proposed approach. Unlike conventional machine learning models, which provide a single prediction as the best estimate, the proposed model outputs a probability distribution that can be described by its parameters. In this study, the assumed parametric form of the distribution is the normal distribution, which is characterized by its mean and standard deviation. In fact, the predicted value corresponds to the mean of the estimated distribution. For forecasting the Tehran Stock Exchange index, the most influential features are the closing price, the EMA indicator, and the SMA indicator. Interpretation of the predicted standard deviation parameter reveals that the ATR indicator, closing price, and TEMA indicator have the greatest impact on this parameter. As the relative values of these variables increase, the standard deviation of the estimated distribution also increases, indicating that the corresponding prediction is less reliable.



Conclusion: The findings of this study demonstrate that the Natural Gradient Boosting model can serve as an effective tool for predicting the Tehran Stock Exchange Total Index. The interpretation of results using SHAP values enables the identification of the most important input features and the manner in which the output is formed from these features, thereby aiding in model optimization. This approach not only enhances prediction accuracy but also assists market participants and policymakers in making more informed decisions regarding risk management and resource allocation. Ultimately, comparisons with other models indicate that this method can be employed as a practical and reliable solution for financial market analysis.

کلیدواژه‌ها [English]

  • Stock Price Prediction
  • Natural Gradient Boosting
  • SHAP Values
  • Tehran Stock Exchange