Shock decomposition of a calibrated DSGE

Dear all,

I’ve been trying to decompose historical time series with a medium-scale dsge model (around 40 equations) using the “shock_decomposition” command. And using a datafile of montlhy observations for 19 years. I introduce 5 observables (in log dev. from ss calculated with hpfilter) and 5 shocks. I also tried using quarterly and annual data, and I always get the following error:

"Error using *
Inner matrix dimensions must agree.

Error in lyapunov_solver (line 65)
P =
lyapunov_symm(T,RQR’,DynareOptions.lyapunov_fixed_point_tol,DynareOptions.qz_criterium,DynareOptions.lyapunov_complex_threshold,
[], DynareOptions.debug);

Error in DsgeSmoother (line 159)
Pstar=lyapunov_solver(T,R,Q,options_);

Error in evaluate_smoother (line 105)
DsgeSmoother(parameters,dataset_.nobs,transpose(dataset_.data),dataset_info.missing.aindex,dataset_info.missing.state,M_,oo_,options_,bayestopt_,estim_params_);

Error in shock_decomposition (line 75)
[oo_, M_, junk1, junk2, Smoothed_Variables_deviation_from_mean] = evaluate_smoother(parameter_set, varlist, M_, oo_,
options_, bayestopt_, estim_params_);

Error in basemodel (line 608)
[oo_,M_]= shock_decomposition(M_,oo_,options_,var_list_,bayestopt_,estim_params_);

Error in dynare (line 223)
evalin(‘base’,fname) ;"

I am using Dynare 4.5.0 and Matlab 2016a. Attached are my code and database.
I would really appreciate your help, thank you for your time.

bestbasemodel.zip (15.5 KB)

Maria

Your model has a unit root. Please put
options_.diffuse_filter=1;
before
shock_decomposition

Thank you very much!
Now it works.
best

Maria