Page 1 of 1
steady-state auxiliary code when log-linearizing
Posted:
Thu Apr 03, 2008 3:13 pm
by measilva
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
Posted:
Fri Apr 04, 2008 7:22 am
by reubenpjacob
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
Posted:
Fri Apr 04, 2008 6:14 pm
by measilva
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
Posted:
Mon Apr 07, 2008 7:55 am
by pburriel
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
Posted:
Wed Apr 09, 2008 9:17 pm
by measilva
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
Posted:
Thu Apr 10, 2008 5:56 am
by ripatti
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
Posted:
Sun Apr 13, 2008 11:44 pm
by sebastienmcmahon
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!
Posted:
Mon Apr 14, 2008 2:26 pm
by pburriel
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