Page 1 of 1

DsgeSmoother - State Space of Durbin and Koopman

PostPosted: Thu Mar 30, 2017 6:25 am
by Aldo
Hello dear all,
I am seeing that DsgeSmoother.m follows notation of Durbin/Koopman (2003):

y_t = Z*alpha_t + eps_t, ....................................... eps_ t ~ N(0,H)
apha_t+1 = T*alpha_t + R*eta_t, ............................. eta_t ~ N(0,Q)

I see in this function is computed Z, T, R, H, Q and alphahat and it returns as output alphahat, T and R among other elements.

I would like to modify DsgeSmoother.m in order to be able to get Z, T, R, H, Q and alphahat and I would like to include this in one structure, in M_. Could you please give me some advices to do this, maybe, what codes should I include?

By another side, I would like to know the order of variables included in apha_t, for example if I declare endogenous variables:

var x z x_obs z_obs
...
and after I declare observed variables:
varobs x_obs z_obs

Does It implies alpha will have this order = [x z x_obs z_obs ]?
And Does it implies y_t will have this order = [ x_obs z_obs ]?

Thanks a lot for your help

Aldo

Re: DsgeSmoother - State Space of Durbin and Koopman

PostPosted: Thu Mar 30, 2017 7:05 am
by jpfeifer
That depends on the function your are calling first. In the unstable version, Dynare returns M_ as a function output. If your are using
Code: Select all
calib_smoother

any additional field passed to
Code: Select all
M_

should be returned.

Regarding the ordering, it should be in decision rule order. The code in
store_smoother_results

may be useful for sorting things out.

Re: DsgeSmoother - State Space of Durbin and Koopman

PostPosted: Fri Mar 31, 2017 4:32 am
by Aldo
Dear jpfeifer thank you very much for your help,
I am new in Dynare, so I apologize if my questions seems redundants.

1. I don't understand with
That depends on the function your are calling first.

Could you please give me more details?
If it is more complicated get Z, T, R, H, Q and alphahat as output saved in M_, I would like to retrieve these matrices after estimation with a simple .m.

2. By another side.
Regarding the ordering, it should be in decision rule order.


Where could I see decision rule orden? I appreciate very much your details, please. Is not urgent, but I would be wonderfull with details.

3. In Dynare 4.3.0. there was a

Code: Select all
M_.state_var


Where can I find this in Dynare 4.4.3?

Cheers

Aldo

Re: DsgeSmoother - State Space of Durbin and Koopman

PostPosted: Mon Apr 03, 2017 1:43 pm
by jpfeifer
1. The problem is that you have to make sure that the function that calls the smoother also returns the structure
Code: Select all
M_
where you want to store the additional objects from the smoother. The best way is to use the unstable version and call
Code: Select all
evaluate_smoother.m

in a
Code: Select all
verbatim

block.
2. The decision rule ordering is documented in the manual in section
4.13.2 Typology and ordering of variables

3. It should be in
Code: Select all
oo_.dr.state_var