Weather Forecasting using ARIMA & SARIMA Model

SARIMAX of Seasonal Data

Learning Outcome

5

Use external variables in forecasting

4

Implement SARIMAX in Python

3

Interpret SARIMAX parameters

2

Identify seasonality in time series data

1

Understand SARIMAX model concept

You already know:

Activation Functions

Loss Functions

Optimization Techniques

Now, we move into Time Series Forecasting

An airline company wants to predict next year's passenger demand.

But the data shows:

  • Peaks every holiday season
  • Drops during off-season
  • Marketing campaigns also affect sales

Question:

Which model can capture trend + seasonality + external factors?

ARIMA works well for:

  • Capturing trend
  • Handling random noise

So ARIMA alone is not sufficient for this problem

So you need a model that handles ALL THREE together

But struggles with:

  • It cannot handle seasonality properly
  • It cannot include external factors (like marketing)

Meet SARIMAX

S - Seasonal

AR - AutoRegressive

I - Integrated

MA - Moving Average

X - eXogenous

SARIMAX =

It extends the standard ARIMA model by adding two critical capabilities:

1. Seasonality - Captures repeating cycles (e.g., yearly sales spikes).

2. External Variables - Incorporates outside data (e.g., marketing spend, holidays).

What Problems Does SARIMAX Solves

Trend

Seasonality

External variables

Missing values

 

Shows long-term movement in data (increasing, decreasing, or stable over time).

Repeating short-term patterns in data (weekly, quarterly, yearly).

Incorporates variables outside the main time series that influence the target.

Random variation left after removing the main pattern.

SARIMAX Model Format

SARIMAX(p, d, q)(P, D, Q, s)

Two components:

Non-seasonal parameters

Seasonal parameters

(p, d, q)

(P, D, Q, s)

Captures trend and noise patterns in the time series data 

Models repeating cycles and periodic patterns in the data 

Core ARIMA Parameters

AutoRegression

Uses past values to predict current value

Removes trend by subtracting previous value

Uses past forecast errors in model

Differencing

Moving Average

Seasonal Components

AutoRegressive component for seasonal patterns

Remove seasonality by subtracting previous season

Moving Average component for seasonal patterns

Number of Periods per Season

Seasonal cycle length

Seasonal MA

Seasonal differencing

Seasonal AR

Example:

s = 12

for monthly yearly seasonality

External Factors in Forecasting

Sometimes external factors significantly affect your time series data.

SARIMAX allows adding exogenous variables

Use SARIMAX When

How to Detect Seasonality

Visual methods:

  • Line plot
  • Seasonal decomposition

Statistical methods:

  • ACF(Autocorrelation)
  • PACF(Partial Autocorrelation)

Breaking Down Time Series

Seasonal Decomposition Separated data into distinct components to understand underlying patterns

SARIMAX in Python

Forecast Output

Model predicts future values based on patterns

Historical data

Seasonal pattern

Learns from past values and trends

Applies repeating cycles to the forecast

Evaluating the Model

Key metrics to assess performance

Summary

5

Widely used for business and demand forecasting

4

Seasonality detected using plots and ACF/PACF

3

Model defined as (p,d,q)(P,D,Q,s)

2

Captures trend, seasonality, and external factors

1

SARIMAX extends ARIMA to handle seasonal data

Quiz

Which parameter represents the seasonal cycle length in SARIMAX?

A. p

B. q

C. s

D. d

Quiz-Answer

Which parameter represents the seasonal cycle length in SARIMAX?

A. p

B. q

C. s

D. d

SariMax of Seasonal Data

By Content ITV

SariMax of Seasonal Data

  • 55