First time using fsolve
Posted: Sun Nov 01, 2015 1:56 pm
Dear all,
I´m new to dynare(and matlab) and i´m trying to calculate the steady state of my model. Since my model have a lot of nonlinear equations i want to solve for the steady state using an external matlab code(fsolve) to find the steady state of all the equilibrium equations of my model. My question is how should i input the equations in the .m steady state file so i can get the steady state of all variables using fsolve(i dont wanna write each variable in the .m file as defined in terms of the variables defined before, since the equations are highly nonlinear)?Basically, my question is how should i input all my model equilibrium equations in the steady state .m file?
I know i should rewrite all equations so they are in the form F(x) = 0. My questions are: what should i do with lagged variables and steady state terms? For example, please look at this equations:
1) k = i + ( 1 - delta)*k(-1); ** Should i put all variables in the steady state so k = k(-1) = k and rewrite all the other equations in this fashion?
Another problem is that some equations of my model have steady state terms(taylor rule and some shock equations):
2) ln(R/R_ss) = alfa_r* ln(R(-1)/R_ss) + (1 - alfa_r)*(alfa_pi*ln(Pi/Pi_ss) + alfa_y*ln(y/y_ss)) + e_r; **How should i rewrite this equation,so i can solve the steady state of my model using fsolve?
Thanks.
Adriano
I´m new to dynare(and matlab) and i´m trying to calculate the steady state of my model. Since my model have a lot of nonlinear equations i want to solve for the steady state using an external matlab code(fsolve) to find the steady state of all the equilibrium equations of my model. My question is how should i input the equations in the .m steady state file so i can get the steady state of all variables using fsolve(i dont wanna write each variable in the .m file as defined in terms of the variables defined before, since the equations are highly nonlinear)?Basically, my question is how should i input all my model equilibrium equations in the steady state .m file?
I know i should rewrite all equations so they are in the form F(x) = 0. My questions are: what should i do with lagged variables and steady state terms? For example, please look at this equations:
1) k = i + ( 1 - delta)*k(-1); ** Should i put all variables in the steady state so k = k(-1) = k and rewrite all the other equations in this fashion?
Another problem is that some equations of my model have steady state terms(taylor rule and some shock equations):
2) ln(R/R_ss) = alfa_r* ln(R(-1)/R_ss) + (1 - alfa_r)*(alfa_pi*ln(Pi/Pi_ss) + alfa_y*ln(y/y_ss)) + e_r; **How should i rewrite this equation,so i can solve the steady state of my model using fsolve?
Thanks.
Adriano