Bug or user error in posterior_analysis in 4.1.1?


I am replicating the Smets-Wouters AER US model, and I am running into the following error. Note that “Steps” in the below is an empty “list” ] (I don’t know what this is called in Matlab).

MH: Posterior (dsge) IRFs... MH: Posterior IRFs, done!

??? Subscripted assignment dimension mismatch.

Error in ==> conditional_variance_decomposition_mc_analysis at 72
p_mean(1,:slight_smile: = Steps;

Error in ==> posterior_analysis>job at 78
oo_ = conditional_variance_decomposition_mc_analysis(SampleSize,‘posterior’,M_.dname,M_.fname,…

Error in ==> posterior_analysis at 34
oo_ = job(type,SampleSize,arg1,arg2,arg3,options_,M_,oo_);

Error in ==> compute_moments_varendo at 110
oo_ = posterior_analysis(‘conditional

Error in ==> dynare_estimation_1 at 1077
oo_ = compute_moments_varendo(‘posterior’,options_,M_,oo_,var_list_);

Error in ==> dynare_estimation at 62

Error in ==> usmodel at 491

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

I think the relevant call is the following. I can post the code and data if it would help.

irf=20,moments_varendo,filtered_vars,smoother) dy pinfobs robs labobs;


yes please post your mod-file and data. Should be more convenient to see what’s wrong.


Hey all,

here is a mod-file of the SW US model which reproduces the bug…

"??? Subscripted assignment dimension mismatch.

Error in ==> conditional_variance_decomposition_mc_analysis at 70
p_mean(1,:slight_smile: = Steps;"

I am using Dynare 4.1.2

Just “dynare usmodel” and wait a little. (I guess you could change the mode_compute to 0 to speed things up a little.)

I guess commenting out works - or adjusting “options.conditional_variance_decomposition” to something other than “]” but I find that odd. Is there another workaround?

usmodel_var_decomp.zip (22.5 KB)