steady-state auxiliary code when log-linearizing

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.

steady-state auxiliary code when log-linearizing

Postby measilva » Thu Apr 03, 2008 3:13 pm

hey all,

I have a question. I have written my model in log-linear form in the .mod file and I was wondering how should I write the _steadystate.m file in Matlab.

I have written the auxiliary code for the model in levels, and when I run the model in levels, Dynare works fine (all the equations are zero when I use resid(1)).
However when I run the model in logs, using the same code, some equations are non-zero. Then I wrote the _steadystate file in logs, but it seems that Dynare does not accept that.

Does anyone know how to write the steady-state auxiliary code in Matlab when the model is expressed in logs?

thanks a lot
Marcelo
University of North Carolina
measilva
 
Posts: 31
Joined: Wed Mar 05, 2008 3:47 pm
Location: University of North Carolina

Postby reubenpjacob » Fri Apr 04, 2008 7:22 am

my understanding is that once log-linearized, the steady state of the model is zero. so you dont need to write a separate steady state file.

reuben
reubenpjacob
 
Posts: 133
Joined: Fri Oct 06, 2006 3:23 pm
Location: Reserve Bank of New Zealand

Postby measilva » Fri Apr 04, 2008 6:14 pm

Hey Reuben,

Thanks for your replay.

I know that once we write the model in log deviations of the steady state, in the "new steady state" the variables as log deviations should/must be zero. We agree on that.

My point is: I need or I want to tell Dynare around which steady state the log-linearization should occur, that's my question. I could find the steady-state values by hand and put all of them in the initval block in Dynare, but what I want is to write my own steay-state code in Matlab and let dynare calls this function.

Basically I am following Barillas et al (2007) "Practicing Dynare" in their International business Cycle Model. The only difference is I want to write a matlab code for the steady-state.

Let me know your toughts about it.

Best
Marcelo
University of North Carolina
measilva
 
Posts: 31
Joined: Wed Mar 05, 2008 3:47 pm
Location: University of North Carolina

Postby pburriel » Mon Apr 07, 2008 7:55 am

Hi Marcelo,

What I have done is write a matlab file where I solve for the (non-linear) steady state of my model (using fsolve) which I call from the dynare file. Then, I use the steady state values either as parameters of the system of equations or for the initval.

If you want me to send you an example, just send me an email.

Pablo
pburriel
 
Posts: 23
Joined: Wed Jun 29, 2005 4:42 am

Postby measilva » Wed Apr 09, 2008 9:17 pm

Hey Pablo,

Thanks for your replay. I would appreciate if you could send your example. Particularly I am interested to know how you are calling the matlab function in Dynare.

Thanks
Marcelo
University of North Carolina
measilva
 
Posts: 31
Joined: Wed Mar 05, 2008 3:47 pm
Location: University of North Carolina

Postby ripatti » Thu Apr 10, 2008 5:56 am

One may call matlab functions and commands in Dynare simply as in matlab itself.

Pablo, can you plug this steady-state computation into estimation? I.e. if some estimated parameters affect the deterministic steady-state then the steady-state should be computed at each iteration of parameters. I guess, that dynare wants to use the steady-state of the (log-)linearized model, which is NOT the one we would like to use.

Regards,
Antti
ripatti
 
Posts: 59
Joined: Mon Jan 16, 2006 6:28 am
Location: Helsinki

Postby sebastienmcmahon » Sun Apr 13, 2008 11:44 pm

pburriel wrote:Hi Marcelo,

What I have done is write a matlab file where I solve for the (non-linear) steady state of my model (using fsolve) which I call from the dynare file. Then, I use the steady state values either as parameters of the system of equations or for the initval.

If you want me to send you an example, just send me an email.

Pablo


Hi

I would also be really interested in getting your example. I have been pondering for some time on how to do exactly this. Could you post the file here please?

I would also, like mr Ripatti, use this procedure in estimation.

Thanks!
sebastienmcmahon
 
Posts: 7
Joined: Sun Apr 13, 2008 6:32 pm

Postby pburriel » Mon Apr 14, 2008 2:26 pm

Hi,

Find attached zip file with the all the files needed to run an example with the code of how I do it. I think this way dynare takes the ss into account when estimating.

The idea is that I solve the steady state right before I declare the model and then I use this result to calibrate the parameters (which depend on ss values).

Then I define the variables in the model as deviation from ss:
x-x_ss, where x_ss is the steady state value I have just obtained.

I would like to emphasize that this code is only an example of an old model, I am not sure the model equations or solution is correct, but it runs. Only pay attention to the way the ss is solved.

Hope this is helpful.

Pablo
Attachments
example_v3.zip
(5.89 KiB) Downloaded 228 times
pburriel
 
Posts: 23
Joined: Wed Jun 29, 2005 4:42 am


Return to Dynare help

Who is online

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