Dear Nikolay,
we have started to work on producing the derivatives with respect to parameters. We are planing to create a new function, that will return a 3-dimensional array, by equation, variable and parameter. You could then select one parameter and squeeze the array in the parameter dimension to obtain a matrix of Jacobian derivatives with respect to a given parameter. Do you see any problem with this implementation? We should be able to provide in about two weeks.
All the best,
Michel
Hi Michel,
thank you very much. I was also wandering if it would be possible to make a function that simply gives the linearized LRE model, i.e. the gamma0 gamma1, gamma2 etc. in Nikolai's notation.
I know e and d matrices are built in dr1, but something more easily accessible may be useful?
All the best Marco
Dear Nikolay,
we have started to work on producing the derivatives with respect to parameters. We are planing to create a new function, that will return a 3-dimensional array, by equation, variable and parameter. You could then select one parameter and squeeze the array in the parameter dimension to obtain a matrix of Jacobian derivatives with respect to a given parameter. Do you see any problem with this implementation? We should be able to provide in about two weeks.
All the best,
Michel
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
Hi everyone,
Michel Juillard michel.juillard@ens.fr a écrit :
we have started to work on producing the derivatives with respect to parameters. We are planing to create a new function, that will return a 3-dimensional array, by equation, variable and parameter. You could then select one parameter and squeeze the array in the parameter dimension to obtain a matrix of Jacobian derivatives with respect to a given parameter.
I have added the derivatives of the Jacobian w.r. to parameters. It is already available in the subversion, and will be in tomorrow's snapshot.
For the time being, you can activate the computation of those derivatives by adding a "identification;" line in your MOD file (we will later plug in identification routines behind this statement, when they are available).
This will create a new file called "basename_params_derivs.m" (assuming that your MOD file is "basename.mod").
This Matlab function takes the same arguments than "basename_dynamic.m"; it returns a 3D matrix, with the following conventions: - first index is equation number - second index is the column of the Jacobian which is derived - third index is the parameter index (as in M_.params)
Best,
This is great. Many thanks.
Michel
Sébastien Villemot wrote:
Hi everyone,
Michel Juillard michel.juillard@ens.fr a écrit :
we have started to work on producing the derivatives with respect to parameters. We are planing to create a new function, that will return a 3-dimensional array, by equation, variable and parameter. You could then select one parameter and squeeze the array in the parameter dimension to obtain a matrix of Jacobian derivatives with respect to a given parameter.
I have added the derivatives of the Jacobian w.r. to parameters. It is already available in the subversion, and will be in tomorrow's snapshot.
For the time being, you can activate the computation of those derivatives by adding a "identification;" line in your MOD file (we will later plug in identification routines behind this statement, when they are available).
This will create a new file called "basename_params_derivs.m" (assuming that your MOD file is "basename.mod").
This Matlab function takes the same arguments than "basename_dynamic.m"; it returns a 3D matrix, with the following conventions:
- first index is equation number
- second index is the column of the Jacobian which is derived
- third index is the parameter index (as in M_.params)
Best,
Many thanks! Marco
This is great. Many thanks.
Michel
Sébastien Villemot wrote:
Hi everyone,
Michel Juillard michel.juillard@ens.fr a écrit :
we have started to work on producing the derivatives with respect to parameters. We are planing to create a new function, that will return a 3-dimensional array, by equation, variable and parameter. You could then select one parameter and squeeze the array in the parameter dimension to obtain a matrix of Jacobian derivatives with respect to a given parameter.
I have added the derivatives of the Jacobian w.r. to parameters. It is already available in the subversion, and will be in tomorrow's snapshot.
For the time being, you can activate the computation of those derivatives by adding a "identification;" line in your MOD file (we will later plug in identification routines behind this statement, when they are available).
This will create a new file called "basename_params_derivs.m" (assuming that your MOD file is "basename.mod").
This Matlab function takes the same arguments than "basename_dynamic.m"; it returns a 3D matrix, with the following conventions:
- first index is equation number
- second index is the column of the Jacobian which is derived
- third index is the parameter index (as in M_.params)
Best,
Dev mailing list Dev@dynare.org http://www.dynare.org/cgi-bin/mailman/listinfo/dev
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
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