Adding a negative shock

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.

Adding a negative shock

Postby asmae » Fri Apr 12, 2013 10:02 pm

Hello,

I need to add a 1 period negative shock (of 5%) to the AR(1) process in my open economy model . i used for that the commands:
shocks;
var ksi;
periods 1;
values -0.05;
end;
simul(periods=1000);

but i can't obtain my IRFs.

to make a comparison, i used the commad stoch_simul with stderr 1. in such case i can run my programm and obtain my IRFs, but how can i add a negative shock? (stderr can never be negative!).

Please can you help?

:|
Attachments
RBC1.mod
(1.26 KiB) Downloaded 178 times
asmae
 
Posts: 14
Joined: Fri Mar 22, 2013 10:57 am

Re: Adding a negative shock

Postby jpfeifer » Sat Apr 13, 2013 4:33 pm

For stoch_simul, change the
Code: Select all
theta = rho*theta(-1)+ksi;

to
Code: Select all
theta = rho*theta(-1)-ksi;


For simul, I would need 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: Adding a negative shock

Postby asmae » Sat Apr 13, 2013 9:18 pm

Hello,

Thanks for your reply, i appreciate it.

Please find attached my mod file for simul.

Thank you. :P
Attachments
RBC1.mod
(1.24 KiB) Downloaded 197 times
asmae
 
Posts: 14
Joined: Fri Mar 22, 2013 10:57 am

Re: Adding a negative shock

Postby jpfeifer » Sun Apr 14, 2013 6:03 am

How about following Matlab's and Dynare's precedence rules and setting the brackets correctly in e.g.
Code: Select all
yss = (a*(alpha*beta/1-beta*(1-delta))^alpha)^1/(1-alpha);

in order to not obtain complex steady state values. Apart from that the code runs correctly.
------------
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: Adding a negative shock

Postby asmae » Sun Apr 14, 2013 9:30 am

Hello,

Thank you for your help.

:P
asmae
 
Posts: 14
Joined: Fri Mar 22, 2013 10:57 am


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 2 guests