Page 1 of 1

Resid problem. Dynare can't find ss

PostPosted: Thu Dec 10, 2015 11:52 am
by leonard007
Hello every one,
I Have a financial model that I have simplified it to analyse some effects. It is very simple model and I provide external m file to find steady state. When I use external steady state file with the format : filename_steadystate.m , dynare gets an error :

Error using print_info (line 72)
The steadystate file did not compute the steady state.

and I have very small res : like Equation number 9 : 3.2628e-06 for just two variables.

when I remove steady state file and use intval with the values calculated by my external file with "steady(solve_algo = 1)", I have the same problem, but with "steady(solve_algo = 2);" or commenting out "steady" dynare can find the steady state.
Because I would like to make a loop for parameter "theta" with "set_param_value('theta',i);", in the second case I have steady state problem, so It seems I have to use external file to find steady state!
I could not find where is the problem, and why dynare gets error for the tiny residual like -1.4996e-05.
I put the mod file and external steady state here. It is appreciated if you reply at your earliest convenience.
Sincerely,

Re: Resid problem. Dynare can't find ss

PostPosted: Sun Dec 13, 2015 12:22 pm
by leonard007
Dear Prof. jpfeifer,
Would you please help me with this issue! I really stuck a the moment! and I cannot go far!
Sincerely,

Re: Resid problem. Dynare can't find ss

PostPosted: Sun Dec 13, 2015 2:43 pm
by jpfeifer
I don't understand the problem. Why don't you use the unstable version with
Code: Select all
steady(solve_algo = 4,maxit=1000);

That easily works with your file. Using a steady state file to use a numerical solver seems like an overkill. But if you want to got his route, the solution is to increase the precision of your solver by using
Code: Select all
options=optimset('TolFun',1e-12);
[V,fval]=fsolve(@(x) MN1(x(1),x(2)) ,[1,100],options);

Re: Resid problem. Dynare can't find ss

PostPosted: Tue Dec 15, 2015 5:12 pm
by leonard007
Dear Prof. jpfeifer,
Thank you very much. it solved the problem.

Re: Resid problem. Dynare can't find ss

PostPosted: Wed Dec 16, 2015 10:01 am
by leonard007
Dear Professor jpfeifer,
In order to solve the previous problem, I got an error: I would like to see how the model changes with changing in "x", so I have added the last part "set_param". when I comment out it and manually change "x"value, dynare works well, but when I use "set_param_value" , dynare tells me it cannot find the steady state. May I ask you what is the problem, and how I could get rid of? It seems when the new variable value is set , for the second stoc_simul, Dynare doesn't use steady state file or the steady state file can't get the new value!
Sincerely,

Re: Resid problem. Dynare can't find ss

PostPosted: Sat Dec 19, 2015 12:43 pm
by jpfeifer
That is a clear sign you do not take all parameter dependencies into account. You vary x, but you only once set
Code: Select all
d=(1-sigmaa)*(1-x);

before the model block. That will not work.