Non-Linear Steady State
Posted: Wed Nov 23, 2016 8:16 am
Hi,
I am working on a non-linear open economy model and as is usual in these frameworks the solution to the terms of trade cannot be obtained analytically. I followed the guidance of matlab and can solve for the variables of interest using fsolve. However, I tried to incorpotate it into the mod file, but the steady_state_model block doesn't seem to recognise the command.
I attach my .m files that solve for the two relevant variables x(1) and x(2). The file nl_tot defines the function and the parameters, whereas nl_tot_sol obtains the solution. My question is - how do I incorporate these codes into a mod file? For example, if I just input the following:
then dynare crashes as it does not recognise neither "[" nor "@". Should I use another file with @# operator to solve it?
Many thanks.
I am working on a non-linear open economy model and as is usual in these frameworks the solution to the terms of trade cannot be obtained analytically. I followed the guidance of matlab and can solve for the variables of interest using fsolve. However, I tried to incorpotate it into the mod file, but the steady_state_model block doesn't seem to recognise the command.
I attach my .m files that solve for the two relevant variables x(1) and x(2). The file nl_tot defines the function and the parameters, whereas nl_tot_sol obtains the solution. My question is - how do I incorporate these codes into a mod file? For example, if I just input the following:
- Code: Select all
var ...
varexo ...
parameters ...
...
model; ...
steady_state_model;
...
x0=[1 1];
xis=fsolve(@nl_tot,x0);
...
etc.
then dynare crashes as it does not recognise neither "[" nor "@". Should I use another file with @# operator to solve it?
Many thanks.