#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters --------------------------+------------------------------------------------- Reporter: sebastien | Owner: sebastien Type: enhancement | Status: new Priority: major | Milestone: 4.3 Component: Preprocessor | Version: Keywords: | --------------------------+------------------------------------------------- Currently the derivatives of STEADY_STATE operator wrt to parameters are not handled in an efficient way, because the preprocessor does not exploit the a priori information for identifying null derivatives. This results in huge files for not so complicated models, which cannot be exploited by identification routines.
The proposal is to implement an algorithm in the preprocessor for identifying null derivatives ex ante:
- Create a non-directed graph whose nodes are the endogenous variables and the parameters - For each pair of nodes, add an edge between the two if there is an equation in the static model containing both corresponding symbols (endogenous/parameters) - For each endogenous, its derivative wrt a parameter is always zero if there is no path between the node representing the endogenous and the node representing the parameter.
#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters ---------------------------+------------------------------------------------ Reporter: sebastien | Owner: sebastien Type: enhancement | Status: new Priority: major | Milestone: 4.3 Component: Preprocessor | Version: Resolution: | Keywords: ---------------------------+------------------------------------------------
Comment(by sebastien):
Request from Marco:
Another interesting would be to allow an optional syntax in the model definition which specifies the params with non-zero derivatives, e.g. for a variable Y be allowed to write:
{{{ STEADY_STATE(Y(alpha,beta)) }}}
which implies that all params except alpha and beta have zero derivatives.
#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters ---------------------------+------------------------------------------------ Reporter: sebastien | Owner: sebastien Type: enhancement | Status: new Priority: major | Milestone: 4.3 Component: Preprocessor | Version: Resolution: | Keywords: ---------------------------+------------------------------------------------
Comment(by michel):
Another approach would be to create a new matrix when the steady_state operator is used in a model: the Jacobian of the dynamic model with respect to the steady state of the endogenous variables. The total derivatives of the dynamic model with respect to the parameters would then be the product (to be computed in Matlab) of Jacobian of the dynamic model w.r. the steady state x Jacobian of steady state w.r. parameters (Jacobian of static model)
#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters ---------------------------+------------------------------------------------ Reporter: sebastien | Owner: houtanb Type: enhancement | Status: accepted Priority: major | Milestone: 4.3 Component: Preprocessor | Version: Resolution: | Keywords: ---------------------------+------------------------------------------------ Changes (by houtanb):
* owner: sebastien => houtanb * status: new => accepted
#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters --------------------------+------------------------------------------------- Reporter: sebastien | Owner: houtanb Type: enhancement | Status: accepted Priority: major | Milestone: 4.3 Component: Preprocessor | Version: Keywords: | --------------------------+-------------------------------------------------
Comment(by sebastien):
Note that temp. terms were not computed for 2nd deriv wrt params until commit bcc091a58d0ba87d03881541d8a5be363d19b8e6
This fix may change the situation.
#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters --------------------------+------------------------------------------------- Reporter: sebastien | Owner: houtanb Type: enhancement | Status: accepted Priority: major | Milestone: 4.3 Component: Preprocessor | Version: Keywords: | --------------------------+-------------------------------------------------
Comment(by ratto):
I tried that project which originated this ticket because the preprocessor created a params_derivs file of 1 GB. Now it makes it 50 MB, which is digestible for MATLAB, albeit not really easily editable. So, it seems that adding temporary terms is the major improvement that will make the guy run in most cases, at least except for very large models.
Still we have a very large file generated (with several minutes of pre- processing as well) which may be useless since 2nd order derivs are only used in special cases.
So, if you agree, I would still take into consideration the possibility to add the following two syntax options to identification and sensitivity (and possibly to estimation, given analytic scores and hessian will be available at some point):
1) param_deriv_order (= 1 default; 2 optional), that would skip the second order derivs if param_deriv_order<2: this would speed-up pre-processing and digestion of the program by MATLAB;
2) as envisaged some time ago, add an optional syntax to STEADY_STATE: STEADY_STATE(ENDO_NAME ( list of param_names) ) that explicitly lists the names of the parameters which affect the steady state of the variable ENDO_NAME. If the user would know such a restricted list, this would simplify a lot the params_derivs file. The latter in fact must now account for the fact that the steady state of any variable declared in STEADY_STATE(ENDO_NAME) may depend on any parameter including any cross- derivative. This implies a very long list of entries for the second order derivatives. With the new extended syntax, the pre-processor would only use the ss_param_deriv and ss_param_2nd_deriv entries which are known to be non-zero, skipping a very long list of temporary terms. Of course any error from the user in declaring the restricted list of parameters would not be tracked by the pre-processor.
#172: improve derivation engine for derivatives of STEADY_STATE wrt parameters --------------------------+------------------------------------------------- Reporter: sebastien | Owner: houtanb Type: enhancement | Status: accepted Priority: major | Milestone: 5.0 Component: Preprocessor | Version: Keywords: | --------------------------+------------------------------------------------- Changes (by houtanb):
* milestone: 4.3 => 5.0