LSTM-Based Time Series Prediction Model: A Case Study with YFinance Stock Data - Yu Yimiao (ITM Web of Conferences)
The goal of this study is to anticipate the time series of stock data that YFinance provides using a Long Short-Term Memory (LSTM) model, with a particular emphasis on the closing prices and daily returns of Apple Inc. (AAPL). The historical closing price data from January 1, 2010, to September 20, 2021, was used as the training set, while the data from September 21, 2021, to August 22, 2024, was employed as the validation set to test the model’s predictive capability. The experimental results demonstrate that the LSTM architecture performs excellently in handling data with long-term dependencies and trends, attaining a root mean square error (RMSE) of 5.2129 and a coefficient of determination (R2) of 0.94, thus accurately forecasting the stock price movements of Apple Inc. However, the model exhibits poor performance in predicting high-frequency fluctuations, with an R2 of only -0.1, indicating a weak ability to capture high-frequency volatility.