MA Advanced Macroeconomics: 5. Latent Variables: The Kalman Filter
MA Advanced Macroeconomics: 5. Latent Variables: The Kalman Filter
MA Advanced Macroeconomics: 5. Latent Variables: The Kalman Filter
Karl Whelan
Spring 2016
E (X |Z ) = µX + ΣXZ Σ−1
ZZ (Z − µZ )
This formula will play an important role in our explanation of the Kalman
filter.
Then the variance of error term after conditioning on period t − 1’s estimate
of the state variables is given by
vt + H St − St|t−1 ∼ N (0, Ωt )
where
Ωt = Σv + HΣSt|t−1 H 0
i=T
Y
f Z1 , Z2 , ...., ZT |S1|0 , θ = f Z1 |S1|0 , θ f (Zi |Zi−1 , θ)
i=2
This means that in period t − 1, the expected value for the observables in
period t are
Zt|t−1 = HSt|t−1 = HFSt−1|t−1
Then in period t, when we observe Zt the question is how do we update our
guesses for the state variable in light of the “news” in Zt − HFSt−1|t−1 ?
Now we can use our earlier result about conditional expectations to state that
the minimum variance unbiased estimate of St given the observed Zt is
E (St |Zt ) = St|t = FSt−1|t−1 + Kt Zt − HFSt−1|t−1
where 0 −1
Kt = HΣSt|t−1 Σv + HΣSt|t−1 H 0
The values of the covariance matrix genrated by this equation will generally
converge, so for our unconditional covariance matrix we can use a value of Σ
that solves 0
Σ = F ΣF + Σu
t=1
This seems fairly ad hoc but it can be viewed as an example of the Kalman
filter. Consider the following state-space model
Yt = Yt∗ + Ct
∆Yt∗ = ∗
∆Yt−1 + gt
Ct = ct
where Var (gt ) = σg2 and Var (ct ) = σc2
It can be shown that for large samples the HP filter technique is the same as
σ2
Kalman filter estimation of this model when we set λ = σc2 . Hodrick and
g
Prescott assumed Ct had a standard deviation of 5 percentage points while gt
had a standard deviation of one-eighth of a percentage point. Hence they
2
chose λ = 51 2 = (25)(64) = 1600.
(8)
Karl Whelan (UCD) Latent Variables Spring 2016 14 / 22
Example: Laubach and Williams (2001)
This paper uses the Kalman filter to estimate a model featuring two
unobservable time-varying series: Potential output and the natural rate of
interest.
The model has seven equations
ỹt = yt − yt∗
∗
ỹt = Ay (L) ỹt−1 + Ar (L) rt−1 − rt−1 + 1t
πt = Bπ (L) πt−1 + By (L) ỹt−1 + +Bx (L) xt + 2t
rt∗ = cgt + zt
zt = Dz (L) zt−1 + 3t
yt∗ ∗
= yt−1 + gt−1 + 4t
gt = gt−1 + 5t
where yt is log of real GDP, yt∗ is the log of potential output, ỹt is the output
gap, rt is the real Federal funds rate, rt∗ is the “natural” real rate of interest,
πt is inflation, xt is a set of additional variables that determine inflation and
gt is the growth rate of potential output.
Karl Whelan (UCD) Latent Variables Spring 2016 15 / 22
Laubach and Williams Results
In addition to the results in the original paper, updated estimates are available
on the San Francisco Fed website.
The next page shows the original paper’s estimates of the natural real rate of
interest (i.e. the real interest rate that stabilises the economy) with the green
area showing standard errors,
The following page shows the updated estimates of the natural rate using the
two-sided Kalman smoother. While the original paper had shown the natural
rate as a stationary series, the latest estimates show a steady downward trend
so that the current “natural real rate” is negative.
The model also sees a steady decline in the growth rate of potential output. It
assigns much of the weak growth of recent years to structural factors (output
gap in recent recession is quite small).
Final pictures show differences between two-sided and one-sided estimates of
natural rate of interest and potential output growth. You can see why they
call it the Kalman smoother.
RATS code for estimating the Laubach-Williams model is linked to on the
website.
Karl Whelan (UCD) Latent Variables Spring 2016 16 / 22
Actual Versus Natural Real Interest Rates