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/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/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/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/102Fix treatment of redundant Lagrange multiplier2022-07-26T09:46:03ZJohannes PfeiferFix treatment of redundant Lagrange multiplierThe attached file contains a redundant equation `junk=junk` that results in Lagrange multiplier 19 not being present at all. That causes a crash in `stochastic_solvers` due to `M_.lead_lag_incidence` containing a column of zeros. In cont...The attached file contains a redundant equation `junk=junk` that results in Lagrange multiplier 19 not being present at all. That causes a crash in `stochastic_solvers` due to `M_.lead_lag_incidence` containing a column of zeros. In contrast to other cases, we do not provide a preprocessing error. For example
```
0*junk=0;
```
will result in
>Starting preprocessing of the model file ...
Error: junk not used in the model block
[Gali_2008_chapter_5_commitment.mod](/uploads/b595228fa77e2112a3b3dce37b75084a/Gali_2008_chapter_5_commitment.mod)https://git.dynare.org/Dynare/preprocessor/-/issues/101Correct logic of orig_eq_nbr2022-09-13T15:49:23ZJohannes PfeiferCorrect logic of orig_eq_nbr`discretionary_policy_initialization.m` uses
```
instr_nbr=M_.orig_endo_nbr-M_.orig_eq_nbr;
```
to check whether sufficient equations have been left out for instruments. But `M_.orig_endo_nbr` conforms to the originally declared endogen...`discretionary_policy_initialization.m` uses
```
instr_nbr=M_.orig_endo_nbr-M_.orig_eq_nbr;
```
to check whether sufficient equations have been left out for instruments. But `M_.orig_endo_nbr` conforms to the originally declared endogenous variables before creating any auxiliary variables. In contrast `M_.orig_eq_nbr` seems to refer to the number of equations before introducing Ramsey equations, but after substituting out other auxiliaries. `dyn_ramsey_static` avoids that issue by checking the number of auxiliary variables introduced before the first Lagrange multiplier:
```
orig_endo_aux_nbr = orig_endo_nbr + min(find(aux_vars_type == 6)) - 1;
```
But that does not work for `discretionary_policy`, where such a cutoff in the auxiliaries is not defined.
[nkm_diagnostic_ramsey.mod](/uploads/84180da62cfe0fbbd529c24e1644a9ad/nkm_diagnostic_ramsey.mod)https://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/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/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/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/84Provide name of parameter used with lead/lag2021-12-02T11:35:57ZJohannes PfeiferProvide name of parameter used with lead/lagCurrently, the warning is just
```
WARNING: A parameter was used with a lead or a lag in the model block
```
which makes it hard to debug.Currently, the warning is just
```
WARNING: A parameter was used with a lead or a lag in the model block
```
which makes it hard to debug.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/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/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.x