Historical shock decomposition

Hi everyone,
I am wondering if it is possible to compute shock decomposition (i have dynare version 4.3) after the estimation is done. I tried to put the “shock_decomposition;” command in the Matlab command window but it doesn’t work. Even if after loading “myfile_results.mat” from the estimation.

Moreover, I have the following command:

[code]estimation(datafile=data_cpi_ols,first_obs=1,mh_replic=20000,mh_nblocks=5,mh_drop=0.40,mh_jscale=0.85,mode_compute=6,smoother) LOPG_ZE LOPG_UK LOPG_CH LOPG_US LOPG_JP LOPG_SW;

shock_decomposition(parameter_set=posterior_mode) LOPG_ZE LOPG_UK LOPG_CH LOPG_US LOPG_JP LOPG_SW;[/code]
but this generates the following error message:

MH: Smoothed variables
MH: Smoothed variables, done!
MH: Smoothed shocks
MH: Smoothed shocks, done!
Loading 53 observations from data_cpi_ols.mat

??? Error using ==> describe_missing_data
Too many input arguments.

Error in ==> evaluate_smoother at 117
[data_index,number_of_observations,no_more_missing_observations] =

Error in ==> shock_decomposition at 60
oo = evaluate_smoother(parameter_set);

Error in ==> erpt at 1573
oo_ = shock_decomposition(M_,oo_,options_,var_list_);

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

Thanks in advance for any help!! I really need it for my phd thesis for which the deadline is on 29 october. Please, help!!!

Could you try 4.3.1? If it does not work, please send or post the mod-file.

Thanks jpfeifer,
At the moment, i’ve launched an estimation that takes time to finish. I’ll install 4.3.1 as soon as the estimation is finished and tell you if it works or not.
Again thanks for your help,

I’ve tried the shock decomposition with 4.3.1 and it works. However, when i want to select shocks (with the option “shocks”) to add in the decomposition, it failed.

where E_A are my exogeneous shocks.

This might be a bug. Could you send me the files?

This is a known issue, see: dynare.org/trac/ticket/136

Dear all,

I got the following shock decomposition graph. My suspicion is that there is some kind of misspecification into the match of the model to the observable variables, namely, dcomp_log_jp_obs, rer_log_jp_obs and fedfunds_jp_obs .
Nevertheless, I tried very hardly and I cannot see what could be. I really need some help with this matter, please!
shock_decomposition 2.zip (128 KB)

Please, I need some insight in this matter.

Please also provide the mode-file of your run.

I thought the mode file was inside the folder shock_decomposition 2.zip of the previous request.
Please, find a new file in the folder below. Hope, this time, it works!
shock_decomposition 3.zip (129 KB)

Not the .mod-file, I need the _mode.mat or _mh_mode.mat.

Note I did the follow experience. I incorrectly replaced dcomp_log_us_obs = log((exp(c1w))/(exp(c1w(-1)))) by dcomp_log_us_obs = log((exp(c2w))/(exp(c2w(-1)))), ceteris paribus, and all shock decomposition plots were acceptable.
I don’t understand what could possible be wrong!
nonlinear_USA_3 Sep_ 100000 draws_Code Bodenstein 1970 TODAY copy 5.zip (506 KB)

Here it is the _mode.mat and _mh_mode.mat.t file from the previous post.
shock_decomposition .zip (331 KB)

I am not sure what you are doing, but the mode-file does not describe a mode. It has

and mode-finding stops with

The results are from what version?

I used your zip-file with the mod-file nonlinearomega.txt

My apologies, but what do you mean by saying that the mode-file does not describe a mode.
Can you try, please, with this new version and see if the problem persist?

There are two mat-file. The _mode.mat and the mh_mode.mat. The likelihood value stored in both is massively different, showing that you did not start the MCMC at the point of highest likelihood.

Thank you for your last observation. I also confirmed what you said in the version below. What could be the model’ s misspecification behind mode.mat and mh_mode.mat different mode outputs. Could it be related with the fact that I am working with a small identity matrix in order to obtain
a positive definite Hessian? This may also explain why after 1000000 draws I didn’t reach convergence? What shall I do?

Run an intensive mode-finding first, e.g. mode_compute=9. When doing this, use the current _mh_mode.mat as the mode-file you load.