"Matrix dimensions must agree"

Dear helpful people,

I am trying to model a small open economy based on Galì (2008). However, I am facing a problem when trying to use a smoother (either automatically in the estimation or manually with the calib_smoother function after the stoch_simul function).

I suspect it may come from the variable e (nominal exchange rate) because when I don’t include it in the varobs, the error doesn’t show up.

I attach the files to replicate the problem (I am using Dynare 4.6.0). Thanks in advance for your help.

SOE.zip (166.1 KB)

Here is the error message that I don’t understand :

Matrix dimensions must agree.

Error in missing_DiffuseKalmanSmootherH1_Z (line 300)
r0(:,t) = Z(di,:)’*iFstar(di,di,t)*v(di,t)-Lstar(:,di,t)’*r0(:,t+1); % DK
(2003), eq. (14)

Error in DsgeSmoother (line 231)
[alphahat,epsilonhat,etahat,ahat,P,aK,PK,decomp,state_uncertainty] =
missing_DiffuseKalmanSmootherH1_Z(ST, …

Error in evaluate_smoother (line 105)

Error in SOE_Closed_Simplified_v3_sale.driver (line 417)
[oo_, M_, options_, bayestopt_] = evaluate_smoother(options_.parameter_set, var_list_, M_, oo_,
options_, bayestopt_, estim_params_);

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

This looks like a bug in Dynare. I will have to investigate this in detail.

Dear Pr. Pfeifer,

Thank you for looking into this issue.
It would help me a lot if you find a solution to this problem.

There is one line of code you need to change. See

Thank you very much for you quick help !