how to do variance decomposition in dynare?

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.

how to do variance decomposition in dynare?

Postby mayong1982 » Wed Sep 05, 2012 10:52 am

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.
mayong1982
 
Posts: 26
Joined: Tue Nov 29, 2011 11:18 am

Re: how to do variance decomposition in dynare?

Postby jpfeifer » Wed Sep 05, 2012 2:44 pm

See the manual on conditional_variance_decomposition.
------------
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: how to do variance decomposition in dynare?

Postby mayong1982 » Thu Sep 06, 2012 2:04 pm

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?
mayong1982
 
Posts: 26
Joined: Tue Nov 29, 2011 11:18 am

Re: how to do variance decomposition in dynare?

Postby jpfeifer » Thu Sep 06, 2012 3:06 pm

Please post the mod-file
------------
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: how to do variance decomposition in dynare?

Postby mayong1982 » Fri Sep 07, 2012 4:57 am

jpfeifer wrote:Please post the mod-file


here is my mod file. thanks!
Attachments
bbb.mod
(2.22 KiB) Downloaded 160 times
mayong1982
 
Posts: 26
Joined: Tue Nov 29, 2011 11:18 am

Re: how to do variance decomposition in dynare?

Postby jpfeifer » Fri Sep 07, 2012 6:40 am

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.
------------
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: how to do variance decomposition in dynare?

Postby mayong1982 » Fri Sep 07, 2012 5:27 pm

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.
mayong1982
 
Posts: 26
Joined: Tue Nov 29, 2011 11:18 am

Re: how to do variance decomposition in dynare?

Postby jpfeifer » Fri Sep 07, 2012 6:37 pm

Code: Select all
conditional_variance_decomposition=[1,4,8,16,32]
------------
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: how to do variance decomposition in dynare?

Postby mayong1982 » Sat Sep 08, 2012 3:16 am

jpfeifer wrote:
Code: Select all
conditional_variance_decomposition=[1,4,8,16,32]


it works. thank u so much.
mayong1982
 
Posts: 26
Joined: Tue Nov 29, 2011 11:18 am

Re: how to do variance decomposition in dynare?

Postby Victor » Mon Feb 03, 2014 7:42 pm

Thanks a lot for this too.
Victor
 
Posts: 15
Joined: Tue Dec 03, 2013 7:21 pm

Re: how to do variance decomposition in dynare?

Postby settler03 » Thu May 22, 2014 2:25 pm

Hello
Just eliminate command "periods" in last line
settler03
 
Posts: 17
Joined: Wed Nov 07, 2012 7:16 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests