I’m doing a simple exercise of calibrating numerically a parameter value. Concretely \theta (theta
), is the parameter that controls labor disutility (i.e. u=...-\theta \frac{n_t^{1+\xi}}{1+\xi}). I want to calibrate it such that in the steady state n=1. I’ve already did it analytically (keeping all other parameter values fixed), and found that the value 0.2184 sets accomplish ss target.
I designed a simple routine for calibrating theta
using Dynare’s numerical computation of the steady state, and MATLAB’s non-linear equation solver fsolver()
.
In a nutshell, my code: Having fixed parameter values except for theta
directly in the mod file. A MATLAB routine takes an initial value of theta=1
and then tries to solve a function l2_norm()
to zero. The function just computes the stochastic simulation (and thus the steady state) with the value of theta
provided, and then returns the difference between the target steady state value and the current steady state value (i.e. n_tgt - n_ss = n_tgt - 1
).
Nonetheless, the solver stops and displays:
No solution found.
fsolve stopped because the problem appears regular as measured by the gradient,
but the vector of function values is not near zero as measured by the
value of the function tolerance.
I’ve tried changing some of the TolX
and TolFun
parameters, but still unable to get the program to compute the calibrated value for theta
. Worth noting, when I use the analytically calibrated value (0.2184) as initial value, it gets computed correctly “at the initial point”, but if I change it a bit this value to e.g. 0.5 it becomes unable to solve it.
A guidance in what I’m doing wrong and what should I take care of when doing this sort of computation would be very appreciated. Since in a real life escenario I probably won’t have access to a very good approximation of what the parameter should be for using as initial value.
Thanks!!
calibration.m (2.6 KB)
num_cal.mod (9.4 KB)