problem with shock decomposition

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

problem with shock decomposition

Postby Ravelomanana » Sun Jun 07, 2015 5:50 pm

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
Ravelomanana
 
Posts: 17
Joined: Mon May 11, 2015 5:49 pm

Re: problem with shock decomposition

Postby jpfeifer » Sun Jun 07, 2015 5:54 pm

As always, state the version you are using an provide files to replicate the issue.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with shock decomposition

Postby Ravelomanana » Mon Jun 08, 2015 4:20 am

what do you mean by to state the version?
it's the first time I run a shock decomposition

thank you
best
Attachments
SA.mod
(10.84 KiB) Downloaded 206 times
Ravelomanana
 
Posts: 17
Joined: Mon May 11, 2015 5:49 pm

Re: problem with shock decomposition

Postby jpfeifer » Mon Jun 08, 2015 6:23 am

You should state which Dynare version you are using. Also, the data file is missing.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with shock decomposition

Postby Ravelomanana » Mon Jun 08, 2015 8:43 am

I use dynare 4.4.3
I attached below the data
Attachments
nico.xls
(69.5 KiB) Downloaded 709 times
Ravelomanana
 
Posts: 17
Joined: Mon May 11, 2015 5:49 pm

Re: problem with shock decomposition

Postby jpfeifer » Tue Jun 09, 2015 1:04 pm

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: problem with shock decomposition

Postby Ravelomanana » Tue Jun 09, 2015 1:35 pm

Thank you Dear Pfeifer
The problem is fixed now

Best
Ravelomanana
 
Posts: 17
Joined: Mon May 11, 2015 5:49 pm

Re: problem with shock decomposition

Postby fkruse » Fri May 06, 2016 12:35 pm

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
fkruse
 
Posts: 1
Joined: Fri May 06, 2016 12:30 pm

Re: problem with shock decomposition

Postby jpfeifer » Tue May 10, 2016 8:59 am

Could you please try the current unstable version. If it does not work, please provide the full files.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 15 guests