dynare issueshttps://git.dynare.org/Dynare/dynare/-/issues2023-12-14T20:03:13Zhttps://git.dynare.org/Dynare/dynare/-/issues/1890model_replace cannot identify equations with multiple tags2023-12-14T20:03:13ZMarco Rattomodel_replace cannot identify equations with multiple tags`model_replace(TAGS...);`
allows providing a list of tags, which is interpreted as a list of equations to replace, however we cannot identify one single equation with multiple tags. for example this makes impossible to replace one equati...`model_replace(TAGS...);`
allows providing a list of tags, which is interpreted as a list of equations to replace, however we cannot identify one single equation with multiple tags. for example this makes impossible to replace one equation related to OBC (occbin), since the name of the equation applies to the 2 variants (relax, bind), and hence model_replace cannot be used.
we could find a way to identify 1 equation with multiple tags, e.g. with multiple tags grouped into square brakets as follows?
`model_replace([TAG1 TAG2], TAGS, ...);
`Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1889Gracefully exit after problem in block_trust_region.mex2023-09-26T20:01:23ZJohannes PfeiferGracefully exit after problem in block_trust_region.mexThe attached file crashes Matlab on Windows, presumably due to a Lapack issue in `block_trust_region`.
[example.mod](/uploads/a41c52dff0aac34aeadf7901fa6aa0a7/example.mod)The attached file crashes Matlab on Windows, presumably due to a Lapack issue in `block_trust_region`.
[example.mod](/uploads/a41c52dff0aac34aeadf7901fa6aa0a7/example.mod)Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1888Rename resid.m2023-07-23T10:34:20ZJohannes PfeiferRename resid.mIn Matlab Online I got the warning
```
Warning: Dynare is not on top of the Matlab/Octave path! This can cause problems because the Dynare implementations of resid.m, and vnorm.m will be overriden.
Warning: I put /MATLAB Add-Ons/Toolbox...In Matlab Online I got the warning
```
Warning: Dynare is not on top of the Matlab/Octave path! This can cause problems because the Dynare implementations of resid.m, and vnorm.m will be overriden.
Warning: I put /MATLAB Add-Ons/Toolboxes/dynare/matlab on top of your Matlab/Ocatve path.
Note that this is a temporary change (i.e. it will not affect future Matlab/Octave sessions).
```
Given that Dynare 6.0 will break backward compatibility with the regularly used syntax `resid(1)`, I would suggest to use this opportunity to rename the underlying Matlab function to something more expressive, which at the same time does not cause a naming conflict with the built-in function.6.xhttps://git.dynare.org/Dynare/dynare/-/issues/1887Allow for Windows paths in config.ini to contain space by placing quotes2023-06-01T08:29:26ZJohannes PfeiferAllow for Windows paths in config.ini to contain space by placing quotesSee https://forum.dynare.org/t/save-draws-from-multiple-chains-run-in-parallele/22183/10See https://forum.dynare.org/t/save-draws-from-multiple-chains-run-in-parallele/22183/10Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1885load_results_after_load_mh results file not found2023-02-07T16:05:09ZWilliam Gattload_results_after_load_mh results file not foundI have an estimated model with `mh_replic=0`, and both `load_mh_file` and `load_results_after_load_mh` are switched on, but I get the following warning:
`dynare_estimation_init:: You specified the load_results_after_load_mh, but no _res...I have an estimated model with `mh_replic=0`, and both `load_mh_file` and `load_results_after_load_mh` are switched on, but I get the following warning:
`dynare_estimation_init:: You specified the load_results_after_load_mh, but no _results.mat-file`
`dynare_estimation_init:: was found. Results will be recomputed.`
If I navigate to _modfilename/Output/modfilename_results.mat_ and copy it to the main folder then it works. Is this intended behaviour or is Dynare not looking in the right path? Using v5.3.
Thanks,
Williamhttps://git.dynare.org/Dynare/dynare/-/issues/1884Investigate why det_cond_forecast does not distinguish between surprise and a...2024-02-29T12:53:15ZJohannes PfeiferInvestigate why det_cond_forecast does not distinguish between surprise and anticipated shocksSee [simulation_det_cond.mod](/uploads/f162f70fa8cd7a060919c6902e6ca1da/simulation_det_cond.mod)See [simulation_det_cond.mod](/uploads/f162f70fa8cd7a060919c6902e6ca1da/simulation_det_cond.mod)Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1883perfect_foresight_with_expectation_errors single shocks block performs wrong ...2023-01-28T20:25:39ZWilli Mutschlerwilli@mutschler.euperfect_foresight_with_expectation_errors single shocks block performs wrong size assignment if more than one shockI added another shock `y` to the baseline test mod file and have only one single shocks block for `x` with `learnt_in=2`:
```
var c k; varexo x y;
parameters alph gam delt bet aa;
alph=0.5; gam=0.5; delt=0.02; bet=0.05; aa=0.5;
model;
...I added another shock `y` to the baseline test mod file and have only one single shocks block for `x` with `learnt_in=2`:
```
var c k; varexo x y;
parameters alph gam delt bet aa;
alph=0.5; gam=0.5; delt=0.02; bet=0.05; aa=0.5;
model;
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1) +y;
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;
initval;
y=0;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;
steady;
check;
shocks(learnt_in=2);
var x;
periods 2:3;
values 1.2;
end;
perfect_foresight_with_expectation_errors_setup(periods = 7);
perfect_foresight_with_expectation_errors_solver;
rplot c;
```
I get the following error:
```
Unable to perform assignment because the size of the left side is 2-by-7 and the size of the right side is 2-by-1.
Error in perfect_foresight_with_expectation_errors_setup (line 72)
oo_.pfwee.shocks_info(:, :, 1) = oo_.exo_steady_state;
```
So there is a bug here, because if I remove y, the simulation runs.Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1882misleading warning on missing shocks(learnt_in=1) block2023-01-20T10:17:01ZWilli Mutschlerwilli@mutschler.eumisleading warning on missing shocks(learnt_in=1) blockAccording to the manual `a shocks(learnt_in=1) block is equivalent to a regular shocks block`; however, if I use the below mod file, I get a warning `Warning: perfect_foresight_with_expectation_errors_setup: there is no shocks(learnt_in=...According to the manual `a shocks(learnt_in=1) block is equivalent to a regular shocks block`; however, if I use the below mod file, I get a warning `Warning: perfect_foresight_with_expectation_errors_setup: there is no shocks(learnt_in=...) or endval(learnt_in=...) block, and you did not pass the datafile option, so there is no point in using this command`.
I find the warning a bit unlucky in this case, even though indeed there is no point in using this command instead of the regular perfect_foresight ones.
```
var c k; varexo x;
parameters alph gam delt bet aa;
alph=0.5; gam=0.5; delt=0.02; bet=0.05; aa=0.5;
model;
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;
initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;
steady;
check;
shocks(learnt_in = 1);
var x;
periods 2:3;
values 1.2;
end;
perfect_foresight_with_expectation_errors_setup(periods = 7);
perfect_foresight_with_expectation_errors_solver;
rplot c;
```https://git.dynare.org/Dynare/dynare/-/issues/1881Problems with exogenous variables with a lead2022-12-28T08:11:55ZMichelJuillardProblems with exogenous variables with a leadIn `dynamic_set_auxiliary_series.m`, exogenous variables with lead are set at the wrong period.
If `A` is an exogenous variable and appears as `A(+1)` in the model, `dynamic_set_auxiliary_series.m` contains the following line:
```
ds.AUX...In `dynamic_set_auxiliary_series.m`, exogenous variables with lead are set at the wrong period.
If `A` is an exogenous variable and appears as `A(+1)` in the model, `dynamic_set_auxiliary_series.m` contains the following line:
```
ds.AUX_EXO_LEAD_18=ds.A;
```
when it should be
```
ds.AUX_EXO_LEAD_18=lag(ds.A, -1);
```
However, this solution raises another issue as `lag(ds.A, -1)` is unknown at the time of evaluation of `dynamic_set_auxiliary_series` in `driver.m`.
`M_.histval_endo` should be initialized with `M_.orig_maximum_lag_with_diffs_expanded + M_.orig_maximum_lead`, initialized with the steady state of endogenous, exogenous and exogenous_det variables, and the shocks.
This can be investigated with [neoclassical1.mod](/uploads/1b0ad089ff78d77a54fdf454470e2e93/neoclassical1.mod)
The timing used in row 33 of `+neoclassical1/dynamic_resid.m` looks suspicious as well, I believe that one should use the row `it_+1` rather than `it_`https://git.dynare.org/Dynare/dynare/-/issues/1880Missing input sanitization in parallel configuration file2023-09-06T10:54:55ZSébastien VillemotMissing input sanitization in parallel configuration fileInput read from the parallel configuration file, specifically from the `UserName`, `ComputerName`, and `RemoteDirectory` fields, is passed directly to a `system` call without any sanitization.
Command injection example with the `UserNam...Input read from the parallel configuration file, specifically from the `UserName`, `ComputerName`, and `RemoteDirectory` fields, is passed directly to a `system` call without any sanitization.
Command injection example with the `UserName` field:
```
[cluster]
Name = LocalProfile1
Members = n1
[node]
Name = n1
ComputerName = 192.168.1.62
CPUnbr = 8
NumberOfThreadsPerJob = 1
OperatingSystem = unix
RemoteDirectory = test
UserName = & ping 127.0.0.1 &
Password = test
```
Intigriti submission reference: `DYNARE-4CN0UV5J`https://git.dynare.org/Dynare/dynare/-/issues/1879Fix error handling in PKF smoother2023-02-07T14:23:56ZJohannes PfeiferFix error handling in PKF smootherProblems in solving will crash Dynare:
[extract_smoothed.mod](/uploads/c48ed387f69907ac2f5ca5eaba1a8182/extract_smoothed.mod)
[data_final2.xlsx](/uploads/65048686824c779ec84cd3bb3ce5b9a5/data_final2.xlsx)Problems in solving will crash Dynare:
[extract_smoothed.mod](/uploads/c48ed387f69907ac2f5ca5eaba1a8182/extract_smoothed.mod)
[data_final2.xlsx](/uploads/65048686824c779ec84cd3bb3ce5b9a5/data_final2.xlsx)https://git.dynare.org/Dynare/dynare/-/issues/1878X-13ARIMA-SEATS routines can crash depending on the current directory2023-09-06T10:53:18ZPierre AldamaX-13ARIMA-SEATS routines can crash depending on the current directoryWhile working on building our dataset (in our case, for seasonal adjustment), we observed that X-13ARIMA-SEATS routines can crash when the current directory is different from the path of the Matlab script where we call the X13 routines. ...While working on building our dataset (in our case, for seasonal adjustment), we observed that X-13ARIMA-SEATS routines can crash when the current directory is different from the path of the Matlab script where we call the X13 routines. This behavior seems to be eratic: it occurs while we loop over a loop of variables and it does not always crash on the same variable.
In the attached example, I replicate this crash with random data on which I want to do seasonal adjustment. I loop over an arbitrary number of variables (N=30). To trigger the crash, one needs to change the current directory of Matlab to any subfolder.
```
%% Create a subfodler
mkdir SomeFolder
addpath('./SomeFolder')
%% To trigger the bug set bug = true
bug = true ;
if bug
cd('./SomeFolder')
else
cd(cwd)
end
```
In this case, the loop will eventually stop. Sometimes, it can stop for the first variable, sometimes it can iterate until a higher number of variable, for a reason we cannot explain.
```
Variable 7
ans is a dseries object:
| d11
1999Q1 | 0.39353
1999Q2 | 0.91905
1999Q3 | 0.6416
1999Q4 | 0.721
2000Q1 | 0.92627
2000Q2 | 0.42445
2000Q3 | 0.51803
2000Q4 | 0.3232
2001Q1 | 0.32554
2001Q2 | 0.3497
|
2021Q2 | 1.1398
2021Q3 | 0.5587
2021Q4 | 0.23827
2022Q1 | 0.53768
2022Q2 | 0.46911
2022Q3 | 0.77198
2022Q4 | 0.35521
2023Q1 | 0.4205
2023Q2 | 0.61482
2023Q3 | 0.21813
2023Q4 | 1.1208
Variable 8
Reference to non-existent field 'd11'.
Error in x13/subsref (line 88)
o = builtin('subsref', o.(S(1).subs), S(2));
Error in BugX13 (line 50)
o.results.d11
```
[BugX13.7z](/uploads/db69ed042bccb75ffc89e986c79dd8d2/BugX13.7z)Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1877Document Windows restrictions on passing quoted strings at command line2022-12-08T11:12:15ZJohannes PfeiferDocument Windows restrictions on passing quoted strings at command lineFor example, under Windows the invocation
```
dynare sw2007nw_dsge -Ddatafile_name='"data94q1.mat"'
```
is cut down to
```
Calling Dynare with arguments: -Ddatafile_name="data94q1.mat"
```
i.e. the second layer of quoted strings is lost....For example, under Windows the invocation
```
dynare sw2007nw_dsge -Ddatafile_name='"data94q1.mat"'
```
is cut down to
```
Calling Dynare with arguments: -Ddatafile_name="data94q1.mat"
```
i.e. the second layer of quoted strings is lost. The most robust workaround is to handle the strings at the mod-file level, e.g.
```
estimation(datafile='@{datafile_name}')
```
instead of trying to have the quote in the `datafile_name`.https://git.dynare.org/Dynare/dynare/-/issues/1876Document behavior of steady_state()-operator with trending variables2022-12-20T16:37:03ZJohannes PfeiferDocument behavior of steady_state()-operator with trending variablesSee https://forum.dynare.org/t/correct-specification-of-fiscal-rules-in-a-non-stationary-environment/21245/4See https://forum.dynare.org/t/correct-specification-of-fiscal-rules-in-a-non-stationary-environment/21245/4Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/1875Cannot use algorithms 12 and 14 despite having specified json=compute option2022-12-15T15:21:01ZPierre AldamaCannot use algorithms 12 and 14 despite having specified json=compute optionWhen trying to solve a model under perfect foresight using algorithms 12 ou 14, Dynare requires the json output of the model. In the attached example, I try to simulate a backward-looking model with algorithm 14 and the json=compute opti...When trying to solve a model under perfect foresight using algorithms 12 ou 14, Dynare requires the json output of the model. In the attached example, I try to simulate a backward-looking model with algorithm 14 and the json=compute option is specified at the top of the mod file.
Dynare actually _produces json files_ but cannot apparently use them and returns an error :
```
Error using sim1_purely_backward (line 30)
Algorithms solve_algo={12,14} require json output of the model (use json=compute option)
```
If ones actually tries to read the json files by running :
```
jsonfile = fileread(sprintf('%s/model/json/modfile-original.json', M_.fname));
json = jsondecode(jsonfile);
```
it gets :
```
Error using jsondecode
JSON syntax error at line 33, column 72 (character 4353): expected value but found 'dates'.
```
The problems seems to be related to initval_file() :
```
{"statementName": "initval_file", "options": {"firstsimulationperiod": dates(database.lastobservedperiod+1), "lastsimulationperiod": dates(database.lastobservedperiod+len-1), "series": "database"}},
```
[BugJson.7z](/uploads/ba0c2578d0ee38ebd2dbab9126ef46a7/BugJson.7z)Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1874Document pac_target_nonstationary-operator and auxiliary variable content rel...2024-01-29T20:44:08ZJohannes PfeiferDocument pac_target_nonstationary-operator and auxiliary variable content related to PAC-modelsThe `pac_target_nonstationary`-operator does not appear in the manual. Similarly, the content of `M_.aux_vars.orig_expr` should be documented. For example, `tests/pac/var-5/example1.mod` has an `aux_var` of the form:
```g*pacman_pac_gro...The `pac_target_nonstationary`-operator does not appear in the manual. Similarly, the content of `M_.aux_vars.orig_expr` should be documented. For example, `tests/pac/var-5/example1.mod` has an `aux_var` of the form:
```g*pacman_pac_growth_neutrality_correction+h_pacman_constant+AUX_DIFF_32(-1)*h_pacman_var_AUX_DIFF_32_lag_1+y(-1)*h_pacman_var_y_lag_1+AUX_DIFF_32(-2)*h_pacman_var_AUX_DIFF_32_lag_2+y(-2)*h_pacman_var_y_lag_2```
The structure of such expressions and the meaning of preprocessor-created objects should be explained.
Related to https://forum.dynare.org/t/iterative-ols-for-pac-equation/21379/47.xStéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1873Method-Of-Moments: add ability to keep first moments despite prefilter option2023-12-14T20:02:09ZWilli Mutschlerwilli@mutschler.euMethod-Of-Moments: add ability to keep first moments despite prefilter optionWilli Mutschlerwilli@mutschler.euWilli Mutschlerwilli@mutschler.euhttps://git.dynare.org/Dynare/dynare/-/issues/1872Implement conditional likelihood at order=12023-09-06T10:52:12ZJohannes PfeiferImplement conditional likelihood at order=1@stepan-a already has an implementation.@stepan-a already has an implementation.https://git.dynare.org/Dynare/dynare/-/issues/1871Add Dynare Julia implementation for computing Ramsey steady state2023-09-27T15:18:36ZJohannes PfeiferAdd Dynare Julia implementation for computing Ramsey steady state@MichelJuillard implemented an optimization approach in Julia instead of the current QR-decomposition. We should implement this as an option as it allows controlling the size of the error.@MichelJuillard implemented an optimization approach in Julia instead of the current QR-decomposition. We should implement this as an option as it allows controlling the size of the error.7.xhttps://git.dynare.org/Dynare/dynare/-/issues/1870Deal with missing aux_vars info for leads/lags of endogenous and exogenous (m...2023-01-04T09:59:54ZJohannes PfeiferDeal with missing aux_vars info for leads/lags of endogenous and exogenous (model_info)The preprocessor does not set `M_.aux_vars.orig_index` and `M_.aux_vars.orig_lead_lag` for leads of variables. Required for `model_info`. [perfectforesight_3eq.mod](/uploads/ca05d2cf1f8ad2aebd3e5085123438d1/perfectforesight_3eq.mod)The preprocessor does not set `M_.aux_vars.orig_index` and `M_.aux_vars.orig_lead_lag` for leads of variables. Required for `model_info`. [perfectforesight_3eq.mod](/uploads/ca05d2cf1f8ad2aebd3e5085123438d1/perfectforesight_3eq.mod)6.x