Time-Series Forecasting: ARIMA, SARIMA & Prophet

Unlike standard cross-sectional machine learning datasets where samples are assumed to be independent and identically distributed (i.i.d.), Time-Series Data consists of observations ordered chronologically across time intervals. Applications include financial stock forecasting, electricity grid load estimation, e-commerce server capacity planning, and supply chain inventory forecasting.

1. Time-Series Decomposition: The 3 Core Components

A time-series Y_t can be mathematically decomposed into three distinct components:

Additive: Y_t = Trend_t + Seasonality_t + Residual_t

Multiplicative: Y_t = Trend_t · Seasonality_t · Residual_t

  • Trend (T): The long-term general upward or downward movement of the series over years.
  • Seasonality (S): Predictable, fixed-frequency repeating cyclical patterns (e.g., retail spikes every Christmas, ice cream spikes every summer).
  • Residual / Noise (R): The remaining irregular, stochastic random fluctuations.

2. Stationarity & The Augmented Dickey-Fuller (ADF) Test

Classical forecasting models like ARIMA strictly require the time-series to be Stationary: its mean, variance, and autocorrelation structure must remain constant over time. If a series has a strong upward trend, it is non-stationary.

We test for stationarity using the Augmented Dickey-Fuller (ADF) Test:

  • Null Hypothesis (H₀): The series possesses a unit root (it is non-stationary).
  • p-value < 0.05: Reject the null hypothesis! The series is stationary and ready for ARIMA modeling.
  • If non-stationary, apply Differencing: Δy_t = y_t - y_{t-1} to remove trends.

3. The ARIMA(p, d, q) Architecture

ARIMA (AutoRegressive Integrated Moving Average) combines three parameters:

  • p (AutoRegressive - AR): Number of past lag observations included: y_t = c + ϕ₁ y_{t-1} + ... + ϕ_p y_{t-p}. Determined via Partial Autocorrelation (PACF) plots.
  • d (Integrated - I): The number of times the series is differenced to achieve stationarity.
  • q (Moving Average - MA): Number of lagged forecast residual errors included: y_t = μ + θ₁ ε_{t-1} + ... + θ_q ε_{t-q}. Determined via Autocorrelation (ACF) plots.

4. Modern Industrial Forecasting: Meta Prophet

Developed by Meta (Facebook), Prophet is an additive decomposable model that handles non-linear trends, multiple holiday effects, weekend vs weekday seasonalities, and missing dates without requiring strict differencing.

Frequently Asked Questions (FAQ) - Student & Interview Review

Q1. What is SARIMA?

SARIMA (Seasonal ARIMA) extends ARIMA with four additional seasonal terms: (P, D, Q)m, where m is the seasonal period length (e.g., m=12 for monthly data with annual seasonality).

Q2. Why can't you use standard K-Fold cross validation on time-series?

Standard K-Fold randomly shuffles data, training on future observations to predict past events, causing massive look-ahead data leakage. Use expanding walk-forward windows (TimeSeriesSplit).

Q3. When should deep learning (LSTMs or Temporal Fusion Transformers) be used instead of ARIMA?

Use ARIMA for single, clean univariate series with strong stationarity. Use deep learning when forecasting across thousands of interrelated cross-series with external covariates (e.g. store pricing, promotions, weather).

Explore Related Machine Learning Tutorials & Next Steps

Broaden your foundational and advanced Machine Learning knowledge across our curriculum:

LSTMs for Time-Series

Compare statistical ARIMA models with deep sequence architectures.

Trend Fitting with Linear Regression

Decompose linear trends and seasonal dummy indicators.

Time-Series Forecast APIs

Serve rolling predictions and confidence intervals via FastAPI.

BCA Viva: Stationarity & Differencing

Augmented Dickey-Fuller (ADF) test and autocorrelation (ACF/PACF).

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Reddit

You may also like this!