dynare issueshttps://git.dynare.org/Dynare/dynare/-/issues2019-11-21T08:55:15Zhttps://git.dynare.org/Dynare/dynare/-/issues/829Rewrite local_state_space_iteration_2 routine2019-11-21T08:55:15ZStéphane Adjemianstepan@adjemian.euRewrite local_state_space_iteration_2 routineSeparate the measurement and state equations. See discussions in [particles](https://github.com/DynareTeam/particles/issues) repository.
Separate the measurement and state equations. See discussions in [particles](https://github.com/DynareTeam/particles/issues) repository.
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1643Implement pruning at order>32019-11-21T08:45:16ZJohannes Pfeifer Implement pruning at order>3The algorithm should follow Andreasen et al. (2018) as already implemented in `simult_.m` for orders 2 and 3. Should be done in the C++ routines of `dynare_simul_` as discussed in https://git.dynare.org/Dynare/dynare/commit/1e92e308b9d0301108d18d7256f47655097f20cb#note_8364The algorithm should follow Andreasen et al. (2018) as already implemented in `simult_.m` for orders 2 and 3. Should be done in the C++ routines of `dynare_simul_` as discussed in https://git.dynare.org/Dynare/dynare/commit/1e92e308b9d0301108d18d7256f47655097f20cb#note_83644.7Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/563Potentially change treatment of #-expressions in LaTeX - Code2019-11-21T08:36:46ZJohannes Pfeifer Potentially change treatment of #-expressions in LaTeX - CodeI have a mod-file where I use `write_latex_dynamic_model;`
The file contains an expression
`#delta_2=delta_2divdelta_1*delta_1;`
We should try to add a way to define a LaTeX name for this expression. Moreover, I noticed that sometimes, the LaTeX-Code adds a time t-index to this expression although expressions cannot be lagged or leaded. This should also be removed if possible.
I have a mod-file where I use `write_latex_dynamic_model;`
The file contains an expression
`#delta_2=delta_2divdelta_1*delta_1;`
We should try to add a way to define a LaTeX name for this expression. Moreover, I noticed that sometimes, the LaTeX-Code adds a time t-index to this expression although expressions cannot be lagged or leaded. This should also be removed if possible.
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/614not balanced growth model not detected by test2019-11-21T08:36:46ZMichelJuillardnot balanced growth model not detected by testHere is an example where an error in trend declaration isn't detected by the balanced growth test. It may come from the fact that labor enhancing productivity (G) is not a variable of the model, just a trend. The error should appear for the equations defining r and w and for the resource constraint.
```
parameters rho delta gamma alpha lambda g;
trend_var(growth_factor=1+g) G;
// the trend of K is wrong:
var(deflator=G) C w;
var L r A K;
// Here is the correct specification:
// var(deflator=G) C w K;
// var L r A;
varexo e;
alpha = 0.33;
delta = 0.1;
rho = 0.03;
lambda = 0.97;
gamma = 0;
g = 0.015;
model;
1/C = 1/(1+rho)*(1/C(+1))*(r(+1)+1-delta);
L^gamma = w/C;
r = alpha*A*K(-1)^(alpha-1)*(G*L)^(1-alpha);
w = (1-alpha)*A*K(-1)^alpha*(G*L)^(-alpha);
K+C = K(-1)*(1-delta)+A*K(-1)^alpha*(G*L)^(1-alpha);
log(A) = lambda*log(A(-1))+e;
end;
steady_state_model;
A = 1;
r = (1+g)*(1+rho)+delta-1;
K_L = (1+g)*(r/(alpha*A))^(1/(alpha-1));
w = (1-alpha)*A*(K_L/(1+g))^alpha;
L = (-((delta+g)/(1+g))*K_L/w+A*(K_L/((1+g)*w^(1/alpha)))^alpha)
^(-1/(1+gamma));
K = K_L*L;
C = (1-delta)*K/(1+g)+(K_L/(1+g))^alpha*L-K;
end;
shocks;
var e; stderr 0.01;
end;
write_latex_dynamic_model;
steady;
check;
stoch_simul(order=1);
```
Here is an example where an error in trend declaration isn't detected by the balanced growth test. It may come from the fact that labor enhancing productivity (G) is not a variable of the model, just a trend. The error should appear for the equations defining r and w and for the resource constraint.
```
parameters rho delta gamma alpha lambda g;
trend_var(growth_factor=1+g) G;
// the trend of K is wrong:
var(deflator=G) C w;
var L r A K;
// Here is the correct specification:
// var(deflator=G) C w K;
// var L r A;
varexo e;
alpha = 0.33;
delta = 0.1;
rho = 0.03;
lambda = 0.97;
gamma = 0;
g = 0.015;
model;
1/C = 1/(1+rho)*(1/C(+1))*(r(+1)+1-delta);
L^gamma = w/C;
r = alpha*A*K(-1)^(alpha-1)*(G*L)^(1-alpha);
w = (1-alpha)*A*K(-1)^alpha*(G*L)^(-alpha);
K+C = K(-1)*(1-delta)+A*K(-1)^alpha*(G*L)^(1-alpha);
log(A) = lambda*log(A(-1))+e;
end;
steady_state_model;
A = 1;
r = (1+g)*(1+rho)+delta-1;
K_L = (1+g)*(r/(alpha*A))^(1/(alpha-1));
w = (1-alpha)*A*(K_L/(1+g))^alpha;
L = (-((delta+g)/(1+g))*K_L/w+A*(K_L/((1+g)*w^(1/alpha)))^alpha)
^(-1/(1+gamma));
K = K_L*L;
C = (1-delta)*K/(1+g)+(K_L/(1+g))^alpha*L-K;
end;
shocks;
var e; stderr 0.01;
end;
write_latex_dynamic_model;
steady;
check;
stoch_simul(order=1);
```
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/6Possible optimization of decision rules at first order2019-11-21T08:36:46ZSébastien VillemotPossible optimization of decision rules at first orderIn dr.pdf, at the end of section 4.1, we have:
g^-_y = Z'_11 T^{-1}_11 S_{11} (Z'_{11})^{-1}
But dr1.m used to contain the following formula:
g^-_y = (T^{-1}_11 X)^{-1} S_{11} X
which is probably more efficient given that X=Z_{11}+Z_{12}g⁺_y (see equation 10), because it saves an inversion
We should make benchmarks between the 2 formulas, because Ondra thinks that for performance reasons, the first method is better, even though this is not obvious.
In dr.pdf, at the end of section 4.1, we have:
g^-_y = Z'_11 T^{-1}_11 S_{11} (Z'_{11})^{-1}
But dr1.m used to contain the following formula:
g^-_y = (T^{-1}_11 X)^{-1} S_{11} X
which is probably more efficient given that X=Z_{11}+Z_{12}g⁺_y (see equation 10), because it saves an inversion
We should make benchmarks between the 2 formulas, because Ondra thinks that for performance reasons, the first method is better, even though this is not obvious.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/530checking singularity in first order approximation2019-11-21T08:36:46ZMichelJuillardchecking singularity in first order approximationCurrently, we don't check for singularity in first order approximation when solving for static variables (is b10 singular?) or solving for shocks coefficient (is A_ singular?)
1) We should probably add a warning to stoch_simul (and ramsey_policy)
2) Should we care for estimation? Should expand the implicit prior to b10 and A_ non-singular?
3) If b10 is singular, the model has a problem: it is not possible to determine some static variable from the solution of the dynamic part of the model
4) The conditions under which A_ can be singular are mode difficult to determine.
Currently, we don't check for singularity in first order approximation when solving for static variables (is b10 singular?) or solving for shocks coefficient (is A_ singular?)
1) We should probably add a warning to stoch_simul (and ramsey_policy)
2) Should we care for estimation? Should expand the implicit prior to b10 and A_ non-singular?
3) If b10 is singular, the model has a problem: it is not possible to determine some static variable from the solution of the dynamic part of the model
4) The conditions under which A_ can be singular are mode difficult to determine.
https://git.dynare.org/Dynare/dynare/-/issues/780Deal with options_.nobs and options_.first_obs in master2019-11-21T08:36:46ZJohannes Pfeifer Deal with options_.nobs and options_.first_obs in masterWith the new data interface, these fields are not always set, leading to crashes in different places. For example, recursive forecasting still relies on those fields. See also afb5be206741457a9b6383fa004bb3f208ed5d94
We need to decide on how to treat them. Are these field properties of the dataset to be moved into `dataset_`? Or are they to be used as options in other commands?
With the new data interface, these fields are not always set, leading to crashes in different places. For example, recursive forecasting still relies on those fields. See also afb5be206741457a9b6383fa004bb3f208ed5d94
We need to decide on how to treat them. Are these field properties of the dataset to be moved into `dataset_`? Or are they to be used as options in other commands?
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/630Improving Ramsey computations2019-11-21T08:36:46ZMichelJuillardImproving Ramsey computations1) adding the possibility to use one of the parameters of the model as the planner_discount factor
2) give independent access to the fonction evaluating the objective function
1) adding the possibility to use one of the parameters of the model as the planner_discount factor
2) give independent access to the fonction evaluating the objective function
MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/821Add flag if lyapunov_symm fails2019-11-21T08:36:45ZJohannes Pfeifer Add flag if lyapunov_symm failsIn models like the one at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6291
`lyapunov_symm` fails to solve the Lyapunov equation and outputs NaN. This error is not flagged and no exception thrown out, leading to subsequent crashes. We should add a check whether the solver was successful and only continue if so.
In models like the one at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6291
`lyapunov_symm` fails to solve the Lyapunov equation and outputs NaN. This error is not flagged and no exception thrown out, leading to subsequent crashes. We should add a check whether the solver was successful and only continue if so.
https://git.dynare.org/Dynare/dynare/-/issues/135Improve display of decision rules with EXPECTATION operator2019-11-21T08:36:45ZSébastien VillemotImprove display of decision rules with EXPECTATION operatorCurrently, if the user inputs EXPECTATION(-1)(some_expr) in her model, then a new aux variable is created, and this var is a state var, which appears in the decision rules as EXPECTATION(-1)(...) (with the dots instead of the expression). This is not very informative. Displaying the full expression would require to add a new writeOutput method in the preprocessor.
And for something like EXPECTATION(-2)(some_expr), it is even worse, because there are 2 aux vars: one for the operator, and the second one which appears when removing lags of 2. It is the latter which appears in stoch_simul. Fixing this requires to fix the orig_endo field of M_.aux_vars in that case.
Currently, if the user inputs EXPECTATION(-1)(some_expr) in her model, then a new aux variable is created, and this var is a state var, which appears in the decision rules as EXPECTATION(-1)(...) (with the dots instead of the expression). This is not very informative. Displaying the full expression would require to add a new writeOutput method in the preprocessor.
And for something like EXPECTATION(-2)(some_expr), it is even worse, because there are 2 aux vars: one for the operator, and the second one which appears when removing lags of 2. It is the latter which appears in stoch_simul. Fixing this requires to fix the orig_endo field of M_.aux_vars in that case.
https://git.dynare.org/Dynare/dynare/-/issues/644support mcmc_* options wherever there's an mh_* option2019-11-21T08:36:45ZHoutan Bastanisupport mcmc_* options wherever there's an mh_* optionas mcmc is more general than mh. support mh_\* for backwards compatibility.
as mcmc is more general than mh. support mh_\* for backwards compatibility.
https://git.dynare.org/Dynare/dynare/-/issues/1204Crash in unstable mex when called from parallel workers2019-11-21T08:36:45ZTom HoldenCrash in unstable mex when called from parallel workersI'm afraid I don't have time to produce a minimal example of this bug now, but I'll leave the replication steps here in case anyone else does.
1) Download my version of Dynare, with sub-modules from https://github.com/tholden/dynare
2) Replace the files in the mex subfolder with those from the latest unstable.
3) Browse to the dynare\examples\nonlinear-estimation directory within MATLAB, and then execute `dynare NKNonCentralEstimate.mod`
4) Note that Dynare correctly calculates the initial likelihood, but then when it starts calculating the first numerical derivative of the likelihood, in parallel, each of the parallel workers crash in turn.
5) Reset the repository so you have my compiled MEX. Rerun the same test and observe that the parallel workers do not crash.
I would strongly expect that in fact you don't need to use my version of Dynare, or to use my code for estimating an approximation around the mean, and in the latest unstable this ought to be present whenever you evaluate the likelihood in parallel.
I'm afraid I don't have time to produce a minimal example of this bug now, but I'll leave the replication steps here in case anyone else does.
1) Download my version of Dynare, with sub-modules from https://github.com/tholden/dynare
2) Replace the files in the mex subfolder with those from the latest unstable.
3) Browse to the dynare\examples\nonlinear-estimation directory within MATLAB, and then execute `dynare NKNonCentralEstimate.mod`
4) Note that Dynare correctly calculates the initial likelihood, but then when it starts calculating the first numerical derivative of the likelihood, in parallel, each of the parallel workers crash in turn.
5) Reset the repository so you have my compiled MEX. Rerun the same test and observe that the parallel workers do not crash.
I would strongly expect that in fact you don't need to use my version of Dynare, or to use my code for estimating an approximation around the mean, and in the latest unstable this ought to be present whenever you evaluate the likelihood in parallel.
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/832Use dseries objects in Dynare2019-11-21T08:36:45ZStéphane Adjemianstepan@adjemian.euUse dseries objects in DynareIn the current state, `dseries` objects can be used in matlab scripts and in Dynare's mod file to create and manipulate datasets. The next step is to integrate more deeply the `dseries` class and Dynare. Whenever possible the output of Dynare will be `dseries` objects (IRFs, forecasts, ...) and also we will allow the use of `dseries` objects as inputs to Dynare's command (`data`, content of `initval`, data for conditional forecasts, ...).
- [ ] Document the `data` command (new data interface).
- [ ] Save results as `dseries` objects.
- [x] Polish and document the from-to-do syntax.
- [ ] Add the possibility to pass `dseries`to `initial``and``histval``commands.
In the current state, `dseries` objects can be used in matlab scripts and in Dynare's mod file to create and manipulate datasets. The next step is to integrate more deeply the `dseries` class and Dynare. Whenever possible the output of Dynare will be `dseries` objects (IRFs, forecasts, ...) and also we will allow the use of `dseries` objects as inputs to Dynare's command (`data`, content of `initval`, data for conditional forecasts, ...).
- [ ] Document the `data` command (new data interface).
- [ ] Save results as `dseries` objects.
- [x] Polish and document the from-to-do syntax.
- [ ] Add the possibility to pass `dseries`to `initial``and``histval``commands.
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/642Support Dirichlet prior distribution2019-11-21T08:36:45ZHoutan BastaniSupport Dirichlet prior distributionAdding dirichlet to the prior shape option for #568. Needs to be supported in estimation as well.
Adding dirichlet to the prior shape option for #568. Needs to be supported in estimation as well.
https://git.dynare.org/Dynare/dynare/-/issues/1195Fix parallel error/warning on Windows systems2019-11-21T08:36:44ZJohannes Pfeifer Fix parallel error/warning on Windows systems`dynareParallelDelete.m` has in line 51 a delete statment containing a `$` sign, which is not valid Windows code.
`dynareParallelDelete.m` has in line 51 a delete statment containing a `$` sign, which is not valid Windows code.
Marco RattoMarco Rattohttps://git.dynare.org/Dynare/dynare/-/issues/1063Make output of dsge_var_likelihood accessible2019-11-21T08:36:44ZJohannes Pfeifer Make output of dsge_var_likelihood accessibleSee the discussions in http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=7315 and http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2920
See the discussions in http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=7315 and http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2920
https://git.dynare.org/Dynare/dynare/-/issues/1060Add capabilities for pseudo out of sample forecasting2019-11-21T08:36:44ZJohannes Pfeifer Add capabilities for pseudo out of sample forecastingAllow estimating model parameters on one part of the data and then, holding the estimated parameters fixed, forecast observations after the end of the sample used for estimation. See discussion on mailing list from September 14, 2015
Allow estimating model parameters on one part of the data and then, holding the estimated parameters fixed, forecast observations after the end of the sample used for estimation. See discussion on mailing list from September 14, 2015
https://git.dynare.org/Dynare/dynare/-/issues/1113Make Dynare compatible with Octave 4.22019-11-21T08:36:44ZJohannes Pfeifer Make Dynare compatible with Octave 4.2Requires among other things dealing with the mex-files, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=7570
Requires among other things dealing with the mex-files, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=7570
MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/1066Skip dynare initialization when run with noclearall when dynare has previousl...2019-11-21T08:36:44ZTom HoldenSkip dynare initialization when run with noclearall when dynare has previously runThe below is a feature request which seems particularly pertinent in light of https://github.com/DynareTeam/dynare/issues/1057 :
In code that calls dynare repeatedly with noclearall, the time spent in Dynare's initialization can be a non-trivial contribution.
Can we set a global flag when Dynare is initialized (e.g. paths set, mex files found, etc.), and skip as much as possible on subsequent runs?
The below is a feature request which seems particularly pertinent in light of https://github.com/DynareTeam/dynare/issues/1057 :
In code that calls dynare repeatedly with noclearall, the time spent in Dynare's initialization can be a non-trivial contribution.
Can we set a global flag when Dynare is initialized (e.g. paths set, mex files found, etc.), and skip as much as possible on subsequent runs?
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/386k_order_perturbation MEX: error messages are uninformative2019-11-21T08:36:44ZMichelJuillardk_order_perturbation MEX: error messages are uninformativeThe k_order_perturbation MEX doesn't return error information similar to the ones that we have in the MATLAB code for 1st and 2nd order solution. This will create a problem if we want to use the MEX for nonlinear estimation.
The k_order_perturbation MEX doesn't return error information similar to the ones that we have in the MATLAB code for 1st and 2nd order solution. This will create a problem if we want to use the MEX for nonlinear estimation.
Sébastien VillemotSébastien Villemot