## Kalman filtering and smoothing

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

### Kalman filtering and smoothing

Dear all,
I would like to understand how Dynare computes the Kalman filter and the smoother.

1- Starting with matrices dr_.ghx and dr_.ghu, how to obtain (or identify) matrices zz, psi and phi in a model whose solution is given by:

Y_t=zz*GAM_t+W_t (measurement equation)

GAM_t=phi*GAM_{t-1}+psi*V_t (transition equation)

with E(V_tV_t')=SIG_v, E(W_tW_t')=SIG_w

2- How does Dynare compute the Kalman filter and especially in a model with measurement errors as the one above. Is there any file I can take a look at in order to understand the mechanisms at work?

Thanks,
Junior
jmaih

Posts: 24
Joined: Tue Jan 17, 2006 6:12 pm

### Re: Kalman filtering and smoothing

jmaih wrote:Dear all,
I would like to understand how Dynare computes the Kalman filter and the smoother.
Junior

Dear Junior,

a good reference is A. Harvey (1989) Forecasting, structural time series models and the Kalman filter. Cambridge University Press.

For diffuse filters, we use
"Filtering and Smoothing of State Vector for Diffuse State Space
Models", S.J. Koopman and J. Durbin (2003, in Journal of Time Series Analysis, vol. 24(1), pp. 85-98).

the code is implemented in DiffuseLikelihood*.m and DiffuseKalmanSmoother*.m

the top of the functions implement the diffuse filter, at the end you find the standard one.

Kind regards

Michel
MichelJuillard

Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

Dear Michel,
Thank you so much!

All the best,
Junior
jmaih

Posts: 24
Joined: Tue Jan 17, 2006 6:12 pm