Error on Dynare for Bayesian DSGE (Justiniano, JME 2010)

Dear Dynare Experts,

I am replicating a DSGE model in the paper “INVESTMENT SHOCKS AND BUSINESS CYCLES” (Justiniano et. al. 2010 Journal of Monetary Economics) in Dynare,
And calibrate with data used in Smets and Wouthers(2007).

The problem is I get the following error messege from dynare and cannot get posterior estimation of parameters.

Starting MATLAB/Octave computing.

You did not declare endogenous variables after the estimation/calib_smoother command.
Posterior IRFs, posterior moments, smoothed variables will be computed for
the 46 endogenous variables of your model, this can be
very long…

Choose one of the following options:

[1] Consider all the endogenous variables.
[2] Consider all the observed endogenous variables.
[3] Stop Dynare and change the mod file.

options [default is 1] = 2
Loading 230 observations from usmodel_data.mat

??? In an assignment A(I) = B, the number of elements in B and
I must be the same.

Error in ==> set_parameters at 70
M_.params(estim_params_.param_vals(:,1)) = xparam1(offset+1:end);

Error in ==> dynare_estimation_1 at 124

Error in ==> dynare_estimation at 70

Error in ==> invshock at 426

Error in ==> dynare at 120
evalin(‘base’,fname) ;

I get stuck now and can not find a way to further modify the code. Can anyone provide me some clues?
The dynare code invshock.mod and invshock_stst.mod(calculating steady states) and the data set can be found in the attached zip file invshock(2).zip.

Many thanks for time and consideration!
With best wishes
invshock (2).zip (146 KB)

The problem is that your posterior mode file has apparently been estimated with a different specification. Delete “usmodel_mode.mat“ and restart the estimation (of course, you’ll have to compute a new posterior mode).