Page 1 of 1

problem with shock decomposition

PostPosted: Sun Jun 07, 2015 5:50 pm
by Ravelomanana
Hi ,
Shock decomposition doesn't run
this message appears each time I run it:

Subscripted assignment dimension mismatch.

Error in read_variables (line 101)
dyn_data_01(:,dyn_i_01) = dyn_tmp_01;

Error in initialize_dataset (line 32)
rawdata = read_variables(datafile,varobs,[],xls.sheet,xls.range);

Error in dynare_estimation_init (line 475)
dataset_ =
initialize_dataset(options_.datafile,options_.varobs,options_.first_obs,options_.nobs,transformation,options_.prefilter,xls);

Error in evaluate_smoother (line 54)
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list, M_.fname, [], M_, options_,
oo_, estim_params_, bayestopt_);

Error in shock_decomposition (line 64)
oo = evaluate_smoother(parameter_set,varlist);

Error in SA (line 426)
oo_ = shock_decomposition(M_,oo_,options_,var_list_);

Error in dynare (line 180)
evalin('base',fname) ;

What's wrong with that?

Thank you

Best regards

Re: problem with shock decomposition

PostPosted: Sun Jun 07, 2015 5:54 pm
by jpfeifer
As always, state the version you are using an provide files to replicate the issue.

Re: problem with shock decomposition

PostPosted: Mon Jun 08, 2015 4:20 am
by Ravelomanana
what do you mean by to state the version?
it's the first time I run a shock decomposition

thank you
best

Re: problem with shock decomposition

PostPosted: Mon Jun 08, 2015 6:23 am
by jpfeifer
You should state which Dynare version you are using. Also, the data file is missing.

Re: problem with shock decomposition

PostPosted: Mon Jun 08, 2015 8:43 am
by Ravelomanana
I use dynare 4.4.3
I attached below the data

Re: problem with shock decomposition

PostPosted: Tue Jun 09, 2015 1:04 pm
by jpfeifer
In your Excel file you must not have two columns in the same sheet with the same heading. In the first sheet that Dynare tries to read, all variables are there twice. Moreover, there is a bug that will show up subsequently. You are trying to run the shock decomposition on an estimated model using the parameter_set=calibration option. To make this work, you need to enclose the line
Code: Select all
M_ = set_all_parameters(xparam1,estim_params_,M_);

in DsgeSmoother.m with
Code: Select all
if ~isempty(xparam1)
    M_ = set_all_parameters(xparam1,estim_params_,M_);
end

Re: problem with shock decomposition

PostPosted: Tue Jun 09, 2015 1:35 pm
by Ravelomanana
Thank you Dear Pfeifer
The problem is fixed now

Best

Re: problem with shock decomposition

PostPosted: Fri May 06, 2016 12:35 pm
by fkruse
Dear all,

I'm sorry that I have to post in this topic again. I get exactly the same error messages when I try to run my shock decomposition:

Error in ==> evaluate_smoother at 54
[dataset_,dataset_info,xparam1, hh, M_, options_, oo_,
estim_params_,bayestopt_] = dynare_estimation_init(var_list, M_.fname, [], M_,
options_, oo_, estim_params_, bayestopt_);

Error in ==> shock_decomposition at 64
oo = evaluate_smoother(parameter_set,varlist);

Error in ==> cmr at 3082
oo_ = shock_decomposition(M_,oo_,options_,var_list_);

Error in ==> dynare at 180
evalin('base',fname) ;


Even though I tried to modify my code with the lines you've mentioned, it didn't work. Can anybody tell me - or maybe explain a bit in more detail - how to fix this bug? I use Dynare 4.4.3 and I try to replicate the Code of Christiano, Moto and Rostagno's "Risk Shocks".

Best regards

Re: problem with shock decomposition

PostPosted: Tue May 10, 2016 8:59 am
by jpfeifer
Could you please try the current unstable version. If it does not work, please provide the full files.