Resid problem. Dynare can't find ss

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Resid problem. Dynare can't find ss

Postby leonard007 » Thu Dec 10, 2015 11:52 am

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,
Attachments
nonline_stoc_6_steadystate.m
steady state external file
(2.25 KiB) Downloaded 182 times
nonline_stoc_6.mod
(1.24 KiB) Downloaded 182 times
leonard007
 
Posts: 54
Joined: Tue May 26, 2015 12:30 pm

Re: Resid problem. Dynare can't find ss

Postby leonard007 » Sun Dec 13, 2015 12:22 pm

Dear Prof. jpfeifer,
Would you please help me with this issue! I really stuck a the moment! and I cannot go far!
Sincerely,
leonard007
 
Posts: 54
Joined: Tue May 26, 2015 12:30 pm

Re: Resid problem. Dynare can't find ss

Postby jpfeifer » Sun Dec 13, 2015 2:43 pm

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);
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Resid problem. Dynare can't find ss

Postby leonard007 » Tue Dec 15, 2015 5:12 pm

Dear Prof. jpfeifer,
Thank you very much. it solved the problem.
leonard007
 
Posts: 54
Joined: Tue May 26, 2015 12:30 pm

Re: Resid problem. Dynare can't find ss

Postby leonard007 » Wed Dec 16, 2015 10:01 am

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,
Attachments
nonline_stoc_5_steadystate.m
steady state
(2.43 KiB) Downloaded 156 times
nonline_stoc_5.mod
mod file
(1.71 KiB) Downloaded 150 times
leonard007
 
Posts: 54
Joined: Tue May 26, 2015 12:30 pm

Re: Resid problem. Dynare can't find ss

Postby jpfeifer » Sat Dec 19, 2015 12:43 pm

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 1 guest