Deterministic Simulation - Steady State function

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.

Deterministic Simulation - Steady State function

Postby Jeff » Mon Nov 10, 2014 3:31 am

Dear All,

I need your help. I need to compute the perfect-foresight transition path (deterministic simulation) between an initial steady state and a final one.
I was wondering whether it is possible to use the steady state function to load into dynare both steady states. I know I could use the initval and endval command right after the model block, but my model is complicated that I want to avoid doing that.

Here is the sketch (in a much simpler model) of the steady state function that I currently use to load the initial steady state.

function [ys,check1] = rbc_steadystate(junk,ys);

global M_
%LOAD PARAMETERS AND INITIAL STEADY STATE VALUES
load PARAM.mat
load SSrbc_INIT.mat

M_.params = [ BETA ; DELTA; GAMMA; NU;
PSI; RHOZ; SIGMAU ;];

check1 = 0 ;

xxx = [Crbc; Irbc; lambdarbc; Nrbc; Krbc; Yrbc; Wrbc;1];

ys = xxx;


Thanks in advance, any help is appreciated.
Jeff
 
Posts: 4
Joined: Mon Nov 10, 2014 3:21 am

Re: Deterministic Simulation - Steady State function

Postby jpfeifer » Tue Nov 11, 2014 9:10 pm

Unfortunately, this is not easily possible. Your best option is to trick Dynare. If I see it correctly, Dynare 4.4.3 will write the initval contents to
Code: Select all
ys0_= oo_.steady_state;
ex0_ = oo_.exo_steady_state;

and the endval-contents to oo_.steady_state.
Try defining almost empty initval and endval-block and then use the verbatim-block to call the steady state file and then assign the steady states to ys0_ and oo_.steady_state.
If it works or not, please provide feedback.
------------
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: Deterministic Simulation - Steady State function

Postby Jeff » Wed Nov 12, 2014 1:49 am

Hi jpfeifer,

First of all let me thank you for your reply and help.

Your proposed solution works. Following your advice I load initial and final values with the following syntax.

Following the model block,

initval;
c = 1;
end;

verbatim; %Note that ysINIT is a vector that contains the initial steady state values
oo_.steady_state = ysINIT;
end;

endval;
c = 1;
end;

verbatim;%Note that ysFIN is a vector that contains the final steady state values
oo_.steady_state = ysFIN;
end;

the standard syntax for the deterministic simulation follows.


Thanks a lot for your help,
Jeff
 
Posts: 4
Joined: Mon Nov 10, 2014 3:21 am

Re: Deterministic Simulation - Steady State function

Postby jpfeifer » Wed Nov 12, 2014 6:12 am

I am confused by your solution. Shouldn't the first part be
Code: Select all
verbatim; %Note that ysINIT is a vector that contains the initial steady state values
ys0_ = ysINIT;
end;
------------
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: Deterministic Simulation - Steady State function

Postby Jeff » Wed Nov 12, 2014 8:16 pm

Unless I include oo_.steady_state = ysINIT; in the first block the code does not converge properly.

I verified that all equations at each point in time hold, so it seems that what dynare finds is the correct deterministic simulation from one steady state to the other.
Jeff
 
Posts: 4
Joined: Mon Nov 10, 2014 3:21 am

Re: Deterministic Simulation - Steady State function

Postby jpfeifer » Wed Nov 12, 2014 8:26 pm

I was only worried that your simulation starts from the wrong point. But if you say it worked as expected that is fine with me.
------------
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: Deterministic Simulation - Steady State function

Postby Jeff » Tue Nov 18, 2014 4:11 pm

Hi jpfeifer,

would it be possible to use the same "trick" you suggested before when the deterministic simulation is performed under histval?
I was trying to find where dynare stores the initial states from where to start the simulation, but with no success.

Could you please tell me where to look to find what is the name of the vector of the states I need to fill to perform the simulation with histval.

Thanks in advance for your time.
Jeff
 
Posts: 4
Joined: Mon Nov 10, 2014 3:21 am

Re: Deterministic Simulation - Steady State function

Postby jpfeifer » Sat Nov 22, 2014 8:58 am

In Dynare 4.4.3, you need to set M_.endo_histval
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests