dynare issueshttps://git.dynare.org/Dynare/dynare/issues2019-06-19T15:38:06Zhttps://git.dynare.org/Dynare/dynare/issues/679Fix various bugs related to detrending and prefiltering2019-06-19T15:38:06ZJohannes Pfeifer Fix various bugs related to detrending and prefiltering- `dyn_forecast` adds unlogged steady state if `loglinear` is used
- `dynare_estimation_init` sets the `noconstant` based on the unlogged steady state if `loglinear` is used
- when trends are specified as a function of deep parameters, the values are not correctly updated during estimation due to using the base-workspace parameter values and not the updated local ones
- when using trends with the `prefilter` option, the mean shift due to the trend is not accounted for
- when using `first_obs>1`, the higher trend starting point is not taken into account (leads also to problems in recursive forecasting)
- `dyn_forecast` adds unlogged steady state if `loglinear` is used
- `dynare_estimation_init` sets the `noconstant` based on the unlogged steady state if `loglinear` is used
- when trends are specified as a function of deep parameters, the values are not correctly updated during estimation due to using the base-workspace parameter values and not the updated local ones
- when using trends with the `prefilter` option, the mean shift due to the trend is not accounted for
- when using `first_obs>1`, the higher trend starting point is not taken into account (leads also to problems in recursive forecasting)
4.5Johannes Pfeifer Johannes Pfeifer https://git.dynare.org/Dynare/dynare/issues/686addition bug in dseries2019-06-19T15:38:06ZHoutan Bastaniaddition bug in dseries```
>> a=dseries(ones(3,1))
>> 100-a
```
yields -99 as opposed to 99.
```
>> a=dseries(ones(3,1))
>> 100-a
```
yields -99 as opposed to 99.
4.5Stéphane Adjemianstepan@dynare.orgStéphane Adjemianstepan@dynare.orghttps://git.dynare.org/Dynare/dynare/issues/687update manual for common latex syntax in reports2019-06-19T15:38:06ZHoutan Bastaniupdate manual for common latex syntax in reportse.g. people may want to use a '%' sign in a graph title. Note the fix for this. Also for '\'
e.g. people may want to use a '%' sign in a graph title. Note the fix for this. Also for '\'
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/684Add test and documentation for LMMCP solver2019-06-19T15:38:06ZSébastien VillemotAdd test and documentation for LMMCP solver4.5MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/issues/688add option to suppress all reporting stdout output2019-06-19T15:38:06ZHoutan Bastaniadd option to suppress all reporting stdout outputi.e., suppress:
Adding Page X
Writing Page X
Compiler Output
Where the file is located
i.e., suppress:
Adding Page X
Writing Page X
Compiler Output
Where the file is located
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/694create fortran preprocessor output2019-06-19T15:38:06ZHoutan Bastanicreate fortran preprocessor outputdynamic and static files each as independent functions
model as a fortran module
dynamic and static files each as independent functions
model as a fortran module
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/695Ramsey: fix M_.aux_vars2019-06-19T15:38:06ZJohannes Pfeifer Ramsey: fix M_.aux_varsIn case of the Ramsey multipliers, the counting of equation numbers starts at 0, but should start at 1
In case of the Ramsey multipliers, the counting of equation numbers starts at 0, but should start at 1
4.5Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/issues/690Crash of k_order_perturbation DLL under MATLAB/Windows2019-06-19T15:38:06ZSébastien VillemotCrash of k_order_perturbation DLL under MATLAB/WindowsThe following MOD-file crashes MATLAB under Windows:
```
var y, c, k, a, h, b;
varexo e, u;
parameters beta, rho, alpha, delta, theta, psi, tau;
alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;
phi = 0.1;
model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u;
end;
initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
a = 0;
b = 0;
e = 0;
u = 0;
end;
shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
end;
stoch_simul(order=3,periods=100);
```
The crash only occurs under MATLAB+Windows. It does not occur on Octave or under GNU/Linux.
It seems to be a memory corruption, because MATLAB does not crash immediately within the MEX file, but a little after. However, under Linux, a Valgrind run reveals nothing suspicious. A gdb session under Windows is not helpful either.
Still to be tried:
- convert the MOD file for Dynare++, and see if it crashes
- investigate the MEX file by selectively commenting out/in portions of the code, to detect which one causes the memory corruption
The following MOD-file crashes MATLAB under Windows:
```
var y, c, k, a, h, b;
varexo e, u;
parameters beta, rho, alpha, delta, theta, psi, tau;
alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;
phi = 0.1;
model;
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta)*k(-1);
a = rho*a(-1)+tau*b(-1) + e;
b = tau*a(-1)+rho*b(-1) + u;
end;
initval;
y = 1.08068253095672;
c = 0.80359242014163;
h = 0.29175631001732;
k = 11.08360443260358;
a = 0;
b = 0;
e = 0;
u = 0;
end;
shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
end;
stoch_simul(order=3,periods=100);
```
The crash only occurs under MATLAB+Windows. It does not occur on Octave or under GNU/Linux.
It seems to be a memory corruption, because MATLAB does not crash immediately within the MEX file, but a little after. However, under Linux, a Valgrind run reveals nothing suspicious. A gdb session under Windows is not helpful either.
Still to be tried:
- convert the MOD file for Dynare++, and see if it crashes
- investigate the MEX file by selectively commenting out/in portions of the code, to detect which one causes the memory corruption
4.5Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/issues/693create csv output for every graph and table in a report2019-06-19T15:38:06ZHoutan Bastanicreate csv output for every graph and table in a reportStore in a parallel subdirectory for csv files.....or, perhaps just in the same tmpRepDir.
Store in a parallel subdirectory for csv files.....or, perhaps just in the same tmpRepDir.
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/697change syntax for instantiation of year dates2019-06-19T15:38:06ZHoutan Bastanichange syntax for instantiation of year datesCurrently, we can instantiate years as:
`t = dates(1, [1990; 1990; 1978], [1; 1; 1])`
but not as
`t = dates(1, [1990; 1990; 1978])`
In the case of years, the periods are irrelevant and so we should be able to declare a dates in the second syntax
Currently, we can instantiate years as:
`t = dates(1, [1990; 1990; 1978], [1; 1; 1])`
but not as
`t = dates(1, [1990; 1990; 1978])`
In the case of years, the periods are irrelevant and so we should be able to declare a dates in the second syntax
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/704bug saving dseries in csv format that have had operations made on them2019-06-19T15:38:06ZHoutan Bastanibug saving dseries in csv format that have had operations made on themThe following results in a malformed csv file because of the commas in the names of the variables:
```
a=dseries(rand(3,1), '1999y', 'a');
b=a*a;
b.save('malformed','csv');
```
results in:
```
,multiply(a,a)
1999Y, 0.66377469
2000Y, 0.82045903
2001Y, 0.016125652
```
need to replace the second comma in the first line with something else
The following results in a malformed csv file because of the commas in the names of the variables:
```
a=dseries(rand(3,1), '1999y', 'a');
b=a*a;
b.save('malformed','csv');
```
results in:
```
,multiply(a,a)
1999Y, 0.66377469
2000Y, 0.82045903
2001Y, 0.016125652
```
need to replace the second comma in the first line with something else
4.5Stéphane Adjemianstepan@dynare.orgStéphane Adjemianstepan@dynare.orghttps://git.dynare.org/Dynare/dynare/issues/706Preprocessor: @#for end of file bug2019-06-19T15:38:06ZTom HoldenPreprocessor: @#for end of file bugIf a file @#include-ed into another file contains a @#for loop for which the matching @#endfor is followed immediately by the end of the file, rather than by a new-line, then the pre-processor fails to find the @#endfor. To see this clone the repository https://github.com/tholden/DynareBugs/tree/master and then run dynare TestForLoopBug.mod . On Windows at least you will get an error saying it failed to find the @#endfor. However if you add a blank line at the end of ForLoopBug.mod then you no longer get this error.
If a file @#include-ed into another file contains a @#for loop for which the matching @#endfor is followed immediately by the end of the file, rather than by a new-line, then the pre-processor fails to find the @#endfor. To see this clone the repository https://github.com/tholden/DynareBugs/tree/master and then run dynare TestForLoopBug.mod . On Windows at least you will get an error saying it failed to find the @#endfor. However if you add a blank line at the end of ForLoopBug.mod then you no longer get this error.
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/708Preprocessor: String termination bug2019-06-19T15:38:06ZTom HoldenPreprocessor: String termination bugLength one sub-strings do not appear to be properly terminated, which produces strange results when they are concatenated.
Create a file with the following three lines:
@#define Numbers = "123456789"
@#define AString = "One " + Numbers[1] + " Two " + Numbers[2] + " Three " + Numbers[3]
@#echo AString
(or just clone StringTermination.mod from https://github.com/tholden/DynareBugs/tree/master).
On my PC, its output is different every time. E.g.:
One 16 Two 26 Three 36
Or:
One 1w Two 2w Three 3w
Length one sub-strings do not appear to be properly terminated, which produces strange results when they are concatenated.
Create a file with the following three lines:
@#define Numbers = "123456789"
@#define AString = "One " + Numbers[1] + " Two " + Numbers[2] + " Three " + Numbers[3]
@#echo AString
(or just clone StringTermination.mod from https://github.com/tholden/DynareBugs/tree/master).
On my PC, its output is different every time. E.g.:
One 16 Two 26 Three 36
Or:
One 1w Two 2w Three 3w
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/issues/707Preprocessor: Support creating empty arrays with [] (wishlist)2019-06-19T15:38:06ZTom HoldenPreprocessor: Support creating empty arrays with [] (wishlist)It would be great if [] returned an empty array. (At the moment it produces an error.) Doing [ "" ] - [ "" ] is a bit cumbersome!
It would be great if [] returned an empty array. (At the moment it produces an error.) Doing [ "" ] - [ "" ] is a bit cumbersome!
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/issues/711Fix forecasting with exogenous deterministic variables in master and add uni...2019-06-19T15:38:06ZJohannes Pfeifer Fix forecasting with exogenous deterministic variables in master and add unit testForecasting with exogenous deterministic variables in master is broken. In the mod-file
```
/*
* Example 2 from F. Collard (2001): "Stochastic simulations with DYNARE:
* A practical guide" (see "guide.pdf" in the documentation directory).
*/
/*
* Copyright (C) 2001-2010 Dynare Team
*
* This file is part of Dynare.
*
* Dynare is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dynare is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
var y, c, k, a, h, b dy;
//var Sum;
varexo e, u;
varexo_det e_det;
parameters beta, rho, alpha, delta, theta, psi, tau;
alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;
model;
exp(c)*theta*exp(h)^(1+psi)=(1-alpha)*exp(y);
exp(k) = beta*(((exp(b)*exp(c))/(exp(b(+1))*exp(c(+1))))
*(exp(b(+1))*alpha*exp(y(+1))+(1-delta)*exp(k)));
exp(y) = exp(a)*(exp(k(-1))^alpha)*(exp(h)^(1-alpha));
exp(k) = exp(b)*(exp(y)-exp(c))+(1-delta)*exp(k(-1));
a = rho*a(-1)+tau*b(-1) + e +e_det;
b = tau*a(-1)+rho*b(-1) + u;
dy=(y-0.0775944)/0.0775944*100;
//Sum=c+y;
end;
initval;
y = 0.1;
c = -0.2;
h = -1.2;
k = 2.4;
a = 0;
b = 0;
e = 0;
u = 0;
dy=0;
//Sum=c+y;
end;
steady;
shocks;
var e = 0.01^2;
var u = 0;
var e_det;
periods 1:1;
values 0.03;
end;
stoch_simul(irf=40, nograph, nomoments, order=2);
forecast(periods=100);
```
`dyn_forecast.m` still uses `oo_.exo_det_simul`, but this variable is not set anymore.
We should also add a unit test for this case.
Forecasting with exogenous deterministic variables in master is broken. In the mod-file
```
/*
* Example 2 from F. Collard (2001): "Stochastic simulations with DYNARE:
* A practical guide" (see "guide.pdf" in the documentation directory).
*/
/*
* Copyright (C) 2001-2010 Dynare Team
*
* This file is part of Dynare.
*
* Dynare is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dynare is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
var y, c, k, a, h, b dy;
//var Sum;
varexo e, u;
varexo_det e_det;
parameters beta, rho, alpha, delta, theta, psi, tau;
alpha = 0.36;
rho = 0.95;
tau = 0.025;
beta = 0.99;
delta = 0.025;
psi = 0;
theta = 2.95;
model;
exp(c)*theta*exp(h)^(1+psi)=(1-alpha)*exp(y);
exp(k) = beta*(((exp(b)*exp(c))/(exp(b(+1))*exp(c(+1))))
*(exp(b(+1))*alpha*exp(y(+1))+(1-delta)*exp(k)));
exp(y) = exp(a)*(exp(k(-1))^alpha)*(exp(h)^(1-alpha));
exp(k) = exp(b)*(exp(y)-exp(c))+(1-delta)*exp(k(-1));
a = rho*a(-1)+tau*b(-1) + e +e_det;
b = tau*a(-1)+rho*b(-1) + u;
dy=(y-0.0775944)/0.0775944*100;
//Sum=c+y;
end;
initval;
y = 0.1;
c = -0.2;
h = -1.2;
k = 2.4;
a = 0;
b = 0;
e = 0;
u = 0;
dy=0;
//Sum=c+y;
end;
steady;
shocks;
var e = 0.01^2;
var u = 0;
var e_det;
periods 1:1;
values 0.03;
end;
stoch_simul(irf=40, nograph, nomoments, order=2);
forecast(periods=100);
```
`dyn_forecast.m` still uses `oo_.exo_det_simul`, but this variable is not set anymore.
We should also add a unit test for this case.
https://git.dynare.org/Dynare/dynare/issues/712Fix computation decision rules for deterministic variables2019-06-19T15:38:05ZJohannes Pfeifer Fix computation decision rules for deterministic variablesFor the mod-file reported in #711 from http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5951 the decision rules are different from the 4.2 branch starting in the 4.3 branch. In particular, `dr.ghudud` differs.
When fixing this, we should also add information on how the decision rules are actually computed to the manual and potentially add a unit test.
For the mod-file reported in #711 from http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5951 the decision rules are different from the 4.2 branch starting in the 4.3 branch. In particular, `dr.ghudud` differs.
When fixing this, we should also add information on how the decision rules are actually computed to the manual and potentially add a unit test.
https://git.dynare.org/Dynare/dynare/issues/717Check size of MeanForecast fields and make it consistent across options2019-06-19T15:38:05ZJohannes Pfeifer Check size of MeanForecast fields and make it consistent across options`oo_.MeanForecast.Mean.variablename` and `oo_.PointForecast.Mean.variablenam` are n+1 vectors if `mh_replic>0` and `forecast=n`, but only n-vectors if `mh_replic=0`. This should be made consistent or at least documented. See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5987
`oo_.MeanForecast.Mean.variablename` and `oo_.PointForecast.Mean.variablenam` are n+1 vectors if `mh_replic>0` and `forecast=n`, but only n-vectors if `mh_replic=0`. This should be made consistent or at least documented. See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5987
https://git.dynare.org/Dynare/dynare/issues/720relative_irf2019-06-19T15:38:05ZMarco Rattorelative_irfWould it make sense to allow option relative_irf also in estimation for producing bayesian irfs?
Would it be possible to allow options to the new syntax
`irf_calibration(<options>)`
in particular would be fine to have the relative_irf option
`irf_calibration(relative_irf)`
Would it make sense to allow option relative_irf also in estimation for producing bayesian irfs?
Would it be possible to allow options to the new syntax
`irf_calibration(<options>)`
in particular would be fine to have the relative_irf option
`irf_calibration(relative_irf)`
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/issues/727Add unit test and example for differentiate_forward_vars2019-06-19T15:38:05ZJohannes Pfeifer Add unit test and example for differentiate_forward_varsStéphane Adjemianstepan@dynare.orgStéphane Adjemianstepan@dynare.orghttps://git.dynare.org/Dynare/dynare/issues/728Add information on auxiliary equations to M_2019-06-19T15:38:04ZJohannes Pfeifer Add information on auxiliary equations to M_Use the preprocessor to always add `M_.orig_eq_nbr` (currently only present if the Ramsey command is used) and `M_.eq_nbr` to save the number of total equations. This would mimic the behavior of `M_.endo_nbr` and `M_.orig_endo_nbr` and provide all information necessary. See the end of #696
Use the preprocessor to always add `M_.orig_eq_nbr` (currently only present if the Ramsey command is used) and `M_.eq_nbr` to save the number of total equations. This would mimic the behavior of `M_.endo_nbr` and `M_.orig_endo_nbr` and provide all information necessary. See the end of #696
4.5Houtan BastaniHoutan Bastani