My model has 68 very non-linear and complicated equations. And also I need to calibrate some parameters such that some ratios and ss values are fixed. I’ve been trying to solve it analytically but it has been very cumbersome, I’ve tried debugging but I seem not going anywhere concrete. Then I’m considering using numeric solver and I don’t really have a very good initial guess, and also I’m not sure which could be more suited, as Dynare offer various options as stated in the manual, or MATLAB’s one (in which probably Dynare’s is based on, I don’t really know). Some advice in how should I proceed in such situation would be very appreciated.

Thanks!

For such models, the way to go is a mixture. You reduce the problem to at most a handful of equations solved numerically (e.g. a nonlinear function of labor) and the rest is computed analytically.

1 Like

Hi Prof. Pfeifer. I’m trying to find the steady state as you say, finding analytic ss of as much variables as I can. Then, I solve the nonlinear equations using matlab’s fsolve() function, but I’m unable to get a solution.

(I’m rewriting this post since I realized I was being a little to general). Thinking a bit more in my problem, maybe what I need is some more knowledge in how to get well the algorithms for solving the system. Then I splitted my main problem in two subproblems: 1) How to get good initial guesses; and 2) Which algorithm would work for my problem best.

Then I was wondering if maybe you may help me with some literature or reference of any kind on how can I get good initial guess values for my solver. And in the second point, I’m not really sure what could I do, but seems like using some kind of “homotopy” implementation (which for what I can tell is divide and conquer type algorithms, following Dynare’s manual) may be helpful, then may you recommend me some example or literature on that too?

Thanks!!

Where do you fail in obtaining a solution? When calling fsolve on a reduced system?

1 Like

Indeed, I fail when calling fsolve for solving a solution to the reduced static system. In a nutshell, when I run numeric solver fsolve(), since I don’t have any good initial guess values, I set all of them to 1, then the solver takes huge amounts of time to get close to an accurate solution (i.e. f(x) starts reducing to around 0.002, but from there improvements are very marginal). From this point either I exhaust maximum number of function evaluations (or iterations), or if I set those high (i.e. 1e7) program advances but takes too long and never actually seems to get to anything.

Given that, I augmented my error tolerance considerably, in order to at least have some insight on where the solver is going, what I get is the solver prompting that the equation was solved with inaccuracies (due to high tolerance, i.e. 1e-3), but the inaccurate solution vector I get is non-real (non-zero imaginary part)! From which point I don’t really know what to do, my first thought is I should get “good” initial guess values, but don’t know how to.

Also, I’ve been recommended instead of solving the system, I may try minimizing the squared norm of the system with fmincon(). I’ll be trying that.

Typically, this is a sign of a deeper underlying problem in the steady state equations. Which features of your model cause the problem to be nonsolvable analytically?

1 Like

High degree of non-linearities have three main sources:

1. Jaimovich-Rebelo preferences.

2. SGU-type transaction costs.

3. Labor search frictions with intensive and extensive margin (e.g. wages, labor, values for firms and households are involved with probabilities derived from matching function that are non-linear).

For example taking into account 2) and 3), my resource constraint looks like this:

\begin{matrix}y_t=c_t\left(1+A\left(\frac{c_t}{LGF_t}\right)+B\left(\frac{LGF_t}{c_t}\right)-2\sqrt{AB}\right)+I_t\left(1+A\left(\frac{I_t}{LGF_t}\right)+B\left(\frac{LGF_t}{I_t}\right)-2\sqrt{AB}\right)+\\ \xi_{1}\left(\frac{u_t}{vac_{1,t}}\right)^{\varphi}+\xi_{2}\left(\frac{u_t}{vac_{2,t}}\right)^{\varphi}\end{matrix}

Where LGF_t = m_{1,t}^{\theta}+m_{2,t}^{\theta}, and both m are two types of money, u_t is unemployment, vac_{i,t} are vacancies, where there are two types of labor (i\in{1,2}), c_t consumption, I_t investment, and the rest parameters. It seems a little too complicated (and maybe it is), but I simplified as much as possible and these are the essential features that I want my model to feature, for example y_t is just a Cobb-Douglas that uses capital and a CES-aggregator of the two types of labor.

Also for example, the two types of money together with the LGF_t function allow for closed form expressions between them and their respective FOC, the non-closed form part would become from the showed resource constraint. Besides, for example investment has also closed form expressión depending only on \delta k_t as usual, but for consumption it’s more tricky since it appears in firms and HHs values, FOCs in the non-linear fashion of Jaimovich-Rebelo preferences.

Actually, I know that the model without transaction costs has a steady state, in fact initially this is the model I’m trying to find the ss by myself, since so far I failed to do so with my own model (which includes the TC). The strategy I’m following is find successfully a steady state for the simpler model (which has a ss), and then try to extrapolate that method to my bigger model. Then for keeping things in the main line that I’m working on, this resource constraint would be more informative (just removing TC):

y_t=c_t+I_t+\xi_{1}\left(\frac{u_t}{vac_{1,t}}\right)^{\varphi}+\xi_{2}\left(\frac{u_t}{vac_{2,t}}\right)^{\varphi}

Which is the one I’m currently struggling altogether with the 1) and 3) sources of nonlineatities.

Have you tried providing the steady state of the simpler model without these complicated features as starting values? Jaimovich-Rebelo preferences for example nest KPR preferences.

Also, does a simpler model work? That would decrease the likelihood of there being mistakes in these parts of the model that are common to both.

1 Like

Not yet, I’ll be trying that soon (simplify the model even further and use these ss values as initial guesses). Referring to the second point, I’m assessing that, not really sure, but I’ll try to exhaust everything at my hand on that model for the moment.