Negative shocks

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.

Negative shocks

Postby AS90 » Fri Jan 16, 2015 4:40 pm

How is one to generate negative shocks in Dynare? Thanks.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm

Re: Negative shocks

Postby jpfeifer » Fri Jan 16, 2015 7:33 pm

In which context? Simulations or IRFs?
------------
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: Negative shocks

Postby AS90 » Sat Jan 17, 2015 12:04 pm

IRFs predominantly and both secondly.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm

Re: Negative shocks

Postby jpfeifer » Sat Jan 17, 2015 1:26 pm

For simulations, Dynare randomly draws from the shock distribution and some shocks are negative, of course. If you use the simult_ function for generating your own simulations, you can select any shock you like.
For IRFs, Dynare by default draws a positive one standard deviation shocks. If you have an AR(1) process like
Code: Select all
z=rho*z(-1)+eps_z;

and you want an IRF to a negative shock, write the process as
Code: Select all
z=rho*z(-1)-eps_z;

Due to symmetry of the normal distribution, this change does not affect anything in your model.
------------
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: Negative shocks

Postby AS90 » Tue Jan 20, 2015 4:52 pm

That's right; thank you, sir. By one's own simulations do you mean typing up one's own code? For instance, how could I get this one (attached) to generate IRFs to more than one of the three shocks present within the model? - As in, getting it to reproduce IRFs to the three shocks like in the Dynare code. Thanks.
Last edited by AS90 on Thu Jan 22, 2015 3:39 pm, edited 1 time in total.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm

Re: Negative shocks

Postby jpfeifer » Tue Jan 20, 2015 5:26 pm

Take a look at the RBC_news_shock_model.mod on my homepage. It shows how to use the simult_ function in Dynare to build any shock sequence for IRFs you like.
------------
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: Negative shocks

Postby AS90 » Wed Jan 21, 2015 4:07 pm

Thank you; I shall. Yet, I beg your pardon, what I was mainly asking was how to modify the second code, in the "Solutions" section, so as to generate IRFs to more than just one shock, like in Dynare. I'd really appreciate your assistance thereat. I am attaching the notes just for clarity. Gratitude.

Code: Select all
% Solutions

w_solution = NaN(10,T);
x_solution = NaN(10,T);

w_solution(:,1) = [0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1; 0.1];
x_solution(:,1) = inv(Pi_t_11) * w_solution(:,1);

for t = 2:T
        x_solution(:,t) = inv(Upsilon_11)*Psi_11*x_solution(:,t-1);
        w_solution(:,t) = Pi_t_11*x_solution(:,t);
end
Last edited by AS90 on Thu Jan 22, 2015 3:39 pm, edited 1 time in total.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm

Re: Negative shocks

Postby jpfeifer » Thu Jan 22, 2015 1:08 pm

I am not familiar with your code and what you are trying to achieve and thus cannot provide support.
------------
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: Negative shocks

Postby AS90 » Thu Jan 22, 2015 3:43 pm

I was trying to reproduce IRFs to the 3 shocks and not just the first one. Thank you, anyways.
AS90
 
Posts: 39
Joined: Tue Jul 23, 2013 3:22 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests