preprocessor issueshttps://git.dynare.org/Dynare/preprocessor/-/issues2024-02-16T09:34:53Zhttps://git.dynare.org/Dynare/preprocessor/-/issues/126Change default filename created by savemacro option2024-02-16T09:34:53ZJohannes PfeiferChange default filename created by savemacro optionThe `savemacro` command line option appends `-macroexp`. It should be `_macroexp` because a hyphen is not allowed in Matlab file names. Consequently, running the generated file will result in
>Error using dynare
Dynare: argument of dyna...The `savemacro` command line option appends `-macroexp`. It should be `_macroexp` because a hyphen is not allowed in Matlab file names. Consequently, running the generated file will result in
>Error using dynare
Dynare: argument of dynare must conform to MATLAB's convention for naming functions, i.e. start with a letter and not contain
special characters. Please rename your .mod file.7.xhttps://git.dynare.org/Dynare/preprocessor/-/issues/125Automatically create equation name tags for auxiliary equations2024-02-07T12:24:57ZJohannes PfeiferAutomatically create equation name tags for auxiliary equationsBy default, Dynare creates equation name tags for the original equations of the `model` block. For example, if
```
rn = r + rho*(rn(-1)-r) + e;
```
then `M_.equation_tags` will be
```
{[7]} {'name'} {'rn'}
```
But nothing is c...By default, Dynare creates equation name tags for the original equations of the `model` block. For example, if
```
rn = r + rho*(rn(-1)-r) + e;
```
then `M_.equation_tags` will be
```
{[7]} {'name'} {'rn'}
```
But nothing is created for auxiliary equations. We should at least change this for `ramsey_model` where the first equations will correspond to the derivatives with respect to the endogenous variables. For example, if `M_.endo_names{1}='y'`, then `M_.equation_tags` should have as its first entry:
```
{[1]} {'name'} {'Ramsey FOC wrt y'}
```7.xhttps://git.dynare.org/Dynare/preprocessor/-/issues/100A *.mod file that only computes the steady state triggers computation of 2nd ...2023-12-06T08:50:05ZMichelJuillardA *.mod file that only computes the steady state triggers computation of 2nd order derivativesIf a *.mod file only computes the steady state of the model, the preprocessor computes first and second order derivatives. However, the second order derivatives will not be used.
This only matters for very large models.If a *.mod file only computes the steady state of the model, the preprocessor computes first and second order derivatives. However, the second order derivatives will not be used.
This only matters for very large models.https://git.dynare.org/Dynare/preprocessor/-/issues/121Allow requesting derivatives of dynamic model at command line2023-12-06T08:50:04ZJohannes PfeiferAllow requesting derivatives of dynamic model at command lineThe manual states:
```
output=second|third
Instructs the preprocessor to output derivatives of the dynamic model at least up to the given
order
```
However, the attached mod-file does not run despite containing
```
//--+ options: output=...The manual states:
```
output=second|third
Instructs the preprocessor to output derivatives of the dynamic model at least up to the given
order
```
However, the attached mod-file does not run despite containing
```
//--+ options: output=third, stochastic +--.
```
due to
```
The derivatives were not computed for the required order. Make sure that you used the right order option inside the `stoch_simul' command
Error using print_info
k_order_pert was unable to compute the solution
```
[example3.mod](/uploads/6ea1fa9de7e53b41d8803975ca98a4e1/example3.mod)https://git.dynare.org/Dynare/preprocessor/-/issues/123Factorize dynamic_params_derivs.m file2023-11-22T00:19:09ZJohannes PfeiferFactorize dynamic_params_derivs.m fileI central bank model with about 500 equations resulted in a `dynamic_params_derivs` with about 200MB size. Starting in Matlab 2019b, program files larger than approximately 128 MB do not run anymore (https://de.mathworks.com/matlabcentra...I central bank model with about 500 equations resulted in a `dynamic_params_derivs` with about 200MB size. Starting in Matlab 2019b, program files larger than approximately 128 MB do not run anymore (https://de.mathworks.com/matlabcentral/answers/497231-error-file-is-too-large-for-matlab-to-run). We should follow the logic of the other `_dynamic` files and split temporary terms, `rp, gp, rpp, gpp, hp, g3p` in different functions computing them.https://git.dynare.org/Dynare/preprocessor/-/issues/122Only create one auxiliary variable for leads/lags of exogenous2023-11-17T13:46:05ZJohannes PfeiferOnly create one auxiliary variable for leads/lags of exogenousCurrently, when an exogenous appears with both leads and lags, two auxiliaries are created with lag and lead 0, which are actually identical. That leads to one more endogenous equation than is necessary. We should have something like `AU...Currently, when an exogenous appears with both leads and lags, two auxiliaries are created with lag and lead 0, which are actually identical. That leads to one more endogenous equation than is necessary. We should have something like `AUX_EXO_CONTEMPORANEOUS`.
[ramst.mod](/uploads/0b1823475e7137a08610a1008241febe/ramst.mod)https://git.dynare.org/Dynare/preprocessor/-/issues/79Create dname preprocessor command to set M_.dname2023-10-02T15:47:28ZJohannes PfeiferCreate dname preprocessor command to set M_.dnameThis allows writing the `JSON` files to that folder as well. See https://git.dynare.org/Dynare/dynare/-/issues/1758This allows writing the `JSON` files to that folder as well. See https://git.dynare.org/Dynare/dynare/-/issues/1758https://git.dynare.org/Dynare/preprocessor/-/issues/87Create command line option to disable preprocessor simplifications2023-10-02T15:47:10ZJohannes PfeiferCreate command line option to disable preprocessor simplificationsThis may aid debugging strange issues like https://git.dynare.org/Dynare/preprocessor/-/issues/83 or https://git.dynare.org/Dynare/preprocessor/-/issues/66This may aid debugging strange issues like https://git.dynare.org/Dynare/preprocessor/-/issues/83 or https://git.dynare.org/Dynare/preprocessor/-/issues/66https://git.dynare.org/Dynare/preprocessor/-/issues/78Improving Ramsey computations: allow estimating discount factor2023-10-02T15:43:30ZMichelJuillardImproving Ramsey computations: allow estimating discount factorAdd the possibility to use one of the parameters of the model as the planner_discount factorAdd the possibility to use one of the parameters of the model as the planner_discount factorhttps://git.dynare.org/Dynare/preprocessor/-/issues/71Occbin: linearize nonlinear constraints2023-10-02T15:42:03ZJohannes PfeiferOccbin: linearize nonlinear constraintsFor consistency with the piecewise linear solution, the constraints should also be linear when we evaluate them. We should have the preprocessor linearize the constraint automatically. Currently, it's up to the user to make sure everythi...For consistency with the piecewise linear solution, the constraints should also be linear when we evaluate them. We should have the preprocessor linearize the constraint automatically. Currently, it's up to the user to make sure everything is consistent.https://git.dynare.org/Dynare/preprocessor/-/issues/73rewrite getPowerDeriv assignments in temporary terms2023-10-02T15:41:42ZSébastien Villemotrewrite getPowerDeriv assignments in temporary termsFrom Stephane:
In models with power functions of the form x**a (utility functions, production functions, agregation functions, quadratic costs, ...) the evaluation of the jacobian matrix (or higher order derivates) n...From Stephane:
In models with power functions of the form x**a (utility functions, production functions, agregation functions, quadratic costs, ...) the evaluation of the jacobian matrix (or higher order derivates) necessitate potentially a huge number of calls to the routine getPowerDeriv (the name of the routine is explicit enough). In my example (a real business cycle model with perfect foresight) most of the time is spent in this routine, while, if my understanding is correct, this is not necessary because x>0.
I wrote a mex file (see the new branch called mex-!GetPowerDeriv) as a replacement for the matlab routine, unfortunatly the overhead cost is so high that the use of the mex file increases the total time of execution!
In my case I resolved the issue by using option use_dll, but this is not a solution for the majority of our users (they would have to install cygwin/gcc and configure matlab/mex). So my question is: Do we really need to call this routine in all situations ? Would it not be possible to replace calls to this routine by something like:
if (abs(x)>1e-12)
tmp = ANALYTICAL_EXPRESSION_OF_THE_DERIVATIVEx,params;
else
tmp = 0;
endhttps://git.dynare.org/Dynare/preprocessor/-/issues/92Fix preprocessor simplification on attached mod-file2023-09-28T13:34:46ZJohannes PfeiferFix preprocessor simplification on attached mod-fileThe message is
> ERROR: Division by zero!
> terminate called after throwing an instance of 'DataTree::DivisionByZeroException'
despite no variable being 0. My guess is that the exogenous variables are presumed to be 0, but that is onl...The message is
> ERROR: Division by zero!
> terminate called after throwing an instance of 'DataTree::DivisionByZeroException'
despite no variable being 0. My guess is that the exogenous variables are presumed to be 0, but that is only the case for stochastic simulations.
[two_sector_vcu_binding.mod](/uploads/588eb002054f40017fc13ffe521005c6/two_sector_vcu_binding.mod)https://git.dynare.org/Dynare/preprocessor/-/issues/48Provide a debug mode that gives information about the objects computed in sta...2023-09-27T15:32:44ZSébastien VillemotProvide a debug mode that gives information about the objects computed in static and dynamic filesFor each object in the `static` or `dynamic` file, this mode could add:
- the equation number
- for derivatives, the (possibly dynamic) variable(s) against which the derivative is taken
- the human-readable form of the expression (with r...For each object in the `static` or `dynamic` file, this mode could add:
- the equation number
- for derivatives, the (possibly dynamic) variable(s) against which the derivative is taken
- the human-readable form of the expression (with readable variable names, without temporary terms)
This should also be done for block decomposition mode (in particular, the renormalized equations could be an additional information).7.xhttps://git.dynare.org/Dynare/preprocessor/-/issues/120Initialize not computed derivative matrices with NaN instead of zero2023-09-11T09:10:59ZJohannes PfeiferInitialize not computed derivative matrices with NaN instead of zeroWe have for example
```
if (mod_file_struct.identification_present
|| mod_file_struct.estimation_analytic_derivation
|| (mod_file_struct.GMM_present && (mod_file_struct.analytic_standard_errors_pres...We have for example
```
if (mod_file_struct.identification_present
|| mod_file_struct.estimation_analytic_derivation
|| (mod_file_struct.GMM_present && (mod_file_struct.analytic_standard_errors_present || mod_file_struct.analytic_jacobian_present)))
paramsDerivsOrder = params_derivs_order;
```
Hence, `dynamic_params_derivs.m` returns zero matrices if no command like `identification` is present. It is dangerous to return a wrong result with conformable dimensions because users can call the correct functions to get the parameter derivatives, but the results will not make sense because everything was zero. We should initialize with NaN. The same may be present with derivatives with respect to endogenous variables.https://git.dynare.org/Dynare/preprocessor/-/issues/119Create interface for specifying filtering transformation of data2023-09-08T10:08:36ZJohannes PfeiferCreate interface for specifying filtering transformation of dataDecision at Advanced User Meeting 2023:
```
varobs(hp_filter=1600) y;
varobs(one_sided_hp_filter=1600) c;
varobs(bandpass_filter=[2 16]) R;
```
where the three options are the filters currently allowed for `stoch_simul`. Write the result...Decision at Advanced User Meeting 2023:
```
varobs(hp_filter=1600) y;
varobs(one_sided_hp_filter=1600) c;
varobs(bandpass_filter=[2 16]) R;
```
where the three options are the filters currently allowed for `stoch_simul`. Write the result into `3 by 1` cell array `options_.varobs_transformation` where column 1 corresponds to `options_.varobs_id`, column 2 is a string of the filter name, column 3 is the specified parameter value (empty if the default is chosen).https://git.dynare.org/Dynare/preprocessor/-/issues/118Enforce proper block commenting2023-09-07T16:39:17ZJohannes PfeiferEnforce proper block commentingIf possible, check that the each opening `/*` is closed by `*/` and that the first comment is not `*/`.
See https://forum.dynare.org/t/dynare-code-problem/23085If possible, check that the each opening `/*` is closed by `*/` and that the first comment is not `*/`.
See https://forum.dynare.org/t/dynare-code-problem/23085https://git.dynare.org/Dynare/preprocessor/-/issues/114Inconsistent option checks in the new prior interface2023-03-17T08:51:12ZMichelJuillardInconsistent option checks in the new prior interface1) In the preprocessor, ComputingTasks.cc, BasicPriorStatement::checkPass requires that either mean or mode and either stdev or variance be present in the prior declaration. But for uniform distribution, one declares usually domain inste...1) In the preprocessor, ComputingTasks.cc, BasicPriorStatement::checkPass requires that either mean or mode and either stdev or variance be present in the prior declaration. But for uniform distribution, one declares usually domain instead of mean and variance.
2) It is possible to pass Inf for prior variance but not for stdev because the variance option supports an expression but no other prior options support expressionshttps://git.dynare.org/Dynare/preprocessor/-/issues/112Check variable counting if variables appear in multiple PAC models2022-12-19T14:16:49ZJohannes PfeiferCheck variable counting if variables appear in multiple PAC modelsSee https://forum.dynare.org/t/multiple-pac-equations-and-satellite-var-models-in-a-single-mod-file/21635
[block_agg.mod](/uploads/82c57104381679043ea08a3db55fa14e/block_agg.mod)See https://forum.dynare.org/t/multiple-pac-equations-and-satellite-var-models-in-a-single-mod-file/21635
[block_agg.mod](/uploads/82c57104381679043ea08a3db55fa14e/block_agg.mod)https://git.dynare.org/Dynare/preprocessor/-/issues/98block: improve error messages2022-09-15T09:18:55ZJohannes Pfeiferblock: improve error messages[NKM_algo.mod](/uploads/49bc9672fb709e4e46290d1bccf42327/NKM_algo.mod) will return a cryptic
```
Error using print_info (line 32)
The solution to the static equations is not a steady state of the dynamic model: verify that the equations...[NKM_algo.mod](/uploads/49bc9672fb709e4e46290d1bccf42327/NKM_algo.mod) will return a cryptic
```
Error using print_info (line 32)
The solution to the static equations is not a steady state of the dynamic model: verify that the equations tagged by
[static] and [dynamic] are consistent
```
It seems that the presence of Occbin-tags throws off the algorithm. The solution may simply be to error out if Occbin is used with `block`.https://git.dynare.org/Dynare/preprocessor/-/issues/75add maximum lag info by variable2022-09-13T15:49:42ZHoutan Bastaniadd maximum lag info by variable```
M_.maximum_endo_lag_by_var = [ ... ];
M_.maximum_exo_lag_by_var = [ ... ];
```
Where the vectors are the length of `M_.orig_endo_nbr````
M_.maximum_endo_lag_by_var = [ ... ];
M_.maximum_exo_lag_by_var = [ ... ];
```
Where the vectors are the length of `M_.orig_endo_nbr`