Hello, everyone on the Dynare Forum,
I am an undergraduate student currently studying DSGE models. Until recently, I had only worked with linear models, but I have just started to explore nonlinear models. Right now, I am trying to replicate the model from “Introducing Financial Frictions and Unemployment into a Small Open Economy Model,” and I have finished writing my code for it.
I attempted to use Dynare’s built-in solver to find the steady state solutions. However, I ran into problems because several variables were initialized to zero. Below is the output from model_diagnostics;:
dynare_solve: starting value results in nonfinite/NaN value. Randomize initial guess…
Nonlinear solver routine returned errorcode=-10.
STEADY: The Jacobian at the initial values contains Inf or NaN. The problem arises from:
Derivative of Equation 61 with respect to Variable h (initial value of h: 3.4523)
Derivative of Equation 58 with respect to Variable H (initial value of H: 3.4523)
Derivative of Equation 46 with respect to Variable pitildaw (initial value of pitildaw: 1.0078)
Derivative of Equation 47 with respect to Variable pitildaw (initial value of pitildaw: 1.0078)
Derivative of Equation 48 with respect to Variable pitildaw (initial value of pitildaw: 1.0078)
Derivative of Equation 49 with respect to Variable pitildaw (initial value of pitildaw: 1.0078)
Derivative of Equation 46 with respect to Variable wO (initial value of wO: 1)
Derivative of Equation 47 with respect to Variable wO (initial value of wO: 1)
Derivative of Equation 49 with respect to Variable wO (initial value of wO: 1)
Derivative of Equation 58 with respect to Variable wO (initial value of wO: 1)
Derivative of Equation 61 with respect to Variable wO (initial value of wO: 1)
Derivative of Equation 46 with respect to Variable piw (initial value of piw: 1)
Derivative of Equation 47 with respect to Variable piw (initial value of piw: 1)
Derivative of Equation 48 with respect to Variable piw (initial value of piw: 1)
Derivative of Equation 49 with respect to Variable piw (initial value of piw: 1)
STEADY: The problem most often occurs, because a variable with
STEADY: exponent smaller than 1 has been initialized to 0. Taking the derivative
STEADY: and evaluating it at the steady state then results in a division by 0.
STEADY: If you are using model-local variables (# operator), check their values as well.
STEADY: numerical initial values or parameters incompatible with the following equations
58
Please check for example
i) if all parameters occurring in these equations are defined
ii) that no division by an endogenous variable initialized to 0 occurs
MODEL_DIAGNOSTICS: The steady state cannot be computed
I would like to ask for advice on how to address this issue. I plan to use the parameter estimates from the paper as my initial parameter values. As for the variables, I am considering solving the steady state equations using MATLAB’s fsolve
first, then supplying those solutions in the initval
block. I am wondering if this is a suitable approach when dealing with a nonlinear DSGE model.
I have attached my code and the paper I consulted.
Introducing financial frictions and unemployment into a small open economy model.pdf (2.3 MB)
CTW2011.mod (18.8 KB)
Ch_Latex.mod (12.9 KB)
Ch_Latex.mod is the one which contains model_dignostics; command.
Thank you for your help.