Time Series Analysis: Classical Methods#

๐Ÿ“ˆ Decomposing Time, Forecasting the Future

A comprehensive tour of classical time series methods applied to benchmark datasets

Project Overview#

Time series data โ€” sequences of observations indexed by time โ€” appear throughout science, economics, and industry. This project provides a rigorous yet accessible walkthrough of the classical toolkit: from the humble exponential smoother through to full ARIMA-family models and a brief introduction to state-space representations. Each method is motivated theoretically, implemented in Python, and applied to canonical benchmark datasets so that behaviour is immediately interpretable.

Datasets used include:

  • Air Passengers (Box & Jenkins, 1976): monthly international airline passenger counts 1949โ€“1960 โ€” the drosophila of time series, exhibiting clear trend, multiplicative seasonality, and increasing variance

  • Monthly Milk Production (Cryer, 1986): monthly pounds of milk per cow 1962โ€“1975 โ€” additive seasonality with linear trend

  • Sunspot Numbers (WDC-SILSO): annual sunspot counts from 1700 โ€” stationary-ish with quasi-periodic ~11-year solar cycle; classic AR/ARMA showcase

  • Mauna Loa COโ‚‚ (Keeling, NOAA): monthly atmospheric COโ‚‚ 1958โ€“present โ€” strong trend plus annual seasonality; good for Fourier decomposition

  • UK Retail Sales (ONS): monthly index values โ€” real-world irregularity, trading-day effects, and the challenges of official statistics

Project Structure#

This analysis is organised into eight interconnected notebooks:

๐Ÿ“ 1. Introduction & Data Loading

Explore โ†’

Loading datasets, visualising raw series, ACF/PACF, classical and STL decomposition

๐Ÿ“‰ 2. Simple Exponential Smoothing

Explore โ†’

Level smoothing, ฮฑ optimisation, ARIMA(0,1,1) equivalence

๐ŸŒก๏ธ 3. Holt-Winters Smoothing

Explore โ†’

Trend and seasonal extensions, ETS framework, AIC model selection

๐Ÿ”Š 4. Fourier Analysis

Explore โ†’

DFT, periodograms, spectral density, Fourier regressors

๐Ÿ” 5. ARMA & ARIMA

Explore โ†’

Stationarity testing, Box-Jenkins methodology, AR/MA identification

โ„๏ธ 6. SARIMA

Explore โ†’

Seasonal differencing, airline model, auto-ARIMA, production seasonal adjustment

๐Ÿ”ฎ 7. State-Space Models

Explore โ†’

Kalman filter, structural time series, Harvey's framework

๐Ÿ† 8. Model Comparison

Explore โ†’

Cross-validation, forecast metrics, Diebold-Mariano test

Key Questions#

  • ๐Ÿ” How does the choice of smoothing parameter ฮฑ affect forecast responsiveness vs stability?

  • ๐Ÿ” What does the autocorrelation structure of a residual series tell us about model adequacy?

  • ๐Ÿ” When does seasonal differencing outperform explicit Fourier seasonality?

  • ๐Ÿ” How do ARIMA and structural state-space models relate mathematically, and do they diverge in practice?

  • ๐Ÿ” Which classical method produces the best out-of-sample forecasts on benchmark data?

Datasets#

Dataset

Frequency

Length

Key Features

Air Passengers

Monthly

144 obs (1949โ€“1960)

Multiplicative trend+season, growing variance

Milk Production

Monthly

168 obs (1962โ€“1975)

Additive trend+season

Sunspots

Annual

300+ obs (1700โ€“present)

Quasi-periodic, near-stationarity

Mauna Loa COโ‚‚

Monthly

700+ obs (1958โ€“present)

Strong nonlinear trend, annual seasonality

UK Retail Sales

Monthly

~300 obs

Real-world noise, calendar effects

Technical Approach#

๐Ÿ“Š Exploratory Decomposition
Classical additive/multiplicative decomposition, STL
๐Ÿ“ Stationarity Testing
ADF, KPSS, variance-ratio tests
๐Ÿ”ง Model Fitting
statsmodels, pmdarima auto-ARIMA
๐Ÿ”Š Spectral Analysis
scipy.signal, manual DFT, Fourier regressors
โœ… Validation
Time-series cross-validation, rolling windows

Expected Outcomes#

โœ… Understood the theoretical basis of each classical method
โœ… Identified which method suits which data generating process
โœ… Produced interpretable, well-diagnosed models
โœ… Benchmarked all methods head-to-head on common datasets