Professional Documents
Culture Documents
Unit 14
Unit 14
Taylor R. Brown
Fall 2020
1 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
2 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Last Unit
3 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
This Unit
4 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Motivation
5 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
3 Worked Example
6 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
xt = µt + yt
7 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
∇xt = β1 + ∇yt
∇d xt = d!βd + ∇d yt .
8 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
A process is ARIMA(p, d, q) if
∇d xt = (1 − B)d xt
9 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
where α = µ(1 − φ1 − · · · − φp ).
10 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
11 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
12 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Define
zt = ∇yt = yt − yt−1
So,
13 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
3 Worked Example
14 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
ARIMA Models
15 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
16 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
17 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
We typically look at
• the time series plot,
• the ACF,
• and the PACF
of the data. This step guides us to our choice for the elements of
the ARIMA model, p, d, q.
18 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
19 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
20 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
21 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
22 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
23 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Model Estimation
After exploratory data analysis, you should have an idea (or ideas)
about the values of p, d, q. We use computer software (e.g. R) to
estimate the parameters. Maximum likelihood estimation is usually
used.
24 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
estimated coefficient
t= .
s.e. of coefficient
If |t| > t1−α/2,df , the estimated coefficient is significantly different
from 0 at 0.05 significance level.
25 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Model Diagnostics
26 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
27 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
28 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
29 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Under the null hypothesis that the model fits the data adequately,
Q ∼ χ2H−p−q as n → ∞. A large Q-statistic leads to the rejection
of the null hypothesis, i.e. model is not an adequate fit for the
data.
30 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
31 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Model Selection
Sometimes you may have more than one set of values for p, d, q
from exploratory data analysis. To be thorough, you may want to
investigate the model estimation and diagnostics for more than one
model. If model diagnostics suggest more than one model works,
here are some issues to keep in mind when comparing models:
• Simpler model.
• Standard errors of forecasts.
• AIC, AICc, BIC etc.
32 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
Model Selection
33 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
3 Worked Example
34 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
35 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
1.0
8000
0.8
0.6
6000
ACF
gnp
0.4
4000
0.2
0.0
2000
Time Lag
36 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
1.0
0.04
0.03
0.8
0.02
0.6
0.01
d.log.gnp
ACF
0.4
0.00
0.2
−0.02 −0.01
0.0
−0.2
Time Lag
37 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
5 10 15 20
LAG
0.0 0.1 0.2 0.3 0.4
PACF
−0.2
5 10 15 20
LAG
38 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
39 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
40 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
−3 −2 −1 0 1 2 3 4
0.4
●
●
●
●
Sample Quantiles
●
●
●●●●●
●
●●
0.2
●●
●
●●
●●
●
●●
●●
●
●
●●
●
●●
●
●●
●
ACF
●
●●
●
●●
●
●
●
●●
●
●
●●
●
●
●●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●
●●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
0.0
●
●●
●
●
●●
●
●
●●
●
●
●●
●
●
●●
●
●●
●
●
●●
●
●●
●
●●
●●
●●
●●●
●
●●●
● ●●●●
−0.2
● ●
5 10 15 20 −3 −2 −1 0 1 2 3
LAG Theoretical Quantiles
p values for Ljung−Box statistic
0.0 0.2 0.4 0.6 0.8 1.0
p value
● ●
● ● ●
● ● ● ● ●
● ● ● ● ●
● ●
● ●
5 10 15 20
LAG (H)
41 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
−3 −2 −1 0 1 2 3 4
●
0.4
●
●●
Sample Quantiles
●
●●●●●
●
●●●
●
●
0.2
●●
●●
●●
●
●
●●
●●
●
●
●
●
●●
●
●●
●
●●
●
●
●●
●
●
●●
●
●
ACF
●
●
●
●●
●
●●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●
●
●
●●
●
●
●
●●
●
●
●
●●●
●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●●
●
●
●●
●
●
●
0.0
●
●●
●
●●
●
●
●●
●●
●
●●
●●
●
●●
●●
●
●
●●
●●
●
●●
●
●
●
●●
● ●●●●
−0.2
●
●
5 10 15 20 −3 −2 −1 0 1 2 3
LAG Theoretical Quantiles
p values for Ljung−Box statistic
0.0 0.2 0.4 0.6 0.8 1.0
p value
●
●
●
● ●
● ●
● ● ●
● ●
● ●
● ●
●
●
5 10 15 20
LAG (H)
42 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
AR(1) model.
$AIC
[1] -6.44694
$AICc
[1] -6.446693
$BIC
[1] -6.400958
43 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
MA(2) model.
$AIC
[1] -6.450133
$AICc
[1] -6.449637
$BIC
[1] -6.388823
44 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
45 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
−3 −2 −1 0 1 2 3
●
●
●●
●●
Sample Quantiles
●●
●●
●
●
●●
●●
●
●
●
●●
●
0.2
●
●●
●
●●
●
●●
●
●●
●
●
●●
●
●●
●●
●
●
●●
●
●
●●
●
●
●●
●
●
ACF
●●
●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●
●
●●
●
●
●
●●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●●
●
●
●
●●
●
●
●
●●
●
●●
●
●
●●
●
●
●
●●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●●
●
●
●
●
●
●
●●
●
●
●●
●
●
●●
●
●
●
●●
●
●
●●
●
●
●
●
●●
●
●●
●
0.0
●●
●
●
●
●●
●
●●
●
●
●
●
●
●●
●
●●●●●
●
●●
●
−0.2
● ●
5 10 15 20 −3 −2 −1 0 1 2 3
LAG Theoretical Quantiles
p values for Ljung−Box statistic
0.0 0.2 0.4 0.6 0.8 1.0
●
● ● ●
●
● ●
● ● ●
●
p value
● ● ●
●
●
5 10 15 20
LAG (H)
46 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
ARMA(2,2) model.
$AIC
[1] -6.462032
$AICc
[1] -6.46078
$BIC
[1] -6.370067
47 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
48 / 49
Integrated Models for Nonstationary Data Building ARIMA Models Worked Example
49 / 49