نوع مقاله : مقاله علمی پژوهشی
عنوان مقاله English
نویسندگان English
Objective
Predicting stock prices remains a significant challenge in the field of finance due to the complex and dynamic factors that influence market behavior, including economic conditions, financial news, and market fluctuations. Consequently, the development of accurate and robust prediction models has become increasingly important for supporting investment decisions and risk management. In this study, deep learning techniques are employed to develop a model for stock price prediction.
Methods
In this research, which is pragmatically oriented in terms of research objectives and quantitative in terms of data type, the focus is on learning models. The data used covers 21 years from 2001 to 2022. Initial data preprocessing was carried out using Excel software. Subsequently, for data preprocessing, the Anaconda distribution and Jupyter Notebook interpreter were employed. Pandas, NumPy, and scikit-learn libraries were used for data analysis and preprocessing, and the matplotlib library was utilized for data visualization. For price prediction, the Keras and TensorFlow libraries were employed. This study employed two approaches for stock price prediction: single models and a hybrid model. The single-model approach utilized either a Convolutional Neural Network (CNN) or a Long Short-Term Memory (LSTM) network, with each model comprising three layers. The hybrid model consisted of four layers, combining a CNN for feature extraction with an LSTM for sequential prediction, thereby leveraging the strengths of both architectures to improve prediction performance. The research process involves importing data, scaling the data, dividing it into training and testing sets (80% for training and the rest for testing), and transforming the data from time series to supervised learning. Finally, the data are fed into the models. Three evaluation metrics, R-Square, MAE, and RMSE, are used to assess the models.
Results
The results obtained from the evaluation criteria indicate that the hybrid model and the convolutional neural network (CNN) model yield acceptable results, while the outcomes from the short-term memory neural network model are less desirable. These findings underscore the importance of not only selecting the correct independent variables and defining and configuring the model correctly, which are essential prerequisites for deep learning models, but also highlight the significant impact of feature extraction on model prediction. The results demonstrate that the CNN model outperforms the short-term memory neural network model, while recurrent models such as the short-term memory neural network have often shown favorable outcomes in predicting time series. Ultimately, the results suggest that combining these two models leads to better performance compared to each individual model.
Conclusion
The presence of factors such as the range of fluctuations in model accuracy has a significant impact and increases the uncertainty of the model. However, in this research, which exclusively utilizes technical variables, the results indicate that, to achieve desirable outcomes, the choice of neural network architecture is crucial. Additionally, the number of layers in each model also proves to be influential in the results, as models that are overly simplistic or excessively complex can lead to issues such as underfitting or overfitting. Furthermore, the selection of features (independent variables) will also have a considerable impact on the results.
کلیدواژهها English