dynare issueshttps://git.dynare.org/Dynare/dynare/-/issues2023-06-06T07:56:02Zhttps://git.dynare.org/Dynare/dynare/-/issues/5Integrate algorithm for TBC by Holden and Paetz (2012)2023-06-06T07:56:02ZSébastien VillemotIntegrate algorithm for TBC by Holden and Paetz (2012)Request by Stéphane Moyen.
Paper at http://www.tholden.org/files/zlb.pdf?attredirects=0
Apparently the code has been posted on the Dynare forums. It's therefore a matter of dealing with copyright/license issues and integrating it.
Request by Stéphane Moyen.
Paper at http://www.tholden.org/files/zlb.pdf?attredirects=0
Apparently the code has been posted on the Dynare forums. It's therefore a matter of dealing with copyright/license issues and integrating it.
4.4https://git.dynare.org/Dynare/dynare/-/issues/415Use of subexpression caching in Dynare++ evaluator can lead to wrong results2021-11-08T11:22:42ZSébastien VillemotUse of subexpression caching in Dynare++ evaluator can lead to wrong resultsConsider the following MOD file:
```
var y;
varexo e;
parameters beta rbar rebar lambdae t1 t2;
beta = 1/1.02^0.25;
rbar = 1.02^0.25;
rebar = (1.065-rbar^4+1)^0.25;
lambdae = 0.2;
lambdae = 1-lambdae;
t1 = (1-lambdae)/beta;
t2 = lamb...Consider the following MOD file:
```
var y;
varexo e;
parameters beta rbar rebar lambdae t1 t2;
beta = 1/1.02^0.25;
rbar = 1.02^0.25;
rebar = (1.065-rbar^4+1)^0.25;
lambdae = 0.2;
lambdae = 1-lambdae;
t1 = (1-lambdae)/beta;
t2 = lambdae/beta;
model;
y = t2*y(-1)+e;
end;
initval;
y = 0;
end;
vcov = [1];
order = 1;
```
The value computed for `t1` will be wrong, and will be equal to that of `t2`. Here is what happens step-by-step:
- `lambdae = 0.2;` => Dynare++ registers that `lambdae=0.2`
- `lambdae=1-lambdae;` => Dynare++ computes `1-lambdae=0.8` **and caches that identity**; then it updates `lambdae=0.8`
- `t1 = (1-lambdae)/beta;` => Dynare++ (wrongly) uses the cached value `1-lambdae=0.8`
- `t2 = lambdae/beta;` => Dynare++ (rightly) uses the value `lambdae=0.8`
It seems that the only sensible solution to this problem is to disable subexpression caching during the evaluation phase.
4.4https://git.dynare.org/Dynare/dynare/-/issues/400Add steady_no_check option to estimation command2019-06-19T15:38:18ZJohannes PfeiferAdd steady_no_check option to estimation command`unit_root_vars` is supposed to be deprecated by using ``diffuse_filter` instead for estimating a model with non-stationary observed variables. But estimation still checks the steady state unless it is preceded by a `steady(nocheck)` com...`unit_root_vars` is supposed to be deprecated by using ``diffuse_filter` instead for estimating a model with non-stationary observed variables. But estimation still checks the steady state unless it is preceded by a `steady(nocheck)` command that sets `options_.steadystate.nocheck` to 1. We should add an explicit option to set this option in estimation or automatically trigger it if the diffuse filter is requested. For a background, see
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4671
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2813
4.4Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/407Test for block with stack_solve_algo=3 is broken2019-06-19T15:38:18ZSébastien VillemotTest for block with stack_solve_algo=3 is brokenIt enters an infinite loop, and has therefore been disabled in 25269c3c6bb608f3295c308c156ce7bac2836d6a.
It enters an infinite loop, and has therefore been disabled in 25269c3c6bb608f3295c308c156ce7bac2836d6a.
4.4https://git.dynare.org/Dynare/dynare/-/issues/414Add interface and doc to use_univariate_filters_if_singularity_is_detected op...2019-06-19T15:38:18ZSébastien VillemotAdd interface and doc to use_univariate_filters_if_singularity_is_detected optionWas added in 894b3d69f4662a1132c0f7fb50083bf982745536
Was added in 894b3d69f4662a1132c0f7fb50083bf982745536
4.4Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/423Transform hardcoded tolerance of OSR into an option2019-06-19T15:38:18ZJohannes PfeiferTransform hardcoded tolerance of OSR into an optionSee http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4728
See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4728
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/431Potentially allow for loglinear option in stoch_simul2019-06-19T15:38:18ZJohannes PfeiferPotentially allow for loglinear option in stoch_simulCurrently, stoch_simul does not take the loglinear option as a preprocessor command, although technically everything seems to be in place. Using `options_.loglinear` already seems to trigger the desired computations.
Currently, stoch_simul does not take the loglinear option as a preprocessor command, although technically everything seems to be in place. Using `options_.loglinear` already seems to trigger the desired computations.
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/436Add length() operator to macroprocessor2019-06-19T15:38:18ZSébastien VillemotAdd length() operator to macroprocessorThe operator would return the length of an array. Useful for loops where you want to iterate over the array index rather than the array element.
The operator would return the length of an array. Useful for loops where you want to iterate over the array index rather than the array element.
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/437Add verbatim option to preprocessor2019-06-19T15:38:18ZJohannes PfeiferAdd verbatim option to preprocessorSometimes one would like to use a keyword detected by the preprocessor in a Matlab command, but the parsing detects this as invalid syntax. If possible, we should add something like a verbatim command to the preprocessor that adds the co...Sometimes one would like to use a keyword detected by the preprocessor in a Matlab command, but the parsing detects this as invalid syntax. If possible, we should add something like a verbatim command to the preprocessor that adds the content without changing it to the m-file.
For example
```
verbatim(cellstr={'eps_a';'eps_b'};)
```
would write the content to the m-file without leading to an error as it currently does if `eps_a` is declared in `var_exo`
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/448Relax check for varobs statement with measurement error.2019-06-19T15:38:18ZJohannes PfeiferRelax check for varobs statement with measurement error.The following mod-file leads to a preprocessor error of
`ERROR: test_ME_shocks.mod: line 18, cols 1-16: shocks: standard error can only be specified for exogenous or observed endogenous variables`
```
var c, k;
varexo e;
model;
c=0.5*...The following mod-file leads to a preprocessor error of
`ERROR: test_ME_shocks.mod: line 18, cols 1-16: shocks: standard error can only be specified for exogenous or observed endogenous variables`
```
var c, k;
varexo e;
model;
c=0.5*c(+1)+e;
k = 0.9*k(-1);
end;
shocks;
var e; stderr 0.009;
var k; stderr 1;
end;
varobs k;
stoch_simul(periods=500);
```
The reason is that the `varobs` statement comes after the `shocks` block. Moving it before the `shocks` makes the file run. We might want to relax this restriction on the positioning for the check.
4.4Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/446ms-sbvar/test_ms_variances.mod fails under Octave with MatIO 1.52019-06-19T15:38:18ZSébastien Villemotms-sbvar/test_ms_variances.mod fails under Octave with MatIO 1.5Here is the error message:
```
WHILE RUNNING MODFILE: ms-sbvar/test_ms_variances
MSG: load: reading matrix data for 'A0'
IN FILE: /home/sebastien/dynare/unstable/tests/../matlab//ms-sbvar/set_ms_est...Here is the error message:
```
WHILE RUNNING MODFILE: ms-sbvar/test_ms_variances
MSG: load: reading matrix data for 'A0'
IN FILE: /home/sebastien/dynare/unstable/tests/../matlab//ms-sbvar/set_ms_estimation_file.m
IN FUNCTION: set_ms_estimation_file
ON LINE and COLUMN: 49 and 12
```
Note that the problem does not occur with MatIO 1.3.
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/461dynare++ doesn't compile with bison >= 2.72019-06-19T15:38:16ZMichelJuillarddynare++ doesn't compile with bison >= 2.7The functions xx_parse() are now declared int in csv_tab.hh formula_tab.hh and matrix_tab.hh, generated by bison, but declared void in csv_parser.cpp, formula_parser.cpp, matrix_parser.cpp
The functions xx_parse() are now declared int in csv_tab.hh formula_tab.hh and matrix_tab.hh, generated by bison, but declared void in csv_parser.cpp, formula_parser.cpp, matrix_parser.cpp
4.4https://git.dynare.org/Dynare/dynare/-/issues/469Prevent estimating parameters used inside shocks-block2019-06-19T15:38:16ZJohannes PfeiferPrevent estimating parameters used inside shocks-blockI would classify the following behavior as a bug. `stoch_simul` allows using parameters to set variances inside of the `shocks` block. However, `estimation` completely ignores the updating of such a parameter if it is estimated as the co...I would classify the following behavior as a bug. `stoch_simul` allows using parameters to set variances inside of the `shocks` block. However, `estimation` completely ignores the updating of such a parameter if it is estimated as the covariance matrix is not updated. As can be seen in the mode_check plots of the attached modification of fs2000.mod, estimating sig_e_a results in the likelihood kernel being flat. Only the prior provides curvature. We should disallow such behavior as people should use the `stderr e_a` version.
```
var m P c e W R k d n l gy_obs gp_obs y dA;
varexo e_a e_m;
parameters alp bet gam mst rho psi del sig_e_a;
alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
rho = 0.7;
psi = 0.787;
del = 0.02;
sig_e_a=0.014;
model;
dA = exp(gam+e_a);
log(m) = (1-rho)*log(mst) + rho*log(m(-1))+e_m;
-P/(c(+1)*P(+1)*m)+bet*P(+1)*(alp*exp(-alp*(gam+log(e(+1))))*k^(alp-1)*n(+1)^(1-alp)+(1-del)*exp(-(gam+log(e(+1)))))/(c(+2)*P(+2)*m(+1))=0;
W = l/n;
-(psi/(1-psi))*(c*P/(1-n))+l/n = 0;
R = P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(-alp)/W;
1/(c*P)-bet*P*(1-alp)*exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)/(m*l*c(+1)*P(+1)) = 0;
c+k = exp(-alp*(gam+e_a))*k(-1)^alp*n^(1-alp)+(1-del)*exp(-(gam+e_a))*k(-1);
P*c = m;
m-1+d = l;
e = exp(e_a);
y = k(-1)^alp*n^(1-alp)*exp(-alp*(gam+e_a));
gy_obs = dA*y/y(-1);
gp_obs = (P/P(-1))*m(-1)/dA;
end;
initval;
k = 6;
m = mst;
P = 2.25;
c = 0.45;
e = 1;
W = 4;
R = 1.02;
d = 0.85;
n = 0.19;
l = 0.86;
y = 0.6;
gy_obs = exp(gam);
gp_obs = exp(-gam);
dA = exp(gam);
end;
shocks;
var e_a; stderr sig_e_a;
var e_m; stderr 0.005;
end;
steady;
check;
estimated_params;
del, beta_pdf, 0.01, 0.005;
sig_e_a, inv_gamma_pdf, 0.035449, inf;
end;
varobs gp_obs gy_obs;
estimation(order=1,bayesian_irf,irf_shocks=(e_m),datafile=fsdat_simul,mode_check, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8);
```
4.4Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/478extend tags to definitions2019-06-19T15:38:16ZMarco Rattoextend tags to definitionsWould it be possible to add new tags for parameters, exo and endogenous variables?
Something similar to the $latex-name$ e.g.
var
C $c$ [name = 'private consumption']
...
end;
varexo
e $\varepsilon$ [name='technology shock']
...
end;
...Would it be possible to add new tags for parameters, exo and endogenous variables?
Something similar to the $latex-name$ e.g.
var
C $c$ [name = 'private consumption']
...
end;
varexo
e $\varepsilon$ [name='technology shock']
...
end;
parameters
sigma $\sigma$ [name='elasticity of substitution']
...
end;
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/487Onlymacro preprocessor option seems to be broken2019-06-19T15:38:16ZJohannes PfeiferOnlymacro preprocessor option seems to be brokenSee http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5030
See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5030
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/488dynDate substitution.2019-06-19T15:38:16ZStéphane Adjemianstepan@adjemian.eudynDate substitution.Users should not use dynDate or dynDates objects in a mod file (at least for basic usage: extraction of sub-samples or observations). For instance, one should be able to define a range as follows:
```
r = 1990Q1:2012Q3 ;
```
in the mod...Users should not use dynDate or dynDates objects in a mod file (at least for basic usage: extraction of sub-samples or observations). For instance, one should be able to define a range as follows:
```
r = 1990Q1:2012Q3 ;
```
in the mod file, and use `r` to define a subsample from a dynSeries object. Obviously, such a statement, interpreted as a matlab command by the preprocessor, would produce an error message in matlab. We need to convert occurences of dates by explicit calls to the dynDate constructor. For instance the previous statement should be replaced by
```
r = dynDate('1990Q1'):dynDate('2012Q3') ;
```
It is easy to find all the dates in a mod file a using regular expression of the form
```
[1-9][0-9]+([YyAa]|[Qq][1-4]|[Mm]([1-9]|[1][1-2])|[Ww]([1-9]|[1-4][0-9]|[5][1-2]))
```
The tricky part is that we do not want to replace all the occurences of dates: we do not want to replace dates written in dynare commands (`set_time` and `data`), in commented lines or blocks, in strings.
The matlab routine available [here](https://gist.github.com/stepan-a/6780885) does these substitutions (there is also an example [here](https://gist.github.com/stepan-a/6781075)). It would be faster and more elegant if the translation was done in the preprocessor (after the macroprocessing because dates can be defined using the macro language).
4.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/493bug in @dynSeries/subsasgn.m2019-06-19T15:38:16ZMichelJuillardbug in @dynSeries/subsasgn.mUpdating a subsample of a time series results in duplication of the variables:
Example:
z = dynSeries((1:5)',dynDate('1990Q1'),'Z');
d = dynDate('1990Q2'):dynDate('1990Q4');
z(d) = z(d) + 10
This is obviously related to merge_dynSeries...Updating a subsample of a time series results in duplication of the variables:
Example:
z = dynSeries((1:5)',dynDate('1990Q1'),'Z');
d = dynDate('1990Q2'):dynDate('1990Q4');
z(d) = z(d) + 10
This is obviously related to merge_dynSeries_objects = 1; at the beginning of subsasgn.m that triggers merge() at the end of the function and which shouldn't happen in this case. I'm not sure how to fix it without breaking something else.
4.4Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/494Check correctness of set_parameters used in dynare_estimation_12019-06-19T15:38:16ZJohannes PfeiferCheck correctness of set_parameters used in dynare_estimation_11. `dynare_estimation_1` contains the lines
```
if ~isempty(estim_params_)
set_parameters(xparam1);
end
```
I was wondering why not `set_all_parameters` is used, which also sets the measurement error. `set_parameters` may have its...1. `dynare_estimation_1` contains the lines
```
if ~isempty(estim_params_)
set_parameters(xparam1);
end
```
I was wondering why not `set_all_parameters` is used, which also sets the measurement error. `set_parameters` may have its justification here, but I don't see why.
2. `set_parameters` sets `M_.Sigma_e`, but in contrast to `set_all_parameters` it does not use the correlation information from calibration stored in `M_.Correlation_matrix` and `M_.Correlation_matrix_ME`. This strikes me as wrong and the file thus as buggy.
This relates also to #392
4.4https://git.dynare.org/Dynare/dynare/-/issues/495Remove dynDate class2019-06-19T15:38:16ZStéphane Adjemianstepan@adjemian.euRemove dynDate classWe do not really need to have both `dynDate` and `dynDates` classes. Need to import some of the methods of `dynDate` class into `dynDates` class.
We do not really need to have both `dynDate` and `dynDates` classes. Need to import some of the methods of `dynDate` class into `dynDates` class.
4.4Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/496Add plot function for dynSeries objects.2019-06-19T15:38:16ZStéphane Adjemianstepan@adjemian.euAdd plot function for dynSeries objects.4.4