Problem with convergence

Hi again,

Now that the code is properly working, I cannot seem to converge to a steady state. I tried using homotopy methods, but I obtain an error (below). Your suggestions have been very helpful last time, so I really appreciate anything that jumps out at you as being possibly wrong. The mod file is also attached.

HOMOTOPY mode 1: computing step 0/50…
??? Error using ==> lnsrch1 at 53
Some element of Newton direction isn’t finite. Jacobian
maybe singular or there is a problem with initial values

Error in ==> solve1 at 127

Error in ==> dynare_solve at 128
bad_cond_flag, varargin{:});

Error in ==> evaluate_steady_state at 66
[ys,check] = dynare_solve([M.fname

Error in ==> steady_ at 54
[steady_state,params,info] =
Error in ==> homotopy1 at 88
[steady_state,M.params,info] = steady_(M,options,oo);

Error in ==> steady at 49
[M_,oo_,info,ip,ix,ixd] =

Error in ==> planner_toy at 152

Error in ==> dynare at 120
evalin(‘base’,fname) ;
planner_toy.mod (2.14 KB)

Please try the recent snapshot. It will provide more explicit information. Moreover, put

before steady to see the residuals of the equations. Then use economic intuition to inform your steady state values. For example, typically K>Y>C>I, with Y in most models being somewhere around 1 and C then being around 0.8. Your starting values are really poor, particularly for equation 2 and 3. I might be that those equations still have a mistake.

That’s very helpful; normally I do not worry about initial conditions since for prior endeavors I have worked with much more well behaved functions.

I tried different initial conditions and the first three equations have residuals of infinity. Have you encountered such a problem before? One possibility is that the FOCs are improperly specified, but I have checked them twice; I will, nevertheless, check them a third time. Just for context, the “S” is environmental quality. This is a model I made that incorporates a CES between environmental quality, leisure, and consumption in preferences; firms use capital, labor (Cobb Douglas composite) and a CES between that composite and energy inputs.