Page 1 of 1

how to do variance decomposition in dynare?

PostPosted: Wed Sep 05, 2012 10:52 am
by mayong1982
hello, every body. i have a question.

suppose the dynare code is as follows:

var xxxxx;
varexo xxxxxxx ;
parameters xxxxxx;
model(linear);
y = xxxxx
……
end;
steady;
check;

shocks;
var …..
end;

estimated_params;
xxxx, normal_pdf, 0.03, 0.01;
…..
stderr epsilon_r, inv_gamma_pdf, 0.01, inf;
….
end;

varobs y pi;

stoch_simul(irf=40, periods=600) y pi r;

estimation(datafile=data, prefilter=1, first_obs=1, mh_drop=0.45, mode_compute=4, mode_check, mh_replic=20000);


my question is , how to add a command to let the dynare do variance decomposition? i mean both the command and where to put it.

Re: how to do variance decomposition in dynare?

PostPosted: Wed Sep 05, 2012 2:44 pm
by jpfeifer
See the manual on conditional_variance_decomposition.

Re: how to do variance decomposition in dynare?

PostPosted: Thu Sep 06, 2012 2:04 pm
by mayong1982
jpfeifer wrote:See the manual on conditional_variance_decomposition.


thanks for ur help.

i have added the "conditional_variance_decomposition" command this:

stoch_simul(irf=40, periods=600, conditional_variance_decomposition=40) y pi r;

but there are still no results..........why?

Re: how to do variance decomposition in dynare?

PostPosted: Thu Sep 06, 2012 3:06 pm
by jpfeifer
Please post the mod-file

Re: how to do variance decomposition in dynare?

PostPosted: Fri Sep 07, 2012 4:57 am
by mayong1982
jpfeifer wrote:Please post the mod-file


here is my mod file. thanks!

Re: how to do variance decomposition in dynare?

PostPosted: Fri Sep 07, 2012 6:40 am
by jpfeifer
It only works with theoretical moments and only at first order as variance decomposition for nonlinear systems are state-dependent. Hence, set order=1 and periods=0.

Re: how to do variance decomposition in dynare?

PostPosted: Fri Sep 07, 2012 5:27 pm
by mayong1982
jpfeifer wrote:It only works with theoretical moments and only at first order as variance decomposition for nonlinear systems are state-dependent. Hence, set order=1 and periods=0.



when i do as u say, the dynare did give a variance decomposition report. but the trouble is that there is only one report. you know, in many papers, the variance decomposition report usually includes several different horizons, such as 1 quarter, 4 quarters, 8 quarters, 16 quarters, 32 quarters, etc. how can i do this in my dynare code? thanks.

Re: how to do variance decomposition in dynare?

PostPosted: Fri Sep 07, 2012 6:37 pm
by jpfeifer
Code: Select all
conditional_variance_decomposition=[1,4,8,16,32]

Re: how to do variance decomposition in dynare?

PostPosted: Sat Sep 08, 2012 3:16 am
by mayong1982
jpfeifer wrote:
Code: Select all
conditional_variance_decomposition=[1,4,8,16,32]


it works. thank u so much.

Re: how to do variance decomposition in dynare?

PostPosted: Mon Feb 03, 2014 7:42 pm
by Victor
Thanks a lot for this too.

Re: how to do variance decomposition in dynare?

PostPosted: Thu May 22, 2014 2:25 pm
by settler03
Hello
Just eliminate command "periods" in last line