Professional Documents
Culture Documents
1
Big Picture
2
(Weak or Covariance) Stationarity
Eyt = µ (1)
var(yt ) = σy2 (2)
cov(yt , yt−j ) depends only on j (3)
3
Why Stationarity?
4
Example of Nonstationary Series
yt = at + et
5
Ergodicity
• For a series which is both stationary and ergodic, the law of large
number holds
1∑
T
yt → E(yt ), as T → ∞
T t=1
• Later we will learn that a unit root process is not ergodic, so the
law of large number cannot be applied to a unit root process.
6
Why Ergodicity?
7
BoxJenkins Methodology
8
Review: Expectation and Variance
9
MA(1) Process
yt = et + θ1 et−1
10
MA(2) Process
yt = et + θ1 et−1 + θ2 et−2
• Find Eyt =
• Find var(yt ) =
• Find cov(yt , yt−1 ) =
• Find cov(yt , yt−2 ) =
• Find cov(yt , yt−3 ) =
• Is MA(2) process stationary or ergodic?
11
In General: MA(q) Process
Eyt = θ0
12
Impulse Response
13
AR(1) Process
yt = ϕ0 + ϕ1 yt−1 + et
|ϕ1 | < 1
14
Stationary AR(1) Process
15
Autocovariance and Ergodicity
γj = ϕj1 γ0 , (j = 1, 2, . . .)
γj → 0 fast enough as j → ∞
16
Autocorrelation Function (ACF)
ρj = ϕj1
17
MA(∞) Form
yt = ϕ0 + ϕ1 yt−1 + et
= ϕ0 + ϕ1 (ϕ0 + ϕ1 yt−2 + et−1 ) + et
= ϕ0 + ϕ1 ϕ0 + ϕ21 yt−2 + et + ϕ1 et−1
= . . . + ϕ21 (ϕ0 + ϕ1 yt−3 + et−2 ) + . . .
= ...
18
MA(∞) Form
• Note that the j-th coefficient in the MA(∞) form looks special
θj = ϕj1
19
Lag Operator
• In general
Lj yt = yt−j
In words applying the lag operator once amounts to pushing the
series one period back
• Loosely speaking, you can treat L as a number in the following
math derivation
20
MA(∞) Form Revisited
• We can derive the MA(∞) form easily using the lag operator
• The AR(1) process can be written as
yt = ϕ0 + ϕ1 yt−1 + et (12)
⇒ yt = ϕ0 + ϕ1 Lyt + et (13)
⇒ (1 − ϕ1 L)yt = ϕ0 + et (14)
1
⇒ yt = (ϕ0 + et ) (15)
1 − ϕ1 L
⇒ yt = (1 + ϕ1 L + ϕ21 L2 + . . .)(ϕ0 + et ) (16)
ϕ0
⇒ yt = + et + ϕ1 et−1 + ϕ21 et−2 + . . . (17)
1 − ϕ1
where the last equality follows because Lc = c when c is constant.
21
Lecture 4b: Estimate ARMA Model
22
BoxJenkins Methodology: Identification (I)
1∑
T
µ̂ = yt (18)
T t=1
1 ∑
T
γ̂0 = (yt − µ̂)2 (19)
T − 1 t=1
1 ∑T
γ̂j = (yt − µ̂)(yt−j − µ̂) (20)
T − j − 1 t=j+1
23
BoxJenkins Methodology: Identification (II)
24
Estimate AR Model
yt = ϕ0 + ϕ1 yt−1 + . . . + ϕp yt−p + ut
25
How to get lagged values
• To get the first lag yt−1 you just replace the first observation by
a missing value, and then move the whole series down by one
period.
• The R command to get the first and second lagged series are
y1= c(NA, y[1:n-1]) # y1 is the first lag
y2= c(NA, NA, y[1:(n-2)]) # y2 is the second lag
• A hypothetical sample looks like
y y1 y2
2.3 na na
1.9 2.3 na
4.4 1.9 2.3
3.2 4.4 1.9
26
OLS
27
Testing for Model Adequacy
28
R code
29
Overfitting
30
Three Strategies
31
Akaike Information Criterion
32
Interpreting Error Term (Optional)
33
Estimate MA Model (Optional)
34
Estimate MA(1) Model (Optional)
yt = et + θet−1
• We cannot run a regression here because et is unobservable.
• Instead, we need to apply the method of maximum likelihood
(ML).
• Suppose e0 = 0, and assume et ∼ N (0, σe2 ). The distributions for
observed values are
35
Maximum Likelihood Estimation (Optional)
36
AR(∞) Representation for MA(1) Process
yt = et + θet−1 (24)
⇒ yt = (1 + θL)et (25)
1
⇒ yt = et (26)
1 + θL
⇒ (1 − θL + θ2 L2 + . . .)yt = et (27)
37
Lecture 4c: Forecasting
38
Big Picture
39
Review: Conditional Mean
E(c|X) = c (28)
E(cX|Y ) = cE(X|Y ) (29)
E(f (X)|X) = f (X) (30)
40
Theorem
41
AR(1) Process
yT +1 = ϕ0 + ϕ1 yT + eT +1
yT +1 − ŷT +1 = eT +1
var(eT +1 ) = σe2
42
Two-Step-Ahead Forecast
yT +2 = ϕ0 + ϕ1 yT +1 + eT +2 (32)
= ϕ0 + ϕ1 (ϕ0 + ϕ1 yT + eT +1 ) + eT +2 (33)
= ϕ0 + ϕ1 ϕ0 + ϕ21 yT + ϕ1 eT +1 + eT +2 (34)
yT +2 − ŷT +2 = ϕ1 eT +1 + eT +2
43
h-Step-Ahead Forecast
For the h-step-ahead future value, its best forecast and forecast
variance are
44
In the limit
σe2
lim var(yT +h − ŷT +h ) = = var(yt )
h→∞ 1 − ϕ21
So the best forecast (conditional mean) converges to unconditional
mean; the forecast variance converges to unconditional variance of
the series. This is another property of stationary and ergodic series.
45
Intuition
The condition |ϕ1 | < 1 ensures that the ergodicity holds. For an
ergodic series, two observations are almost independent if they are far
away from each other. That is the case for yT and yT +h when h → ∞
(ie., yT becomes increasingly irrelevant for yT +h ). As a result, the
conditional mean converges to unconditional mean.
46
Forecasting MA(1) Process
e1 = y1 (assuming e0 = 0) (37)
e2 = y2 − θe1 (38)
... ... (39)
eT = yT − θeT −1 (40)
yT +1 − ŷT +1 = eT +1
47
Two-Step-Ahead Forecast
yT +2 = eT +2 + θeT +1
It follows that the best forecast and forecasting variance are
48
One More Thing
49
What if
50
Best Linear Predictor
ût ≡ Yt − Ŷt
Ŷt = α + βXt
51
Lecture 4d: Modeling US Annual Inflation Rate
52
Data
1. The annual data for consumer price index (CPI) from 1947 to
2013 are downloaded from
http://research.stlouisfed.org/fred2/
2. By definition, the inflation rate (INF) is the percentage change of
CPI, so is approximately computed as the log difference:
CPIt − CPIt−1
INFt ≡ ≈ log(CPIt ) − log(CPIt−1 )
CPIt−1
53
CPI time series plot
100
50
Time
54
Remarks
55
INF time series plot
0.04
0.02
0.00
Time
56
Remarks
57
Model Selection
58
Test for Model Adequacy
59
Equivalent Forms
yt = ϕ0 + ϕ1 yt−1 + et
yt = µ + dt
dt = ϕ1 dt−1 + et
ϕ0
µ ≡
1 − ϕ1
where µ = E(yt ) is the mean, dt ≡ yt − µ is the deviation, and
E(dt ) = 0 by construction
60
“deviation-from-mean” form
61
Warning
or equivalently
More explicitly,
µ = 0.0297
ϕ0 = 0.01694682
ϕ1 = 0.4294
62
Stationarity
63
Forecast
Id
NFT +1 = ϕ0 + ϕ1 Id
NFT
= 0.01694682 + 0.4294 ∗ 0.014553604
= 0.02319614
• Now you can use Fisher equation to forecast the nominal interest
rate, and make decision about whether or not to buy a house, etc
64
ML vs OLS
65
A more transparent way
66