using MATLAB
Author:
Manuel Escobar
, Economics Department University of Chile
I What to expect of this guide?
After carefully reviewing this document you will have a pretty good idea of how to estimate an unobservable
variable in a state-space model. On this purpose a MATLAB code is provided to filter and smooth a generalised
model.
This guide requires basic knowledge of matrix algebra, time series models, and MATLAB programming. In case
you do not have them, do not hesitate to consult my other simplified notes.
II The state space representation
We define a state space model as a set of equations of the form:
yt = Ht zt + Gxt + vt vt ∼ N (0, R) (1)
zt = Bzt−1 + F xt−1 + wt wt ∼ N (0, Q) (2)
Where yt is a vector of observable variables that can be explained by a vector of unobservable variables (zt )
and exogenous variables (xt ). This relationship exhibited in (1). As for the vector of unobservables, we assume
that we know its change over time (2) as a function of itself lagged one period and exogenous variables. Each
of the equations has a perturbation vector with mean 0 and fixed variance. Example 1 provides an illustration
of how to set up the state space representation.
Example 1: State-Space Representation
To exemplify the state space representation, let us consider a model to estimate the potential gross domestic
product and the neutral interest rate of the form:
y˜t = α1 yt−1 ˜ + εyt
˜ + β1 rt−1
πt = ˜ + επt
γ1 πt−1 + ψ1 yt−1
rt∗ = cgt + zt
(3)
yt∗ = ∗
yt−1 + gt−1 + wt2
gt = gt−1 + wt3
zt = ζ1 zt−1 + wt1
Where y˜t is the output gap which is equal to yt − yt∗ with yt∗ being the logarithm of potential output. Thus,
r˜t = (rt − rt∗ ) with rt∗ the neutral interest rate.
The observables in this model are yt , rt and πt , in order: the logarithm of the gross domestic product, the
monetary policy interest rate and the inflation rate, all in quarterly frequency. The rest of the equations define
the movement of the unobservables and their perturbations.
The unobservables of this model are yt∗ , rt∗ and gt , in order: the logarithm of the potential domestic product,
the neutral interest rate and the growth of the potential product.
The perturbations of this model come from εy , επ , wt1 , wt2 and wt3 .
Página 1 de 6