Arima Notes
Arima Notes
Handout
Stationarity
Properties
γs,t = γs+h,t+h
If they have the same time lag, the covariance should be the same. (i.e.
Cov(y1 , y2 ) = Cov(y2 , y3 ) = Cov(y3 , y4 ). This is pretty useful in
a. Roughly horizontal
ARIMA Models 1
2. Non-stationary time series
a. Has trend or seasonality. They are not stationary since the mean is changing
ACF
Note that for ACF plots, it does not need to be all within the blue lines since we
are not looking at white noise.
Differencing
yt′ = yt − yt−1
💡 Note that we will only have T-1 data since we can’t compute the difference for
the first observation y1′
Purpose: To get the ACF to be well behaved. But note that we don’t need to get it to
white noise (but this will be ideally)
Kwiatkowski-Phillips-Schmidt-Shin (KPSS)
yt = μ + ρt + μt + et
ARIMA Models 2
Idea: We will fit a linear regression line on the data. If the test statistic is large it
means that it is on one side of the line and therefore it could be non stationary.
p-value: If the p-value is significant then we can reject the null hypothesis and
conclude that we need to difference the data
Backshift Notation
Byt = yt−1
The backshift operator Boperates on the yt and it will shift it back in time by 1
(1 − B)d yt
Seasonal Difference:
First seasonal difference is given by
(1 − Bm )yt
Autoregressive Model
💡 Note that cis not the mean of the time series. It is a function of the mean and
the ϕcoefficients. c = μ − ϕ1 μ − ϕ2 μ − ⋯ − ϕp μ
ARIMA Models 3
ϕ1 , ⋯ , ϕp - All constants
ϕp = 0
et - Variance of the et will only change the scale of the series, it doesn’t change the
pattern
Roots determine if it is a casual process or not
Linear Processes
∞
noise et and is given by yt = μ + ∑j=−∞ ψj et−j where
∞
∑j=−∞
∣ψj ∣ < ∞
Autocovariance Function:
Note that this is infinite-MA representation
∞
γ(h) = σ 2
∑ ψj+h ψj
j=−∞
Note that once we have the ϕweights then we can work out γ(h)
Purpose
This gives a way “in” to work out γ(h)for AR(p)processes. Because once we
can determine that it is a linear process, we can use the expression for γ(h)
ARIMA Models 4
Is it possible to have a stationary AR(1) process when ϕ1 > 1
∞
yt = − ∑j=1 ϕ−j et+j
Casual AR Process
An AR Process is casual if it can be expressed by the previous values and not in
terms of future values .
Need to check if the complex roots lie outside the unit square, it is then it is a
casual process
Example
For AR(1),
τ(z) = 1 − ϕ1 z = 0
1
z=
ϕ1
ARIMA Models 5
MA Process
yt = c + ϵt + θ1 ϵt−1 + θ2 ϵt−2 + ⋯ + θq ϵt−q
ϵt - White Noise
yt = ϕ1 yt−1 + ϵt
Invertibility
General conditions for invertibility
💡 Complex roots of 1 + θ1 z
on the complex plane
+ θ2 z 2 + ⋯ + θq z q lie outside the unit circle
Essentially, solve for the roots of the moving average polynomial and check that the
roots are outside the unit circle
ARIMA Models 6
If ∣z∣ > 1then it lies outside the unit circle
Properties
ARIMA
Components
Interpretability: It is rarely interpretable in terms of visible data structures like trend and
seasonality. But it can capture a huge range of time series patterns.
yt = c + ϕ1 yt−1 + ⋯ + ϕp yt−p
+ θ1 et−1 + ⋯ + θq et−q + et
Note that this is when we have not included the I part which represents the
differencing component of it.
yt′ = c + ϕ1 yt−1
′
′
+ ⋯ + ϕp yt−p
+ θ1 et−1 + ⋯ + θp et−p + et
ARIMA Models 7
Writing in a more succinct manner
τ(B)- AR Component
(1 − B)d - Number of Difference
κ(B)- MA Component
c = μ(1 − ϕ1 − ⋯ − ϕp )
Note that if we add terms and reorder it, it does not change the ARIMA order
What we can do is to factorize the yt side and et side to see if there are any terms
that are similar for both the autoregressive operator and moving average operator
We try to get the equation to the base form and that will be the underlying ARIMA
model. We want the Parsimonious Model (model with the least parameters)
Example
Looking at the following equation, we may think that it is a ARIMA(2, 0, 1)
process
(1 − 0.5B)yt = et
We can see that since there is a common term between them, we can cancel it
and this is just an ARIMA(1, 0, 0) model
Note that if we fit the 2 models, they will still produce similar forecasts
ARIMA Models 8
Link between ARIMA and ARMA
If yt follows ARIMA(p, d, q) ⇔(1 − B)d yt follows ARMA(p, q)
Autoregression ARIMA(p, 0, 0)
Note that the p, qpart affects the short term look of the data and the c, daffects how
the long term forecasts look like
=
0 0 Long-term forecasts will go to the mean of the data
=
0 1 Long-term forecasts will follow a straight line
=
0 2 Long-term forecasts will follow a quadratic trend
Cyclic Behaviours
Note that this is something unique to ARIMA models that ETS models can’t do. ETS
models can only handle seasonality and not cyclic patterns
Conditions:
ARIMA Models 9
Notations
p- Refers to the AR part
d- Refers to the degree of differencing involved
q- Refers to the MA part
Determining p, d, q
q- Finding the last significant lag for ACF plot (Note that this is only for pure MA
models)
Code Output
Partial Autocorrelations
Measures the relationship between yt and yt−k , when the effects of other time lags -
1, 2, 3, ⋯ , k − 1are removed
Definition
Given a time series yt , the partial autocorrelation of lag k is denoted, ϕk,k , is the
autocorrelation between yt and yt+k with the linear dependence of yt on yt+1 to
ARIMA Models 10
yt+k−1 removed.
It is the autocorrelation between yt and yt+k that is not accounted for by lags 1
through k − 1inclusive
ϕ1,1 = ρ(zt+1 , zt ),
for k = 1
where z^t+k , z^t are linear combinations of {zt+1 , zt+2 , ⋯ , zt+k−1 }that
Note: For stationary processes, the coefficients in z^t+k and z^t are the same but
reversed
When we are looking at the correlation between yt and yt−1 , it may induce k
Regression on the various lagged values and taking out the coefficient for the k th lag
value since this tells us how much the k th lag explains the current time value
Features:
α1 = ρ1
Forecasting
ARIMA Models 11
^t+h∣t is chosen to be g(y1 , ⋯
The point forecast y , yt )s.t.
E[yt+h ∣y1 , ⋯ , yt ]
Prediction Error
E[yt+h − y^t+h∣t ]2
Example: AR(p)
y^i∣t = yi for i ≤ t
Higher value of d→ More rapidly the prediction intervals increase in size
For d = 0, the long-term forecast standard deviation will go to the standard deviation
of the historical data
SARIMA
ARIMA(p,d,q)(P, D, Q)m
ARIMA Models 12
Model Form
(1 − B12 )- Extra differencing term where we are taking the difference between 12
months apart. Note that this is 12 because this is monthly data
τ(B)- It is a function of 2 polynomials
(1 + ϕ1 B + ⋯ + ϕq Bq )(1 + Φ1 B12 + Φ2 B24 + ⋯ + ΦQ B12Q )
Note that there are 2 components where one is the non seasonal part and the
other is the seasonal part
Note that there are 2 components where one is the non seasonal part and the
other is the seasonal part
Features
If it is a pure seasonal model, we can fall back on the same guidelines for
identifying ARIMA model. But note that the spikes will be at the seasonal periods
Example 1
SARIMA(0, 0, 0)(1, 0, 1)12
yt = Φyt−12 + et + Θet−12
yt − Φyt−12 = et + Θet−12
τ(B)yt = κ(B)et
ARIMA Models 13
Note that since we do note have any components that are non multiples of 12 (there
are no non seasonal components)
Example 2
SARIMA(0, 1, 1)(0, 1, 1)12
ETS vs ARIMA
ETS(A,N,N) ARIMA(0,1,1) θ1 = α − 1
ETS(A,A,N) ARIMA(0,2,2) θ 1 = α + β − 2 θ 2 = 1 − α
ETS(A, Ad , N)
ARIMA(1,1,2) ϕ1 = ϕθ1 = α + ϕβ − 1 − ϕθ2 = (1 − α)ϕ
ARIMA Models 14
ETS Model ARIMA Model Parameters
ARIMA(0,1,m+1)
ETS(A,A,A)
(0, 1, 0)m
ARIMA(1,0,m+1)
ETS(A,Ad ,A)
(0, 1, 0)m
Note that once there are multiplicative terms, there will not be any equivalent ARIMA
model (i.e. Non-linear exponential smoothing models do not have equivalent ARIMA
counterparts)
Note that since ETS and ARIMA are 2 different class of models, we can only compare
their forecast accuracy. We cannot compare their AIC since they have different
number of parameters and will not give a good enough estimate.
ETS Models
Flexible model since it allows for trend etc to change over time
All non-stationary.
Models with seasonality or non-damped trend (or both) have two unit roots; all
other models have one unit root
ARIMA Models
yt = lt−1 + et
lt = lt−1 + αet
Conversion
ARIMA Models 15
lt − lt−1 = αet
From (∗)
= αet−1 + et − et−1
(1 − B)yt = et + (α − 1)et−1
Invertibility Condition
∣α − 1∣ < 1
⇔0<α<2
yt = ℓt−1 + bt−1 + et
⋯ (∗)
ARIMA Models 16