Abstract
This study examines the predictive performance of Long Short-Term Memory (LSTM) neural networks in forecasting stock prices, focusing on Apple Inc. (2010–2025) and comparing results with traditional models. The novelty lies in (1) dynamic training optimization using EarlyStopping and ReduceLROnPlateau, (2) a fully documented LSTM workflow with UML modeling for reproducibility, and (3), a 60-day forward iterative simulation. To assess generalizability, the same model was applied to Microsoft (MSFT) via transfer learning, confirming robust cross-asset performance.
Sensitivity analyses and stress tests during events such as COVID-19, highlight both the strengths and limitations. Using SHAP (SHapley Additive exPlanations), the study enhances interpretability by identifying key historical patterns that influence forecasts.
Results show high predictive accuracy (RMSE = 3.17, MAE = 2.61, R2 = 0.9537, MAPE = 3.03%, SMAPE = 3.10%) and superior performance to ARIMA and SVR. Financial indicators, including hit ratio and Sharpe ratio above unity, confirm strong directional and risk-adjusted outcomes. The study underscores the growing relevance of AI-based forecasting compared with traditional econometric models (e.g., ARIMA, GARCH) in volatile markets and recommends incorporating sentiment or macroeconomic variables to enhance robustness. All code and workflows are publicly available on GitHub: https://github.com/najlae195/LSTM-Model.git.
