Weather Forecasting using ARIMA & SARIMA Model

 Introduction to AR and MA model

Learning Outcome

5

Know when to apply AR vs MA

4

Use ACF & PACF to identify models

3

 Interpret AR(p) and MA(q) notation

2

Understand Moving Average (MA) models

1

Understand AutoRegressive (AR) models

Recall

Before learning AR & MA, recall previous topics:

What is Time Series Data

Concept of lag (past values)

What is correlation in time

Basic forecasting idea

Hook Story

Imagine predicting tomorrow's electricity demand.

Demand depends on:

• Yesterday’s demand
• Last week’s trend
• Unexpected fluctuations

How do we model past influence mathematically?

AR and MA models solve this.

Transition from Analogy

Time series values are dependent

Time series values are dependent

Current value may depend on:

Past observations

Past errors

These relationships are modeled using:

AR Models

 MA Models

What is an AR Model?

AR = AutoRegressive:

The current value depends on past values of the series.

Example: Sales today may depend on sales yesterday.

AR Model Equation

AR(p) Model Intuition

If p = 1

AR(1) → depends only on previous value

If p = 2

AR(2) → depends on last two observations

When to Use AR Model

Use AR when:

  • Past values influence future values
  • PACF shows sharp cutoff
  • ACF decays gradually

What is an MA Model?

MA = Moving Average

Current value depends on past forecast errors.
 

It models the noise pattern in data.

MA Model Equation

MA(q) Model Intuition

MA(1)

Current value depends on:

  • current error
  • previous error

Errors influence future values for q steps.

When to Use MA Model

Use MA when:

  • Random shocks influence data
  • ACF shows sharp cutoff
  • PACF decays gradually

 

AR vs MA (Concept)

AR Model
Uses past observations

MA Model
Uses past errors

Both capture time dependencies.

AR & MA in Python

Using statsmodels

Example:
1.AR Model
from statsmodels.tsa.ar_model import AutoReg
2.MA Model
from statsmodels.tsa.arima.model import ARIMA

 

Summary

5

ACF & PACF help identify correct model

4

MA(q) indicates number of past errors used

3

AR(p) indicates number of past values used

2

 MA models use past forecast errors

1

AR models use past observations

Quiz

Which indicator helps identify the order of an AR model?

A. ACF cut-off

B. PACF cut-off

C. Trend line

D. Moving average

Quiz

Which indicator helps identify the order of an AR model?

A. ACF cut-off

B. PACF cut-off

C. Trend line

D. Moving average