Predictive Modeling of Stock Prices Using Machine Learning: A Comparative Analysis of LSTM, GRU, CNN, and RNN Models
摘要
In this research, we harness the capabilities of machine learning algorithms to forecast the stock values of the top five enterprises within the Standard & Poor's 500 index, spanning five years. We employ a suite of predictive models, including Long Short-Term Memory (LSTM), Gated Recurrent Units (GRU), Convolutional Neural Networks (CNN), and Recurrent Neural Networks (RNN), drawing upon historical stock data for this purpose. To augment the precision of our predictions, the analysis incorporates the Volatility Index (VIX) of the United States stock market. The efficacy of these models is evaluated through a series of metrics, namely the Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and the coefficient of determination (R2). The findings reveal that the LSTM and GRU models exhibit superior performance (R2 from 0,98 to 0,99) in predicting stock prices over their CNN and RNN (R2 from 0,97 to 0,99) counterparts, underscoring their potential utility in financial forecasting endeavors.