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
AR = AutoRegressive:
The current value depends on past values of the series.
Example: Sales today may depend on sales yesterday.
If p = 1
AR(1) → depends only on previous value
If p = 2
AR(2) → depends on last two observations
Use AR when:
MA = Moving Average
Current value depends on past forecast errors.
It models the noise pattern in data.
MA(1)
Current value depends on:
Errors influence future values for q steps.
Use MA when:
AR Model
Uses past observations
MA Model
Uses past errors
Both capture time dependencies.
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