Forecasting Apple Inc. (AAPL) closing stock prices using ARIMA, SARIMA, and LSTM models.
This project compares traditional statistical forecasting with deep learning to understand how each performs on real-world financial time series data.
Stock forecasting is a key challenge in financial data science.
Here, historical AAPL data (2018–2025) is used to predict future closing prices.
The notebook walks through:
- Building ARIMA/SARIMA models for trend-based forecasting
- Training an LSTM network for sequence learning
- Comparing performance and forecast accuracy
AAPL_Stock_Price_Forecasting/
│
├── Data/
│ └── AAPL_historical.csv
│
├── Notebooks/
│ └── stock_forecasting_pipeline.ipynb
│
└── README.md
-
Data Preparation
- Pulled daily AAPL data using
yfinance - Cleaned missing values and ensured business-day frequency
- Pulled daily AAPL data using
-
ARIMA & SARIMA
- Performed grid search for optimal
(p, d, q)parameters - Selected ARIMA(2, 2, 3) (lowest AIC = 6165.47)
- Tested SARIMA for yearly seasonality — smoother but similar accuracy
- Performed grid search for optimal
-
LSTM
- Scaled data with
MinMaxScaler - Used 60-day lookback windows
- Built a multi-layer LSTM model with dropout and early stopping
- Produced sharper, short-term accurate forecasts
- Scaled data with
-
Evaluation
Model MAE RMSE Observation ARIMA(2, 2, 3) 14.6883 17.9199 Stable but lags during sharp changes LSTM 6.2073 7.7119 Tracks volatility and adapts faster
- LSTM outperformed ARIMA/SARIMA with ~2.5× lower RMSE.
- ARIMA/SARIMA captured long-term trends but missed short-term swings.
- Both flatten when forecasting beyond 6 months — highlighting uncertainty.
- A Hybrid ARIMA–LSTM could combine interpretability and adaptability.
Pandas • NumPy • Statsmodels • TensorFlow/Keras • Scikit-learn • Matplotlib
- Implement a Hybrid ARIMA–LSTM model
- Add market indicators like trading volume or sentiment
- Explore Transformer-based time series architectures
- Build a Streamlit dashboard for visualization
Laith Waqas Mohammed
Data Science Student | Financial Forecasting Enthusiast
Dublin, Ireland
LinkedIn