5. SARIMA — Handling Seasonality
🪄 Step 1: Intuition & Motivation
Core Idea: Life — and data — often moves in cycles. Ice cream sales spike every summer. Electricity demand peaks each evening. Website traffic rises every Monday and dips on weekends.
These repeating patterns are called seasonality.
The ARIMA model can handle trends and noise, but it doesn’t “know” that June always comes after May. That’s where SARIMA (Seasonal ARIMA) steps in — it adds seasonal memory, letting the model capture patterns that repeat every fixed interval.
Simple Analogy: Think of ARIMA as a regular calendar — it tracks daily events. SARIMA is like a festival calendar — it remembers that Diwali, Christmas, or New Year happens every year around the same time and adjusts expectations accordingly.
🌱 Step 2: Core Concept
Let’s explore how SARIMA adds the seasonal rhythm to ARIMA’s structure.
What’s Happening Under the Hood?
SARIMA extends ARIMA by including seasonal AR, seasonal differencing, and seasonal MA components.
The model is written as: SARIMA(p, d, q)(P, D, Q, s)
- (p, d, q): Non-seasonal ARIMA components
- (P, D, Q): Seasonal ARIMA components
- s: The season length (e.g., 12 for monthly data with yearly seasonality)
So SARIMA models both:
- Short-term relationships (using ARIMA)
- Seasonal cycles (using seasonal AR/MA terms spaced by
s)
For instance, SARIMA(1,1,1)(1,1,1,12) means:
- Non-seasonal AR(1), differencing(1), MA(1)
- Seasonal AR(1), differencing(1), MA(1)
- Season repeats every 12 periods (months).
Why It Works This Way
Seasonal patterns create autocorrelation spikes at regular intervals. For example, sales today may correlate not just with yesterday but also with last month’s same day.
SARIMA uses seasonal lags (multiples of s) to model those repeating dependencies.
By adding these seasonal terms, SARIMA essentially says:
“Let’s not only look at what happened recently — let’s also remember what happened this same time last cycle.”
This dual view (short-term + seasonal memory) gives SARIMA its power to forecast cyclical behavior accurately.
How It Fits in ML Thinking
In ML terms, think of SARIMA as adding seasonal features automatically. Instead of manually encoding “month”, “day”, or “week”, SARIMA builds internal regressors that model repeating periodicity.
It’s like giving the model a built-in “calendar sense.”
📐 Step 3: Mathematical Foundation
Let’s peek into the math behind the melody of seasonality.
SARIMA Model Equation
The general SARIMA equation is:
$$ \Phi_P(B^s)\phi_p(B)(1 - B)^d(1 - B^s)^D X_t = \Theta_Q(B^s)\theta_q(B)\epsilon_t $$where:
- $B$ = backshift operator ($B X_t = X_{t-1}$)
- $s$ = number of periods in a season
- $\Phi_P(B^s)$ = seasonal AR part
- $\Theta_Q(B^s)$ = seasonal MA part
- $(1 - B^s)^D$ = seasonal differencing
Each seasonal component works like its non-seasonal twin but jumps in steps of s lags instead of 1.
Identifying Seasonality
To detect seasonality:
- Plot the series — look for visual cycles (e.g., spikes every 12 months).
- Decompose the series — separate trend, seasonality, and residuals.
- Check ACF — if you see strong spikes at lags = s, 2s, 3s… you have seasonality.
Example:
- For monthly data → spikes at lags 12, 24, 36 = yearly pattern.
- For weekly sales → spikes at 7, 14, 21 = weekly repetition.
🧠 Step 4: Assumptions or Key Ideas
- Data exhibits repeating patterns at regular intervals.
- Seasonality length
sis known or can be estimated. - The seasonal structure is additive or multiplicative (amplitude may stay or grow).
- Stationarity is achieved through seasonal differencing $(1 - B^s)^D$.
⚖️ Step 5: Strengths, Limitations & Trade-offs
✅ Strengths
- Handles both short-term and seasonal dependencies elegantly.
- Provides interpretable seasonal and non-seasonal terms.
- Extensible — can handle exogenous variables via SARIMAX.
⚠️ Limitations
- Parameter tuning becomes complex (seven parameters: p, d, q, P, D, Q, s).
- Computationally heavier than ARIMA.
- Assumes fixed periodicity — struggles with irregular seasonality.
🚧 Step 6: Common Misunderstandings
🚨 Common Misunderstandings (Click to Expand)
- “SARIMA automatically detects seasonality.” ❌ You must specify
s. - “ARIMA can handle seasonality if differenced enough.” ❌ It can mimic but not truly capture periodic cycles.
- “Adding seasonal terms always improves accuracy.” ❌ Not if the series isn’t seasonal — it can overfit noise.
🧩 Step 7: Mini Summary
🧠 What You Learned: SARIMA extends ARIMA to capture seasonal patterns — modeling both short-term dependencies and long-term cycles.
⚙️ How It Works: It introduces seasonal AR, differencing, and MA components with lag spacing
s, guided by ACF spikes and decomposition.
🎯 Why It Matters: Seasonality is one of the most defining features in real-world data — ignoring it leads to biased forecasts. SARIMA makes models “calendar-aware.”