Page 1 of 1

Solving for Steady State with an external matlab file

PostPosted: Wed Mar 13, 2013 4:33 am
by zsk3
Hi,

I can find the solution to the steady state of my model using two matlab files. Since my steady state equations are nonlinear, I'm using fsolve. fertility1_steadystate.m and steady_state.m codes work fine for finding the steady state solutions, however I couldn't find a way to make the .mod file get the results. I think Dynare has a problem on calling a function that depends on another function. What would you suggest me to do?

Thank you for your concern.

Re: Solving for Steady State with an external matlab file

PostPosted: Wed Mar 13, 2013 7:39 am
by jpfeifer
Write and use a correct steady state file, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=1834

Re: Solving for Steady State with an external matlab file

PostPosted: Wed Mar 13, 2013 8:57 pm
by zsk3
Hi,

Thank you for your prompt reply. I studied over the steadystate files in the link. I realized that in the steady state equations, each variable is defined in terms of the variables defined before. Therefore the equations are simple enough. In my model, at least three variables are defined with equations that are highly nonlinear, so it is not possible for me to write an equation for each variable one at a time. This is why I solved for the steady state using an external matlab code. Does Dynare offer any solutions for complex steady states?

Thanks a lot.

Re: Solving for Steady State with an external matlab file

PostPosted: Wed Mar 13, 2013 9:26 pm
by jpfeifer
The SS-file passes the parameters from Dynare to your code and then back to Dynare. Within the block given by the SS-file you can execute any code in whatever order you like as long as at the end of your computation all SS-values have have been set. You can easily call other functions like the one you wrote or numerical optimizers within your steady state file.