Overview

A statistical forecasting pipeline that predicts TSX stock prices using Seasonal-Trend decomposition (STL) followed by ARIMA modeling. The system trains on 11 years of monthly data (2005–2015) and forecasts 9 months ahead with 95% confidence intervals.

Methodology

1. STL Decomposition — Separates the raw price series into trend, seasonal, and remainder components using Loess smoothing.

2. Stationarity Validation — Box plots of the remainder by month confirm the stationary property required for ARIMA modeling.

3. ARIMA Fitting — Exhaustive search via auto.arima() selects ARIMA(5,0,0) as the optimal model on the remainder component.

4. Model Diagnostics — Box-Ljung test on residuals validates that the model captures the autocorrelation structure.

5. Forecasting — 9-month ahead predictions with 95% confidence intervals, overlaid against actual values with publication-quality ggplot2 visualizations.

Tech Stack

View on GitHub