Hi,
me again. Since the hessian (from second order approximation) already provides the derivatives of the jacobian w.r.t. endogenous variables, we should be able to get somehow dGams/dYss (Gams are the gamma matrices of the jacobian). To get the missing bit, we need to compute (dGams/dYss)*(dYss/dtheta) which will be simply summed to the derivatives already available in MODEL_params_derivs.m.
So, we need dYss/dtheta. Given F the static model equations we can write the implicit derivation
dYss/dtheta = -(dF/dYss) \ (dF/dtheta)
where dF/dYss is simply obtained from the jacobian of the static model (g1 output argument of the MODEL_static.m routine).
So, the only 'new' thing from the preprocessor that we would need are the derivatives of the model equations w.r.t. parameters, i.e. dF/dtheta.
Am I right?
thanks a lot for your help best wishes Marco
Marco Ratto wrote:
Dear Michel and Sebastien,
working on the model derivatives w.r.t. parameters I noted that we are missing one aspect of the story. In the current state, model derivatives are only correct for parameters which do not affect the steady state of the model.
In general we have a non-linear model. So, the Jacobian is also a function of the steady state of the model which, in turn, is also a function of the model parameters.
So, when calling the MODEL_params_derivs.m routine, we need to provide both the steady state vector "y" AND the derivative of the steady state w.r.t. to deep parameters "dy", i.e. a modified call like:
gp = MODEL_arams_derivs(y, dy, x, params, it_).
Now, "dy" has to be given either analytically by the modeller, if this is available, or by some numerical or implicit derivation procedure from the 'static' model definition.
Given this information, the most general form of the MODEL_params_derivs.m should include this "dy" information.
What do you think ? best wishes Marco