dynare issueshttps://git.dynare.org/Dynare/dynare/-/issues2018-09-10T12:35:46Zhttps://git.dynare.org/Dynare/dynare/-/issues/1614Identification display bug2018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.euIdentification display bug*Created by: wmutschl*
Hi @rattoma , I just noticed a bug in the identification toolbox when only checking for unidentified parameters without any other parameters, as Dynare prints that all parameters are identified even though the fig...*Created by: wmutschl*
Hi @rattoma , I just noticed a bug in the identification toolbox when only checking for unidentified parameters without any other parameters, as Dynare prints that all parameters are identified even though the figures etc do not suggest so. This is probably just a small bug in the display function.
To replicate the bug (I use Dynare unstable from June, 3 and Matlab R2017b):
1) Open kim2.mod in the test files for identification
2) Change
>estimated_params;
alph ,uniform_pdf,0.6,0.04,0.5,0.7;
//betae ,uniform_pdf,0.99,0.004,0.98,1;
//delta ,uniform_pdf,0.0125,0.001,0.01,0.015;
phi ,uniform_pdf,0.5,0.2,0,10;
theta ,uniform_pdf,0.3,0.1,0,10;
dumpy ,uniform_pdf,0.5,0.2,0,10;
end;
to
> estimated_params;
//alph ,uniform_pdf,0.6,0.04,0.5,0.7;
//betae ,uniform_pdf,0.99,0.004,0.98,1;
//delta ,uniform_pdf,0.0125,0.001,0.01,0.015;
phi ,uniform_pdf,0.5,0.2,0,10;
theta ,uniform_pdf,0.3,0.1,0,10;
//dumpy ,uniform_pdf,0.5,0.2,0,10;
end;
That is, only include colinear parameters.
3) Run "dynare kim2" and the output is
>==== Identification analysis ====
Testing prior mean
Evaluating simulated moment uncertainty ... please wait
Doing 100 replicas of length 300 periods.
Simulated moment uncertainty ... done!
All parameters are identified in the model (rank of H).
All parameters are identified by J moments (rank of J)
Press ENTER to print advanced diagnostics
Collinearity patterns with 1 parameter(s)
Parameter [ Expl. params ] cosn
phi [ theta ] 1.0000000
theta [ phi ] 1.0000000
Press ENTER to plot advanced diagnostics
==== Identification analysis completed ====
which is contradicting. If one includes e.g. dumpy or alpha (or both or any other parameter) in the estimated_params section, dynare correctly displays you that [phi;theta] are colinear and not identified.https://git.dynare.org/Dynare/dynare/-/issues/1626Dynare++ Program killed by itself2019-07-05T12:16:40ZStéphane Adjemianstepan@adjemian.euDynare++ Program killed by itself*Created by: awindbells*
I am solving a large model. The model is solved successfully on Mac up to 5th order approximation. When I try solve the model on Windows, or Linux server, it solves 3rd order in seconds, the program is "killed" ...*Created by: awindbells*
I am solving a large model. The model is solved successfully on Mac up to 5th order approximation. When I try solve the model on Windows, or Linux server, it solves 3rd order in seconds, the program is "killed" by the system or by the program at 4th order after a few seconds of running. The cpu utilization is below 40% when killed, and memory usage is minimal. There is no other error message, except "killed" at the end. There is no issue solving a small model up to 5th on windows or linux. I would appreciate any explanations, remedies, or suggestions. Thanks.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1625Discuss implementing a steady_state_relation-block2019-12-03T14:19:24ZJohannes PfeiferDiscuss implementing a steady_state_relation-blockSteady state finding in large economic models is hard. Currently, the user needs to manually implement a full steady state or reduce the problem and then call a solver. See e.g. https://forum.dynare.org/t/how-to-solve-steady-state-in-lar...Steady state finding in large economic models is hard. Currently, the user needs to manually implement a full steady state or reduce the problem and then call a solver. See e.g. https://forum.dynare.org/t/how-to-solve-steady-state-in-large-scale-dsge-models/12185/2
I wonder if it would be useful and feasible to introduce something like a `steady_state_relation`-block that allows specifying analytical steady state relations that Dynare could use in the `_static`-file to substitute out some variable and thus reduce the size of the problem (essentially introducing a model-local variable for the static model). An example would be
```
steady_state_relation;
u=1;
R=1/beta;
Pi=1;
i_nom=R*Pi;
I=delta*K;
end;
```
Combined with `initval` this would make finding a steady state much easier.https://git.dynare.org/Dynare/dynare/-/issues/1622Fix posterior_sampler_initialization>set_proposal_density_to_previous_value2019-09-07T05:27:10ZJohannes PfeiferFix posterior_sampler_initialization>set_proposal_density_to_previous_valueIn case of the `record`-structure not containing the required fields, the output argument of the private function at the bottom of the file are not set, crashing Matlab.In case of the `record`-structure not containing the required fields, the output argument of the private function at the bottom of the file are not set, crashing Matlab.https://git.dynare.org/Dynare/dynare/-/issues/1612Build failed in Arch Linux2018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.euBuild failed in Arch Linux*Created by: angelosalton*
Tried to build from 4.5.4 sources (against Octave 4.4.0), with the following error:
```
In file included from ../../../../contrib/ms-sbvar/utilities_dw/include/dw_std.h:23,
from ../../../...*Created by: angelosalton*
Tried to build from 4.5.4 sources (against Octave 4.4.0), with the following error:
```
In file included from ../../../../contrib/ms-sbvar/utilities_dw/include/dw_std.h:23,
from ../../../../contrib/ms-sbvar/switch_dw/switching/dw_switch.c:25:
../../../sources/ms-sbvar/modify_for_mex.h:39:12: fatal error: octave/config.h: File or folder not found
# include <octave/config.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
```
I'm pretty sure all necessary dependencies are met. I wonder if a header file for Octave is missing.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1611Make dynare_sensitivity compatible with recursive estimation or provide infor...2024-01-17T20:31:14ZJohannes PfeiferMake dynare_sensitivity compatible with recursive estimation or provide informative errorSee https://forum.dynare.org/t/calculating-rmses/11903See https://forum.dynare.org/t/calculating-rmses/119036.xhttps://git.dynare.org/Dynare/dynare/-/issues/1610Make estimated_params_init robust to wrongly specified parameters2018-10-25T10:37:22ZJohannes PfeiferMake estimated_params_init robust to wrongly specified parametersThe file
```
/*
* This file replicates the estimation of the cash in advance model (termed M1
* in the paper) described in Frank Schorfheide (2000): "Loss function-based
* evaluation of DSGE models", Journal of Applied Econome...The file
```
/*
* This file replicates the estimation of the cash in advance model (termed M1
* in the paper) described in Frank Schorfheide (2000): "Loss function-based
* evaluation of DSGE models", Journal of Applied Econometrics, 15(6), 645-670.
*
* The data are in file "fsdat_simul.m", and have been artificially generated.
* They are therefore different from the original dataset used by Schorfheide.
*
* The prior distribution follows the one originally specified in Schorfheide's
* paper, except for parameter rho. In the paper, the elicited beta prior for rho
* implies an asymptote and corresponding prior mode at 0. It is generally
* recommended to avoid this extreme type of prior. Some optimizers, for instance
* mode_compute=12 (Mathworks' particleswarm algorithm) may find a posterior mode
* with rho equal to zero. We lowered the value of the prior standard deviation
* (changing .223 to .100) to remove the asymptote.
*
* The equations are taken from J. Nason and T. Cogley (1994): "Testing the
* implications of long-run neutrality for monetary business cycle models",
* Journal of Applied Econometrics, 9, S37-S70.
* Note that there is an initial minus sign missing in equation (A1), p. S63.
*
* This implementation was originally written by Michel Juillard. Please note that the
* following copyright notice only applies to this Dynare implementation of the
* model.
*/
/*
* Copyright (C) 2004-2017 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 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;
alp = 0.33;
bet = 0.99;
gam = 0.003;
mst = 1.011;
rho = 0.7;
psi = 0.787;
del = 0.02;
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;
shocks;
var e_a; stderr 0.014;
var e_m; stderr 0.005;
end;
steady_state_model;
dA = exp(gam);
gst = 1/dA;
m = mst;
khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );
n = xist/(nust+xist);
P = xist + nust;
k = khst*n;
l = psi*mst*n/( (1-psi)*(1-n) );
c = mst/P;
d = l - mst + 1;
y = k^alp*n^(1-alp)*gst^alp;
R = mst/bet;
W = l/n;
ist = y-c;
q = 1 - d;
e = 1;
gp_obs = m/dA;
gy_obs = dA;
end;
steady;
check;
estimated_params;
alp, beta_pdf, 0.356, 0.02;
bet, beta_pdf, 0.993, 0.002;
gam, normal_pdf, 0.0085, 0.003;
mst, normal_pdf, 1.0002, 0.007;
rho, beta_pdf, 0.129, 0.100;
psi, beta_pdf, 0.65, 0.05;
% del, beta_pdf, 0.01, 0.005;
% stderr e_a, inv_gamma_pdf, 0.035449, inf;
stderr e_m, inv_gamma_pdf, 0.008862, inf;
end;
estimated_params_init;
del,0.02;
stderr e_a, 0.01;
corr e_a,e_m, 0.5;
end;
varobs gp_obs gy_obs;
estimation(order=1, datafile=fsdat_simul, nobs=192, loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8);
```
crashes with a cryptic message, because a correlation is initialized that is not estimated. For structural parameters, there is no error. We should make the behavior informative and consistent4.6Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1604dynare.org down (just http and https)2018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.eudynare.org down (just http and https)*Created by: tpapp*
```sh
$ nslookup dynare.org
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: dynare.org
Address: 92.243.14.31
$ ping dynare.org
PING dynare.org (92.243.14.31) 56(...*Created by: tpapp*
```sh
$ nslookup dynare.org
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: dynare.org
Address: 92.243.14.31
$ ping dynare.org
PING dynare.org (92.243.14.31) 56(84) bytes of data.
64 bytes from kirikou.cepremap.org (92.243.14.31): icmp_seq=1 ttl=48 time=46.9 ms
64 bytes from kirikou.cepremap.org (92.243.14.31): icmp_seq=2 ttl=48 time=46.6 ms
64 bytes from kirikou.cepremap.org (92.243.14.31): icmp_seq=3 ttl=48 time=45.5 ms
^C
--- dynare.org ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 45.578/46.415/46.991/0.655 ms
$ wget dynare.org
--2018-04-11 12:57:51-- http://dynare.org/
Resolving dynare.org (dynare.org)... 92.243.14.31
Connecting to dynare.org (dynare.org)|92.243.14.31|:80... failed: Connection refused.
$ wget https://dynare.org
--2018-04-11 12:58:22-- https://dynare.org/
Resolving dynare.org (dynare.org)... 92.243.14.31
Connecting to dynare.org (dynare.org)|92.243.14.31|:443... failed: Connection refused.
```https://git.dynare.org/Dynare/dynare/-/issues/1606Fix bug or document behavior of mcp2019-04-26T18:17:04ZJohannes PfeiferFix bug or document behavior of mcpSee https://forum.dynare.org/t/perfect-foresight-simulation-failed/11638/5See https://forum.dynare.org/t/perfect-foresight-simulation-failed/11638/5Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1599octave option requires -std-c++142018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.euoctave option requires -std-c++14*Created by: yurivict*
dynare fails to build without -std-c++14 now after octave update.
Found in the FreeBSD port.
*Created by: yurivict*
dynare fails to build without -std-c++14 now after octave update.
Found in the FreeBSD port.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1605Better document behavior of steady_state operator2021-08-17T10:23:21ZJohannes PfeiferBetter document behavior of steady_state operatorSee https://forum.dynare.org/t/steady-state-command-in-perfect-foresight-simulations/11632/3See https://forum.dynare.org/t/steady-state-command-in-perfect-foresight-simulations/11632/3https://git.dynare.org/Dynare/dynare/-/issues/1621Apparent bug with empty strings in 4.6-unstable-474556e0ca6a3b24638d69c883ce2...2018-09-10T12:35:46ZTom HoldenApparent bug with empty strings in 4.6-unstable-474556e0ca6a3b24638d69c883ce255886268adfI was trying to test this build: https://dynare.adjemian.eu/dynare-4.6-unstable-474556e-win.exe
as instructed in this issue thread: https://github.com/DynareTeam/dynare/issues/1490
The example I found the aforementioned issue on prev...I was trying to test this build: https://dynare.adjemian.eu/dynare-4.6-unstable-474556e-win.exe
as instructed in this issue thread: https://github.com/DynareTeam/dynare/issues/1490
The example I found the aforementioned issue on previously included some empty strings. In this Dynare Unstable, these seem to result in an incorrect pre-processor error.
Saving the following three lines is a MOD file generates a pre-processor error in this version:
@#define StringArray = ""
parameters p;
p = 1;
However, if you put something inside the double quotes, it runs fine. It also runs fine on Dynare 4.5.5 even with the empty string.
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1600look at preprocessor `output` option2021-01-19T09:49:57ZHoutan Bastanilook at preprocessor `output` optionWhat is `dynamic` used for?
Look at printing in `DynareMain2.cc`. Why do we switch on `output_mode` ?What is `dynamic` used for?
Look at printing in `DynareMain2.cc`. Why do we switch on `output_mode` ?5.xSébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1616Fix perfect_foresight_solver with lags and leads on exogenous variables2018-09-10T12:35:46ZJohannes PfeiferFix perfect_foresight_solver with lags and leads on exogenous variablesThe following modification of our test-file where the shock is now `EfficiencyInnovation(-2)` instead of contemporaneous does not work, despite us already being at the solution with `histval`:
```
var Capital, Output, Labour, Consumpti...The following modification of our test-file where the shock is now `EfficiencyInnovation(-2)` instead of contemporaneous does not work, despite us already being at the solution with `histval`:
```
var Capital, Output, Labour, Consumption, Efficiency, efficiency, ExpectedTerm;
varexo EfficiencyInnovation;
parameters beta, theta, tau, alpha, psi, delta, rho, effstar, sigma2;
beta = 0.9900;
theta = 0.3570;
tau = 2.0000;
alpha = 0.4500;
psi = -0.1000;
delta = 0.0200;
rho = 0.8000;
effstar = 1.0000;
sigma2 = 0;
model;
// Eq. n°1:
efficiency = rho*efficiency(-1) + EfficiencyInnovation(-2);
// Eq. n°2:
Efficiency = effstar*exp(efficiency);
// Eq. n°3:
Output = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour^psi))^(1/psi);
// Eq. n°4:
Capital = Output-Consumption + (1-delta)*Capital(-1);
// Eq. n°5:
((1-theta)/theta)*(Consumption/(1-Labour)) - (1-alpha)*(Output/Labour)^(1-psi);
// Eq. n°6:
(((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption = ExpectedTerm(1);
// Eq. n°7:
ExpectedTerm = beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+(1-delta));
end;
steady_state_model;
efficiency = EfficiencyInnovation/(1-rho);
Efficiency = effstar*exp(efficiency);
Output_per_unit_of_Capital=((1/beta-1+delta)/alpha)^(1/(1-psi));
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-delta;
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/Efficiency)^psi-alpha)/(1-alpha))^(1/psi);
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital;
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital;
% Compute steady state share of capital.
ShareOfCapital=alpha/(alpha+(1-alpha)*Labour_per_unit_of_Capital^psi);
% Compute steady state of the endogenous variables.
Labour=1/(1+Consumption_per_unit_of_Labour/((1-alpha)*theta/(1-theta)*Output_per_unit_of_Labour^(1-psi)));
Consumption=Consumption_per_unit_of_Labour*Labour;
Capital=Labour/Labour_per_unit_of_Capital;
Output=Output_per_unit_of_Capital*Capital;
ExpectedTerm=beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)
*(alpha*((Output/Capital)^(1-psi))+1-delta);
end;
steady;
ik = varlist_indices('Capital',M_.endo_names);
CapitalSS = oo_.steady_state(ik);
histval;
Capital(0) = CapitalSS;
end;
perfect_foresight_setup(periods=200);
perfect_foresight_solver(stack_solve_algo=7,solve_algo=1);
if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed')
end
rplot Consumption;
rplot Capital;
D = load('rbc_det_results');
if norm(D.oo_.endo_simul - oo_.endo_simul) > 1e-30;
disp(norm(D.oo_.endo_simul - oo_.endo_simul));
error('rbc_det_stack_solve_algo_7 failed');
end;
options_.dynatol.f=1e-10;
@#define J = [0,1,2,3,4,9,10]
@#for solve_algo_iter in J
perfect_foresight_setup(periods=200);
perfect_foresight_solver(stack_solve_algo=7,solve_algo=@{solve_algo_iter});
if ~oo_.deterministic_simulation.status
error('Perfect foresight simulation failed')
end
rplot Consumption;
rplot Capital;
D = load('rbc_det_results');
if isoctave && options_.solve_algo==0
%%acount for somehow weaker convergence criterion in Octave's fsolve
tol_crit=1e-4;
else
tol_crit=1e-8;
end
if norm(D.oo_.endo_simul - oo_.endo_simul) > tol_crit;
disp(norm(D.oo_.endo_simul - oo_.endo_simul));
error(sprintf('rbc_det_stack_solve_algo_7 failed with solve_algo=%u',options_.solve_algo));
end;
@#endfor
```
This is related to https://github.com/DynareTeam/dynare/commit/8913791ff0972f8a56d6c5d0d325d1cb6fda7189#commitcomment-29281838
We should add the above file with
```
histval;
Capital(0) = CapitalSS/2;
end;
```
to the testsuite. A similar case with a leaded exogenous variable should also be added.https://git.dynare.org/Dynare/dynare/-/issues/1597Accept UTF-8 in .mod file2021-08-17T10:56:01ZHoutan BastaniAccept UTF-8 in .mod filehttps://git.dynare.org/Dynare/dynare/-/issues/1609Fix bug in mjdgges.mex2018-09-10T12:35:46ZJohannes PfeiferFix bug in mjdgges.mexSee email from 04/22/18.
```[err, ss, tt, w, sdim, dr.eigval, info1] = mjdgges(E, D, DynareOptions.qz_criterium, DynareOptions.qz_zero_threshold);```
returns ```sdim=6.``` However, manually computing `sdim` based on the returned `dr.ei...See email from 04/22/18.
```[err, ss, tt, w, sdim, dr.eigval, info1] = mjdgges(E, D, DynareOptions.qz_criterium, DynareOptions.qz_zero_threshold);```
returns ```sdim=6.``` However, manually computing `sdim` based on the returned `dr.eigval` via
```
sum(abs(dr.eigval) < DynareOptions.qz_criterium)
```
returns 8.
https://git.dynare.org/Dynare/dynare/-/issues/1596add maximum lag info by variable2021-08-17T10:56:46ZHoutan Bastaniadd maximum lag info by variable```
M_.maximum_endo_lag_by_var = [ ... ];
M_.maximum_exo_lag_by_var = [ ... ];
```
Where the vectors are the length of `M_.orig_endo_nbr````
M_.maximum_endo_lag_by_var = [ ... ];
M_.maximum_exo_lag_by_var = [ ... ];
```
Where the vectors are the length of `M_.orig_endo_nbr`https://git.dynare.org/Dynare/dynare/-/issues/1608Fix forecast at order=2 with linear model and varexo_det2018-09-10T12:35:46ZJohannes PfeiferFix forecast at order=2 with linear model and varexo_detThe mod-file
```
var y, pi, i, g, u, k;
varexo e_g e_u e_k;
varexo_det gov;
parameters lambda, pi_target, y_target, phi_pi, phi, rho, rhoout, rhopi, rhoint, sigma1, sigma2, sigma3;
lambda = 0.3;
pi_target = 0;
y_target ...The mod-file
```
var y, pi, i, g, u, k;
varexo e_g e_u e_k;
varexo_det gov;
parameters lambda, pi_target, y_target, phi_pi, phi, rho, rhoout, rhopi, rhoint, sigma1, sigma2, sigma3;
lambda = 0.3;
pi_target = 0;
y_target = 0;
phi_pi = 1.5;
phi = 1;
rho = 0.99;
T = 50;
rhoout = 0.8;
rhopi = 0.5;
rhoint = 0;
sigma1 = 1;
sigma2 = 1;
sigma3 = 1;
model(linear);
y=y(+1)-phi*(i-pi(+1))+gov+g;
pi=lambda*y+rho*pi(+1)+u;
i=phi_pi*(pi-pi_target)+k;
g=rhoout*g(-1)+e_g;
u=rhopi*u(-1)+e_u;
k=rhoint*k(-1)+e_k;
end;
steady;
check;
shocks;
var e_g;
stderr sigma1;
var e_u;
stderr sigma2;
var e_k;
stderr sigma3;
var gov;
periods 1:9;
values 0.2;
end;
stoch_simul(irf=0);
forecast;
```
crashes, because `forecast` relies on the original `options_.order` and the precomputed decision rules. But given the linear model, `stoch_simul` used `order=1`. Thus, the default does not work anymore.Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1607Fix prior sampler2018-09-10T12:35:46ZJohannes PfeiferFix prior sampler`prior simulate` in `cli/prior.m` calls
```
results = prior_sampler(0, Model, BayesOptions, options_, oo_, EstimatedParams);
```
where the 0 indicates that no decision rules need to be saved. The problem is that this flag `drsave` i...`prior simulate` in `cli/prior.m` calls
```
results = prior_sampler(0, Model, BayesOptions, options_, oo_, EstimatedParams);
```
where the 0 indicates that no decision rules need to be saved. The problem is that this flag `drsave` is then used to call `resol` with
```
work = ~drsave;
[dr,INFO,M_,options_,oo_] = resol(work,M_,options_,oo_);
```
so that `resol` only computes eigenvalue, but not BK conditions etc. As a result, the reported simulations will never fail the BK conditions. See https://forum.dynare.org/t/determinacy-prior-simulate-puzzle/11681
https://git.dynare.org/Dynare/dynare/-/issues/1593Add truncated priors2023-09-07T06:56:27ZJohannes PfeiferAdd truncated priorsFollowing the discussions in #1591 and #750, we currently do not have a way to introduce a proper truncated prior. But this is an often requested feature that e.g. @rattoma would like to have. Waiting for the new estimation interface (e....Following the discussions in #1591 and #750, we currently do not have a way to introduce a proper truncated prior. But this is an often requested feature that e.g. @rattoma would like to have. Waiting for the new estimation interface (e.g. #824 and #846) seems to long to wait.
My specific proposal would be to add a new token `truncated_norm_pdf` that uses the third and fourth hyperparameter (which is usually reserved for generalized (beta) distributions) to specify the truncation. I consider this a natural interpretation of these hyperparameters for the normal distribution.
@stepan-a What do you think?
@rattoma Woud that satisfy your immediate needs? Or do you need a truncated distribution other than the normal?6.xJohannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/1602Fix predetermined_variables command with model-local variables2018-11-12T16:16:12ZJohannes PfeiferFix predetermined_variables command with model-local variablesThe mod-file
```
@#define predet=1
var K q;
@#if predet
predetermined_variables K;
@#endif
parameters
a b delta r alpha dt
K_inf q_inf;
a=1;
b=1;
delta = 0.023;
alpha = 0.33;
r = 0.01;
dt=1;
q_inf = 1+(1+a)*b*...The mod-file
```
@#define predet=1
var K q;
@#if predet
predetermined_variables K;
@#endif
parameters
a b delta r alpha dt
K_inf q_inf;
a=1;
b=1;
delta = 0.023;
alpha = 0.33;
r = 0.01;
dt=1;
q_inf = 1+(1+a)*b*delta^a;
K_inf = (((r+delta)*q_inf-a*b*delta^(a+1))/alpha)^(1/(alpha-1));
@#if predet==0
// Model block without predetermined_variables statement
model;
# I = K(-1)*((q-1)/((1+a)*b))^(1/a);
# w = alpha*K(-1)^(alpha-1)+a*b*(I/K(-1))^(a+1);
K = K(-1) + (I-delta*K(-1))*dt;
q(+1) = q + (r+delta)*q*dt - w*dt;
end;
@#else
// Model block with predetermined_variables statement
model;
# I = K*((q-1)/((1+a)*b))^(1/a);
# w = alpha*K^(alpha-1)+a*b*(I/K)^(a+1);
K(+1) = K + (I-delta*K)*dt;
q(+1) = q + (r+delta)*q*dt - w*dt;
end;
@#endif
steady_state_model;
K = K_inf;
q = q_inf;
end;
initval;
K = 20;
q = q_inf;
end;
endval;
K = K_inf;
q = q_inf1;
end;
check;
simul(periods=100, tolx=1e-12, tolf=1e-12, no_homotopy);
# I = K*((q-1)/((1+a)*b))^(1/a);
# w = alpha*K^(alpha-1)+a*b*(I/K)^(a+1);
K(+1) = K + (I-delta*K)*dt;
rplot K;
rplot q;
```
yields wrong results. The relevant parts of the dynamic file corresponding to
```
# I = K*((q-1)/((1+a)*b))^(1/a);
K(+1) = K + (I-delta*K)*dt;
```
are
```
I__ = y(2)*((y(3)-1)/((1+params(1))*params(2)))^(1/params(1));
lhs =y(2);
rhs =y(1)+params(6)*(I__-params(3)*y(1));
```
Here, `y(1)` stores `K` and `y(2)` stores `K(+1)`. As can be seen, in the created model-local variable, the capital stock is not shifted backwards, despite the `predetermined_variables` statement.
Upon fixing this, we should turn the file into a unit test.4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1584Update and potentially fix installation information for mac2018-11-08T11:54:18ZJohannes PfeiferUpdate and potentially fix installation information for macSee https://forum.dynare.org/t/installing-dynare-no-longer-available-on-homebrew/11259See https://forum.dynare.org/t/installing-dynare-no-longer-available-on-homebrew/11259Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1601dates: uninformative error message2018-09-10T12:35:46ZMichelJuillarddates: uninformative error messageIn ``dates`` if the date format is not recognized the error message is "You should first read the manual". This isn't helpful. Furthermore, inside Dynare, if this problem occurs in the datafile, there is no reference to the ``dates`` mod...In ``dates`` if the date format is not recognized the error message is "You should first read the manual". This isn't helpful. Furthermore, inside Dynare, if this problem occurs in the datafile, there is no reference to the ``dates`` module. https://git.dynare.org/Dynare/dynare/-/issues/1586Document initial_condition_decomposition and make it an official feature2019-12-09T14:54:10ZJohannes PfeiferDocument initial_condition_decomposition and make it an official featureStill missing from https://github.com/DynareTeam/dynare/pull/1421Still missing from https://github.com/DynareTeam/dynare/pull/14214.6https://git.dynare.org/Dynare/dynare/-/issues/1567Silent crash when calculating steady state variables of basic economic model2018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.euSilent crash when calculating steady state variables of basic economic model*Created by: wtpfede*
Hi all,
I'm using Dynarec to reimplement a basic Ramsey model from Ohanian and Cole (1999)
The code is as follows:
```
varexo e; %e are tfp shocks
var y, c, n, k, x, z, i;
parameters theta, beta, rho, d...*Created by: wtpfede*
Hi all,
I'm using Dynarec to reimplement a basic Ramsey model from Ohanian and Cole (1999)
The code is as follows:
```
varexo e; %e are tfp shocks
var y, c, n, k, x, z, i;
parameters theta, beta, rho, delta, gamma, biga;
theta=0.33;
beta=.96;
delta = 0.10;
rho=0.9;
gamma = 0.019;
biga = 0.78;
model;
(1/c) = beta*(1/c(+1))*( 1- delta+ z(+1)*(x(+1)*n(+1))^(1-theta)* theta*(k(+1))^(theta-1)) ;
biga/(1-n)=(1/c)*((1-theta)*z*(k^theta)*(x*n)^(-theta)*x) ;
z=(1-rho)+rho*z(-1)+e ;
i=z*y-c;
k(+1)=i+(1-delta)*k ;
y=(k^theta)*(x*n)^(1-theta) ;
x=(1+gamma)*x(-1) ;
end;
initval;
y = 0.184068;
c = 0.127782;
n = 1/3;
k = 0.0562866;
x = 1;
z = 0.1;
i = 0.0562866;
end;
check;
steady;
```
Unfortunately, Dynarec crashes silently.
All of the parameters and the equations have been double checked by our team, and the numerical values come straight from the original paper.
We are on Octave 4.2.1 and Dynare 4.5.3.
If anyone has any pointers or could confirm this as a bug, this would be extremely helpful.
https://git.dynare.org/Dynare/dynare/-/issues/1579Make fast realtime decomposition use the proper nobs2019-12-03T13:56:27ZJohannes PfeiferMake fast realtime decomposition use the proper nobsSee https://github.com/DynareTeam/dynare/pull/1563#issuecomment-357180435
See https://github.com/DynareTeam/dynare/pull/1563#issuecomment-357180435
4.6https://git.dynare.org/Dynare/dynare/-/issues/1576Provide steady state file example for Ramsey2020-11-13T14:38:25ZJohannes PfeiferProvide steady state file example for RamseyThe final loop should most probably be
```
NumberOfEndogenousVariables = M_.endo_nbr; % Number of endogenous variables.
ys = zeros(NumberOfEndogenousVariables,1); % Initialization of ys (steady state...The final loop should most probably be
```
NumberOfEndogenousVariables = M_.endo_nbr; % Number of endogenous variables.
ys = zeros(NumberOfEndogenousVariables,1); % Initialization of ys (steady state).
for i = M_.ramsey_eq_nbr+1:NumberOfEndogenousVariables % Loop...
varname = deblank(M_.endo_names(i-M_.ramsey_eq_nbr,:)); % Get the name of endogenous variable i.
eval(['ys(' int2str(i) ') = ' varname ';']); % Get the steady state value of this variable.
end % End of the loop.
```Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/1598Add a routine for setting automajically the value of mh_jscale...2018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.euAdd a routine for setting automajically the value of mh_jscale...so that the acceptance ratio is close to an arbitrary target.
This already done with `mode_compute=6`, but we need to port to other optimization routines.
so that the acceptance ratio is close to an arbitrary target.
This already done with `mode_compute=6`, but we need to port to other optimization routines.
4.6Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1573Allow mode_compute to be a vector2023-09-20T08:18:23ZJohannes PfeiferAllow mode_compute to be a vectorAllow `mode_compute` to be a vector and the sequentially execute the mode-finders specified. See e.g. https://forum.dynare.org/t/simulated-annealing-block/11052 for why this may be useful.Allow `mode_compute` to be a vector and the sequentially execute the mode-finders specified. See e.g. https://forum.dynare.org/t/simulated-annealing-block/11052 for why this may be useful.6.xhttps://git.dynare.org/Dynare/dynare/-/issues/1587nested @#ifndef and @#ifdef don't work2018-09-10T12:35:46ZHoutan Bastaninested @#ifndef and @#ifdef don't workEmail from @JohannesPfeifer:
If I use
```
@#define risk_sharing = 0
@#if risk_sharing == 0
@#ifndef endogenous_discount_factor
@#define endogenous_discount_factor = 1
@#endif
@#endif
```
In a mod-file, I get...Email from @JohannesPfeifer:
If I use
```
@#define risk_sharing = 0
@#if risk_sharing == 0
@#ifndef endogenous_discount_factor
@#define endogenous_discount_factor = 1
@#endif
@#endif
```
In a mod-file, I get an error
```
@#if/@#ifdef/@#ifndef not matched by an @#endif or file does not end with a new line (unexpected end of file)
```4.5.4Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1575Fix WriteShockDecomp2Excel.m2019-09-24T11:16:39ZJohannes PfeiferFix WriteShockDecomp2Excel.mSee https://forum.dynare.org/t/bug-in-write-xls-option-of-shock-decomposition-after-estimation/11097
On MAC, we rely on `xlwrite` from https://fr.mathworks.com/matlabcentral/fileexchange/38591-xlwrite--generate-xls-x--files-without-exce...See https://forum.dynare.org/t/bug-in-write-xls-option-of-shock-decomposition-after-estimation/11097
On MAC, we rely on `xlwrite` from https://fr.mathworks.com/matlabcentral/fileexchange/38591-xlwrite--generate-xls-x--files-without-excel-on-mac-linux-win without checking whether Excel is installed. If we want to keep this, we need to clearly spell out that users need to install that file. @rattoma What do you think?4.6https://git.dynare.org/Dynare/dynare/-/issues/1588Update Readme for Windows2018-09-10T12:35:46ZJohannes PfeiferUpdate Readme for WindowsThe readme has a line linking to a recommended Octave version (https://github.com/DynareTeam/dynare/blob/48b5839414b96c69c0ea0a0da4b129b0195d7dfe/windows/README.txt#L64), which should be 4.2.1, but http://www.dynare.org/download/octave/w...The readme has a line linking to a recommended Octave version (https://github.com/DynareTeam/dynare/blob/48b5839414b96c69c0ea0a0da4b129b0195d7dfe/windows/README.txt#L64), which should be 4.2.1, but http://www.dynare.org/download/octave/windows only has downloads for 3.8.1https://git.dynare.org/Dynare/dynare/-/issues/1565initial condition decomposition2019-11-29T16:06:44ZMarco Rattoinitial condition decompositionit would be useful to add interface for the following options:
```
nodisplay
graph_format
fig_name
```
Moreover, the preprocessor should give a lhs arg oo_ when translating the command, i.e.:
`oo_ = initial_condition_decomp...it would be useful to add interface for the following options:
```
nodisplay
graph_format
fig_name
```
Moreover, the preprocessor should give a lhs arg oo_ when translating the command, i.e.:
`oo_ = initial_condition_decomposition(M_,oo_,options_,var_list_,bayestopt_,estim_params_);`
so not really new options, but just allow those in the pre-processor. many thanks!4.6https://git.dynare.org/Dynare/dynare/-/issues/1544dataset_ is a dseries and no longer a structure2018-09-10T12:35:46ZStéphane Adjemianstepan@adjemian.eudataset_ is a dseries and no longer a structure*Created by: thomasbrand*
The last commits about `dseries` (between October 10th and October 14th) modified the type of the `dataset_` output in `results.mat`. It was previously a matlab structure, and now it is a `dseries`. The consequ...*Created by: thomasbrand*
The last commits about `dseries` (between October 10th and October 14th) modified the type of the `dataset_` output in `results.mat`. It was previously a matlab structure, and now it is a `dseries`. The consequence is important (for me) because now I need Dynare to read the `dataset_` output.
Was it on purpose or do you think you will go back to a structure ?
Thank you.Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1578macro-processor: allow for nested variables2018-09-10T12:35:46ZJohannes Pfeifermacro-processor: allow for nested variables1. Related to https://forum.dynare.org/t/total-number-of-periods-given-by-variable/11200/3
We should allow
```
@#define J=10
@#define K=1:@{J}
```
but currently the lexer gives an error when encountering the `@{J}` in the second ...1. Related to https://forum.dynare.org/t/total-number-of-periods-given-by-variable/11200/3
We should allow
```
@#define J=10
@#define K=1:@{J}
```
but currently the lexer gives an error when encountering the `@{J}` in the second line.
2. Related to this, according to the manual, we have at the command line
```-DMACRO_VARIABLE=MACRO_EXPRESSION```
But we do not really macro expressions as
`dynare macro.mod -D=[1,2]`
fails.
3. I tried to get around this by using
```
n_countries=2;
fid=fopen('n_countries_def.txt','w+');
fprintf(fid,'@#for co in 1:%u\n',n_countries)
fclose(fid)
```
to write a text file creating the first statement and then using
```
@#include "n_countries_def.txt"
var C_@{co};
@#endfor
```
But this is also not allowed:
```
ERROR in macro-processor: n_countries_def.txt:1.15: @#for loop not matched by an @#endfor or file does not end with a new line (unexpected end of file)
```
because apparently the macro processor checks for completeness of the macro in each included file instead of the whole created file.
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1570Fix steady_state_model-block check with instruments2018-09-10T12:35:47ZJohannes PfeiferFix steady_state_model-block check with instrumentsI have a model with
```
steady_state_model;
Q=1/R;
end;
planner_objective Welfare;
ramsey_model(instruments=(R),planner_discount=betta);
```
This is a proper conditional steady state file, where the instrument is taken as given...I have a model with
```
steady_state_model;
Q=1/R;
end;
planner_objective Welfare;
ramsey_model(instruments=(R),planner_discount=betta);
```
This is a proper conditional steady state file, where the instrument is taken as given. But it results in
```
ERROR: in the 'steady_state_model' block, variable 'R' is undefined in the declaration of variable 'Q'
```
because the preprocessor check does not account for the conditionality.
https://git.dynare.org/Dynare/dynare/-/issues/1564echo list of macro-variables2018-09-10T12:35:47ZMarco Rattoecho list of macro-variableswould it be possible to set a command that prints the value of all macro-variables defined at a given point in the code? I am starting to have lots of macro flags and would be good to have this to trace back which kind of options have be...would it be possible to set a command that prints the value of all macro-variables defined at a given point in the code? I am starting to have lots of macro flags and would be good to have this to trace back which kind of options have been selected for a given experiment.4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1558Allow diffuse_filter as option for dynare_sensitivity2018-09-10T12:35:47ZJohannes PfeiferAllow diffuse_filter as option for dynare_sensitivityhttps://git.dynare.org/Dynare/dynare/-/issues/1173Support estimation under optimal policy2021-07-22T13:33:48ZJohannes PfeiferSupport estimation under optimal policySee http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=8071See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=80715.xSébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1400Investigate dseries problems in parallel execution2021-08-15T19:10:35ZJohannes PfeiferInvestigate dseries problems in parallel executionWhen executing the attached file, which runs the ```UseParallel``` feature of ```fmincon```, a crash results because the dseries data is transformed to a structure:
```
Warning: Element(s) of class 'dseries' do not match the current cons...When executing the attached file, which runs the ```UseParallel``` feature of ```fmincon```, a crash results because the dseries data is transformed to a structure:
```
Warning: Element(s) of class 'dseries' do not match the current constructor definition. The element(s) have been converted to structures.
> In parallel.internal.pool.deserialize (line 9)
In parallel.internal.pool.deserializeFunction (line 12)
In remoteParallelFunction (line 33)
Warning: Element(s) of class 'dates' do not match the current constructor definition. The element(s) have been converted to structures.
> In parallel.internal.pool.deserialize (line 9)
In parallel.internal.pool.deserializeFunction (line 12)
In remoteParallelFunction (line 33)
```
[SW.zip](https://github.com/DynareTeam/dynare/files/827628/SW.zip)Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1389Check detrending engine2019-11-14T17:38:13ZJohannes PfeiferCheck detrending engineThe mod-file
```
//-----------------------------------------------------------------------//
//---------------------- Declaring parameters ---------------------------//
//-----------------------------------------------------------...The mod-file
```
//-----------------------------------------------------------------------//
//---------------------- Declaring parameters ---------------------------//
//-----------------------------------------------------------------------//
parameters delta //depreciation
sigma //intertemporal elasticity
beta //discount factor
alpha //production function parameter
mu //utility parameter
theta //Calvo parameter
epsilon //elasticity
chi //indexation parameter (unused for now)
;
alpha = 0.667;
delta = 0.1;
sigma = 0.25;
beta = 0.96;
mu = 0.2;
theta = 0.5;
epsilon = 15;
chi = 0;
//-----------------------------------------------------------------------//
//----------------------- Declaring variables ---------------------------//
//-----------------------------------------------------------------------//
varexo omega //probability of remaining a worker in the next period
gamma //probability of dieing (once retired)
n //populational growth
x //rate of technological change
M_d //exogenous money supply
;
var lambda //asset distribution in the economy
pi //}these define the marginal propensity of consumption
eps //}by both retirees and workers (I'm using Gertler's notation)
OMEGA //higher case omega
R //gross interest rate
PSI //auxiliar variable
mc //marginal cost
Pi //inflation
Df //nominal dividends
Pf //nominal firm share price
price_disp //price dispersion index
;
//declaring nonstationary variables
trend_var(growth_factor= (1+x)*(1+n)/(1+n)) X; //technological progress
trend_var(growth_factor= (1+x)*(1+n)/(1+x)) N; //population
var(deflator = X*N)
Y //product
C //consumption
K //financial capital
H //non-financial capital
A //assets
;
var(deflator = X) W; //real wage
var(deflator = 1/(X*N)) P PStar; //price level and optimal price set
var(deflator = (X*N)^(1-epsilon)) g1; //auxiliary Calvo variable
var(deflator = (X*N)^(2-epsilon)) g2; //auxiliary Calvo variable
predetermined_variables K; //timing convention
//-----------------------------------------------------------------------//
//------------------------------- Model ---------------------------------//
//-----------------------------------------------------------------------//
model;
// Consumer side
//1
K(+1) = Y - C + (1 - delta)* K;
//2
(lambda - (1 - omega(+1)))*A = omega(+1)*(1-eps*pi)*lambda(-1)*R*A(-1);
//3
pi = 1 - PSI(+1) * (R(+1) * OMEGA(+1))^(sigma - 1) * beta^sigma * pi/pi(+1);
//4
eps * pi = 1 - PSI(+1) * ((R(+1))^(sigma-1)*beta^sigma*gamma(+1))*(eps*pi)/(eps(+1)*pi(+1));
//5
OMEGA = omega + (1-omega)*eps^(1/(1-sigma));
//6
H = N * W + H(+1)/((1+n(+1))*(1+x(+1))*R(+1)*OMEGA(+1)/omega(+1));
//7
C * (1 + mu^sigma * (R(+1)*Pi(+1)/(R(+1)*Pi(+1)-1))^(sigma-1)) = pi * ((1 + (eps/gamma-1) * lambda(-1)) * R * A(-1) + H(-1));
//8
A = K + 1/R * M_d(+1)/P + Pf/P;
//9
PSI = (1 + ((R*Pi-1)/(R*Pi))^(sigma-1) * mu^sigma)^(-1) / (1 + (((R(+1)*Pi(+1))-1)/(R(+1)*Pi(+1)))^(sigma-1) * mu^sigma)^(-1);
// Firm side
//10
Y = (X * N)^alpha * (K)^(1-alpha)/price_disp;
//11
W = alpha * Y / N * mc;
//12
R = (1 - alpha) * Y / K * mc + 1 - delta;
//13
mc = (1/(1-alpha))^(1-alpha)*(1/alpha)^alpha*(W/X)^(1-alpha)*(R-(1-delta))^alpha;
// Calvo pricing
//14
PStar = epsilon/(epsilon-1) * g1/g2;
//15
g1 = P^epsilon * Y * mc + theta*beta * g1(+1);
//16
g2 = P^(epsilon-1) * Y + theta*beta * g2(+1);
//17
P = (theta * P(-1)^(1-epsilon) + (1-theta) * PStar^(1-epsilon))^(1/(1-epsilon));
//18
price_disp = theta*(PStar/P)^(-epsilon)*(P/P(-1))^(epsilon) + (1-theta)*(P/P(-1))^(epsilon)*price_disp(-1);
//19
Pi = P/P(-1);
// Dividends and share prices
Df = P * Y *(1-mc);
Pf(+1) + Df(+1) = R(+1) * Pf;
end;
//-----------------------------------------------------------------------//
//--------------------------- Initial Values ----------------------------//
//-----------------------------------------------------------------------//
initval;
M_d = 1; P =1;
x = 0.01;
n = 0.01;
omega = 0.97;
gamma = 0.9;
lambda =0.3878;
pi =0.2394;
eps =1.2832;
OMEGA =1.0124;
R =1.3968;
PSI =0.9988;
mc =0.9064;
Y =0.7407;
C =0.6857;
K =0.459;
H =1.4279;
A =1.365;
P =0.972;
PStar =0.9364;
W =0.448;
Pi =0.98;
Df =0.0681;
Pf =0.1732;
price_disp=1.0336;
g1 =0.601;
g2 =0.6877;
end;
model_diagnostics;
steady;
endval;
gamma = 0.94;
end;
steady;
simul(periods=300);
```
from http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=14206 does not run with
```
ERROR: the second-order cross partial of equation 14 w.r.t. trend variable X and endogenous variable PStar is not null.
```
but the relevant equation
```
PStar = epsilon/(epsilon-1) * g1/g2;
```
should have the trends specified (as far as I can see). `g1/g2=((X*N)^(1-epsilon))/((X*N)^(2-epsilon)=(XN)^(-1)`, which is the trend for `PStar`.4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1543Rename distributed PDFs in doc folder2019-02-21T16:03:54ZJohannes PfeiferRename distributed PDFs in doc folderThe names should be more expressive. For example, `dynare.pdf` should be `Adjemian_et_al_2011_Dynare_Manual_4.pdf` or similar.The names should be more expressive. For example, `dynare.pdf` should be `Adjemian_et_al_2011_Dynare_Manual_4.pdf` or similar.Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1114create contributions.md describing how to contribute to dynare2021-09-01T12:56:19ZHoutan Bastanicreate contributions.md describing how to contribute to dynare5.xStéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1359Add interface to load datafile in Matlab's table-format2019-12-03T14:45:18ZJohannes PfeiferAdd interface to load datafile in Matlab's table-formatIn `R2013b`. Matlab introduced a datatype `table` (https://de.mathworks.com/help/matlab/ref/table.html). We should support reading datasets saved in this format. In `R2013b`. Matlab introduced a datatype `table` (https://de.mathworks.com/help/matlab/ref/table.html). We should support reading datasets saved in this format. 4.6Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1539create a reporting tutorial website2020-05-07T17:46:42ZHoutan Bastanicreate a reporting tutorial websiteGoing from simple examples to more complex examples to make the code more approachable
Going from simple examples to more complex examples to make the code more approachable
https://git.dynare.org/Dynare/dynare/-/issues/831Improve homotopy2021-09-17T08:41:25ZStéphane Adjemianstepan@adjemian.euImprove homotopy- [X] Display more informations about the progress of the algorithm.
- [X] Do not display warnings.
- [X] Set verbosity to 0 when entering in the homotopy.
- [X] Fix homotopy with `block` and `bytecode` options.
- [x] Fix display of info...- [X] Display more informations about the progress of the algorithm.
- [X] Do not display warnings.
- [X] Set verbosity to 0 when entering in the homotopy.
- [X] Fix homotopy with `block` and `bytecode` options.
- [x] Fix display of informations with `bytecode options`.5.xStéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1338risky steady state: no interface, test suite2021-11-19T11:16:16ZHoutan Bastanirisky steady state: no interface, test suiteThere are several issues with risky steady state:
1. It has no interface. Why? Is this something we want to keep (hidden) in Dynare?
1. It the .mod files that use it are not in the test suite. Why?
There are several issues with risky steady state:
1. It has no interface. Why? Is this something we want to keep (hidden) in Dynare?
1. It the .mod files that use it are not in the test suite. Why?
5.xSébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1537Stop processing with error if nonlinearities exist in endog/exog for linear m...2019-09-10T13:48:13ZHoutan BastaniStop processing with error if nonlinearities exist in endog/exog for linear modelFollowing the conversation in #1404, stop preprocessing with an error if a model is marked as linear but nonlinearities exist in the endogenous or exogenous variables.Following the conversation in #1404, stop preprocessing with an error if a model is marked as linear but nonlinearities exist in the endogenous or exogenous variables.4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1093Discuss changing options_.hp_ngrid2020-01-20T17:41:57ZJohannes PfeiferDiscuss changing options_.hp_ngridThe option `options_.hp_ngrid` is now badly named after introducing a `bandpass_filter` option. It actually governs the number of points used in the inverse Fourier transform for any filter (see #1011).
I would suggest creating a new opt...The option `options_.hp_ngrid` is now badly named after introducing a `bandpass_filter` option. It actually governs the number of points used in the inverse Fourier transform for any filter (see #1011).
I would suggest creating a new option `ifft_points` in the options structure and the preprocessor. For backward compatibility we should keep `hp_ngrid` in the preprocesor, but have it now map into `options_.ifft_points`
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1315check to see if we need all Windows compiler macros in preprocessor2018-10-02T14:53:27ZHoutan Bastanicheck to see if we need all Windows compiler macros in preprocessorThis page
http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
Seems to say all we need is `_WIN32` as it's defined on all Windows systems. This would make `__CYGWIN32__` and `__M...This page
http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
Seems to say all we need is `_WIN32` as it's defined on all Windows systems. This would make `__CYGWIN32__` and `__MINGW32__` redundant. Check to see this is the case
4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1534Add documentation for SMM/GMM/IRF options2021-01-21T15:54:44ZJohannes PfeiferAdd documentation for SMM/GMM/IRF optionsRelevant commits are https://github.com/DynareTeam/dynare/commit/254a73a4065a4b476296391dd22672637f82fc72 and https://github.com/DynareTeam/dynare/commit/d52f13114d10fbe5fd4d263d5d0b9d7cfda787f6Relevant commits are https://github.com/DynareTeam/dynare/commit/254a73a4065a4b476296391dd22672637f82fc72 and https://github.com/DynareTeam/dynare/commit/d52f13114d10fbe5fd4d263d5d0b9d7cfda787f6Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/1078Make lyapunov_symm compatible with sparse matrices2021-09-01T12:56:19ZJohannes PfeiferMake lyapunov_symm compatible with sparse matricesAs discussed in #988 it would make sense to have `lyapunov_symm` able to work with sparse matrices (at least for the baseline option)
As discussed in #988 it would make sense to have `lyapunov_symm` able to work with sparse matrices (at least for the baseline option)
https://git.dynare.org/Dynare/dynare/-/issues/1308Factorize print_info and interpret_resol_info2019-12-09T17:11:26ZStéphane Adjemianstepan@adjemian.euFactorize print_info and interpret_resol_infoSee discussion [here](https://github.com/DynareTeam/dynare/commit/83bc67f0c03bcd79cbbe4c903d7e5f5d4bc11e88#commitcomment-19332156).
See discussion [here](https://github.com/DynareTeam/dynare/commit/83bc67f0c03bcd79cbbe4c903d7e5f5d4bc11e88#commitcomment-19332156).
4.6https://git.dynare.org/Dynare/dynare/-/issues/825Fix using steady state operator on exogenous variables2019-11-27T16:33:42ZJohannes PfeiferFix using steady state operator on exogenous variablesThe mod-file
```
var c, h, pi, w, R, r_e, y, gdp, gdp_hat, k, g, w_tilde, w_eq, w_min;
varexo d, z, eta;
parameters beta, sigma, gamma, theta, ni, tau_w, phi_p, phi_y, rho, alpha;
beta = 0.997;
sigma = 1;
gamma = 458.4;
theta = 6.1...The mod-file
```
var c, h, pi, w, R, r_e, y, gdp, gdp_hat, k, g, w_tilde, w_eq, w_min;
varexo d, z, eta;
parameters beta, sigma, gamma, theta, ni, tau_w, phi_p, phi_y, rho, alpha;
beta = 0.997;
sigma = 1;
gamma = 458.4;
theta = 6.1;
tau_w = 0.2;
ni = 0.28;
phi_p = 1.5;
phi_y = 0.125;
rho = 0.3;
alpha = 0.064;
model;
w_tilde=rho/(1+pi)*w(-1)+(1-rho)*w_eq;
w_eq =(1-alpha)*steady_state(z)*steady_state(h)^(-alpha);
w_min =w(-1)/(1+pi);
//mrs=c^sigma*h^ni/(1-tau_w);
gdp_hat =log(gdp)-log(steady_state(gdp));
r_e=1/(beta*d(+1))-1;
//FOC labor
c^sigma*h^ni=max(w_tilde,w_min)*(1-tau_w);
//Euler equation 1
1=beta*d(+1)*(1+R)/(1+pi(+1))*(c/c(+1))^sigma;
//Euler equation 2
0=(1/(1-alpha))*max(w_tilde,w_min)/z*h^alpha-1-gamma/theta*pi*(1+pi)+beta*d(+1)*(c/c(+1))^sigma * y(+1)/y*gamma/theta*pi(+1)*(1+pi(+1));
// Taylor rule with ZLB
R=max(0,r_e+phi_p*pi+phi_y*gdp_hat);
//output
y=z*h^(1-alpha);
//aggregate resource constraint
c=(1-k-eta)*y;
// resource cost of price adjustment
k=(gamma/2)*(pi^2);
//government purchases
g=eta*y;
// GDP
gdp=(1-k)*y;
//utility
//u=(c^(1-sigma))/(1-sigma)-(h^(1+ni))/(1+ni);
end;
initval;
z=1;
d=1;
pi=0;
k=(gamma/2)*(pi^2);
r_e=1/(beta*d)-1;
h=1;
y=z*h^(1-alpha);
g=eta*y;
c=(1-k-eta)*y;
//w=z;
//w=(1-alpha)/(h^alpha);
gdp=(1-k)*y;
R=r_e;
eta=0.2;
end;
steady;
check;
```
uses `steady_state(z)` where `z` is an exogenous variable. In the `_dynamic` file, the preprocessor translates this to `oo_.exo_steady_state(2)` which does not exist in the `_dynamic` file, leading to a crash. We should either disallow using the steady state operator on exogenous variables or simply enforce that the steady state of exogenous variables is 0. I would prefer the first one as the second would only be viable for stochastic simulations.
4.6MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/1304Octave out of memory issues2018-11-09T14:50:08ZJohannes PfeiferOctave out of memory issuesWhen running `observation_trends_and_prefiltering/MCMC/Trend_loglinear_no_prefilter_MC.mod` in `Octave 4.0.3` I get
```
error: out of memory or dimension too large for Octave's index type
error: called from
pm3 at line 82 column 13...When running `observation_trends_and_prefiltering/MCMC/Trend_loglinear_no_prefilter_MC.mod` in `Octave 4.0.3` I get
```
error: out of memory or dimension too large for Octave's index type
error: called from
pm3 at line 82 column 13
prior_posterior_statistics at line 297 column 5
dynare_estimation_1 at line 462 column 13
dynare_estimation at line 105 column 5
Trend_loglinear_no_prefilter_MC at line 194 column 14
dynare at line 223 column 1
```
Given that Octave (at least on Windows) does not fully support `64 bit`, solving this could be challenging to impossible.
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1524Enable method argument of gamrnd.m2018-12-15T16:11:55ZJohannes PfeiferEnable method argument of gamrnd.mCurrently, we provide an error.Currently, we provide an error.Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1282MS-SBVAR: Potentially allow for linear restrictions across A0 and Aplus2020-11-13T12:40:35ZJohannes PfeiferMS-SBVAR: Potentially allow for linear restrictions across A0 and AplusAfter a user inquiry at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=9594, @dwaggoner replied with the following. The question is now whether we want to implement this?
The underlying C code can handle linear restrictions across `A...After a user inquiry at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=9594, @dwaggoner replied with the following. The question is now whether we want to implement this?
The underlying C code can handle linear restrictions across `A0` and `Aplus` as long as they are not cross-equation. Also the restrictions must be linear, not affine, i.e. no non-zero constant. It seems like this is what the person is asking for. Also, this cannot be used with the Sims-Zha specification as that requires `Aplus` to be unrestricted.
Each column (equation) of `A0` and Aplus can be restricted to be of the form
```
a_j = U[j]*b_j
aplus_j = V[j]*g_j + W[j]*a_j
```
Here `b_j` and `g_j` are the "free parameters", with `a_j` and `aplus_j` are the columns of `A0` and `Aplus`. The cross `A0` - `Aplus` restrictions require `W[j]` to be non-zero.
The work will be going from the dynare file to producing `U[j]`, `V[j]`, and `W[j]`. You already produce `U[j]` and `V[j]`, so producing `W[j]` should not be to much more work.https://git.dynare.org/Dynare/dynare/-/issues/1519check repeated variables in symbol_list for stoch_simul2019-09-10T09:13:59ZHoutan Bastanicheck repeated variables in symbol_list for stoch_simuldo this during `transformPass`, issue warning and remove second symbol when encountered.do this during `transformPass`, issue warning and remove second symbol when encountered.4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1044Clear up option mh_posterior_mode_estimation2021-09-22T15:30:36ZJohannes PfeiferClear up option mh_posterior_mode_estimationSee the question at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=7235
Does anyone know what it does?
Looking at the codes in `dynare_estimation_1.m` this option seems to skip mode computation and directly runs the MCMC, using the pr...See the question at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=7235
Does anyone know what it does?
Looking at the codes in `dynare_estimation_1.m` this option seems to skip mode computation and directly runs the MCMC, using the prior mode as the starting point and the prior variances for computing the inverse Hessian for the MCMC. In case of the mode not existing, the prior mean is used.
But already before doing so, it sets
```
oo_.posterior.optimization.mode = xparam1;
oo_.posterior.optimization.Variance = [];
```
That is, the mode saved is based on the starting values given for MCMC and no variance is saved. This looks like a a bug as the MCMC starts with values that are only set after this assignment.
Finally, this option runs the MCMC and calls `CutSample.m` before returning. What is the point of just estimating the MCMC starting at the prior mode and providing no output?
We should either document the option and add a preprocessor command or get rid of it.5.xhttps://git.dynare.org/Dynare/dynare/-/issues/1252do we need to remove dynamic exception specifications?2019-08-14T12:13:30ZMichelJuillarddo we need to remove dynamic exception specifications?dynamic exceptions specification is now deprecated in C++
In mexFunction, when an unknown exception occurs, Matlab or Octave may crash
Maybe we should remove them from the mexFunction code. I don't see very well their contribution.
dynamic exceptions specification is now deprecated in C++
In mexFunction, when an unknown exception occurs, Matlab or Octave may crash
Maybe we should remove them from the mexFunction code. I don't see very well their contribution.
https://git.dynare.org/Dynare/dynare/-/issues/773Fix preprocessor info on auxiliary variables2019-12-19T16:28:39ZJohannes PfeiferFix preprocessor info on auxiliary variablesSee !770
See !770
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1045Clarify interface for evaluate_planner_objective.m2021-09-14T14:08:35ZMichelJuillardClarify interface for evaluate_planner_objective.mIt works OK for evaluation at the steady state, but the way to set histval and shocks in first period is confusingIt works OK for evaluation at the steady state, but the way to set histval and shocks in first period is confusing5.xNormann RionNormann Rionhttps://git.dynare.org/Dynare/dynare/-/issues/1250Investigate mex-file issues2018-11-09T14:09:56ZJohannes PfeiferInvestigate mex-file issuesThe mod-file
```
theta=[0.999076 5.75 0.76025 0.567383 0.001281 0.0197260625 0.996577 0.00034 0.001028 0.02 0.846875 0.000345]';
%theta= [0.998826 2.250000 1.729 1.629883 0.001281 0.0184760625 0.9...The mod-file
```
theta=[0.999076 5.75 0.76025 0.567383 0.001281 0.0197260625 0.996577 0.00034 0.001028 0.02 0.846875 0.000345]';
%theta= [0.998826 2.250000 1.729 1.629883 0.001281 0.0184760625 0.991577 0.000340 0.001028 0.024966 0.973750 0.000970]';
var c d h ik k l q rf uc vk yy nk dchat dc m da ddem;
varexo ea ed;
parameters ALFA BETTA DELTA GAM PSI NBAR TAU NU MUA SIGA MUD SIGD;
set_param_value('BETTA',theta(1));
set_param_value('GAM',theta(2));
set_param_value('PSI',theta(3));
set_param_value('TAU',theta(4));
set_param_value('MUA',theta(5));
set_param_value('SIGA',theta(6));
set_param_value('MUD',theta(9));
set_param_value('SIGD',theta(10));
DELTA = 0.008333333333333; % Depreciation
ALFA = 0.345000000000000; % Capital share
NBAR = 0.22; % 0.180000000000000; % Steady state NUmber of hours worked;
NU = 0.256884124396632; % 0.204786351767522; % Share of consumption;
model;
#a0 = (exp(MUA) + DELTA - 1)^(1/TAU); % Adjustment cost coefficient
#b0 = (1/(1-TAU))*(exp(MUA) + DELTA - 1); % Adjustment cost coefficient
#THETA = (1-GAM)/(1-(1/PSI));
0 = - da + MUA + SIGA*ea;
0 = - ddem + MUD + SIGD*ed;
0 = - exp(yy) + exp(c)+exp(ik);
0 = - exp(yy) + exp(k*ALFA)*exp((da+h)*(1-ALFA));
0 = - exp(vk) + exp((uc(+1)+dchat(+1))*(1-GAM));
0 = - exp(uc*(1-1/PSI)) + (1-BETTA) + exp(ddem(+1))*BETTA*exp(vk*(1/THETA));
0 = - exp(m) + (exp(ddem) * BETTA * exp(dc*(-1)) * exp(dchat)^(1-1/PSI) * exp((uc+dchat)*(1/PSI-GAM))/exp(vk(-1)*(1-1/THETA)));
0 = - 1 + exp(rf + m(+1));
0 = - (1-ALFA)*exp(yy-h) + (1/NU-1)*exp(c-l);
0 = - 1 + exp(h)+exp(l);
0 = - dchat + NU*(c-c(-1)) + (1-NU)*(l-l(-1)) + NU*da(-1); // used for ease of notation
0 = - dc + c-c(-1) + da(-1);
0 = - exp(k+da(-1)) + (1-DELTA + exp(nk(-1)))*exp(k(-1));
0 = - exp(nk) + b0 + (a0/(1-(1/TAU)))*(exp((ik-k)*(1-(1/TAU))));
0 = - exp(q) + 1/(a0*(exp((ik-k)*(-1/TAU))));
0 = - exp(d) + ALFA*exp(yy-k) + (exp(nk) - DELTA)*exp(q) - exp(ik-k);
0 = - 1 + ((exp(q(+1))+exp(d(+1)))/exp(q)) * exp(m(+1));
end;
% Initial values
steady_state_model;
h = log(NBAR);
l = log(1-NBAR);
da = MUA;
ddem = MUD;
dc = MUA;
dchat = MUA*NU;
m = (log(BETTA) + MUD + MUA*NU*(1-1/PSI) + MUA*(-1));
k = log(((1/(BETTA*exp(MUA*NU*(1-1/PSI))*exp(MUA*(-1))*exp(MUD)) -1+DELTA)/ALFA)^(1/(ALFA-1)))+MUA+h;
yy = log(exp(k)^ALFA * (exp(MUA)*exp(h))^(1-ALFA));
ik = log(exp(k)*(exp(MUA)+DELTA-1));
c = log(exp(yy) - exp(ik));
rf = -m;
q = 0;
nk = log((((exp(MUA) + DELTA - 1)^(1/TAU))/(1-1/TAU))*((exp(ik)/exp(k))^(1-1/TAU)) + ((1/(1-TAU))*(exp(MUA) + DELTA - 1))) ;
d = log(ALFA*exp(yy)/exp(k) + (exp(nk)-DELTA)*exp(q) - (exp(ik)/exp(k)));
uc = (PSI/(PSI-1))*log((1-BETTA)/(1-BETTA*exp(MUA*NU*(1-1/PSI))*exp(MUD)));
vk = log((exp(uc))^(1-GAM));
end;
shocks;
var ea; stderr 1;
var ed; stderr 1;
end;
steady(nocheck);
check;
stoch_simul(order=3, periods=0,drop=0,irf=0,nograph,nocorr,nofunctions,nomoments);
```
triggers two issues.
1. During the `check` command, both the Linux and the Windows Octave `mex`-files trigger a `LAPACK`-error that `The generalized Schur (QZ) decomposition failed`. This is not the case on Windows, but should happen there as well, I guess.
2. When removing the call to check on Linux/Octave so that `k_order_pert` is subsequently triggered, the mod-file crashes Matlab on both Windows and Linux. Presumably this happens due to the singularity that is correctly detected by `mjdgges` on Linux, but improperly handled on all operating systems.
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1031declare all options_ fields as empty/0/NaN in global_initialization2022-06-03T09:09:47ZHoutan Bastanideclare all options_ fields as empty/0/NaN in global_initializationFollowing the discussion on pr #1030, we must decide whether or not we want to do this and implement it throughout the code (or not)Following the discussion on pr #1030, we must decide whether or not we want to do this and implement it throughout the code (or not)https://git.dynare.org/Dynare/dynare/-/issues/1246Investigate Matlab crash caused by k_order_perturbation in a loop2018-11-07T17:45:42ZJohannes PfeiferInvestigate Matlab crash caused by k_order_perturbation in a loopThe user at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6379 reports a Matlab crash on Windows and Linux. `k_order_perturbation` crashes Matlab on Windows, but in a strange way. When I run
```
var a c k v vk;
varexo epsilon;
pre...The user at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6379 reports a Matlab crash on Windows and Linux. `k_order_perturbation` crashes Matlab on Windows, but in a strange way. When I run
```
var a c k v vk;
varexo epsilon;
predetermined_variables k;
parameters SIG DELTA ALFA BETTA RHO GAM SIGZ;
BETTA=0.95; %discount rate
DELTA=0.1; %depreciation rate
ALFA=0.3; %capital share
RHO=0.95; %persistence of technology shock
SIG=0.5; %intertemporal elasticity of substitution
GAM=2;
SIGZ = 0.005;
model;
#theta = (1-GAM)/(1-(SIG));
0 = exp(c) + exp(k(+1)) - (1-DELTA) * exp(k) - exp(a) * exp(k)^ALFA;
0 = exp(c)^(-SIG) - BETTA * exp(c(+1))^(-SIG) * (exp(v(+1))^(SIG-GAM) / exp(vk)^(1-1/theta)) * (exp(a(+1)) * ALFA * exp(k(+1))^(ALFA-1) + 1 - DELTA);
0 = a - RHO * a(-1) - SIGZ*epsilon;
0 = exp(v)^(1-SIG) - exp(c)^(1-SIG) - BETTA* exp(vk)^(1/theta);
0 = exp(vk) - exp(v(+1))^(1-GAM);
end;
steady_state_model;
%initval;
k = log(((1/BETTA+DELTA-1)/ALFA)^(1/(ALFA-1)));
c = log(exp(k)^(ALFA)-DELTA*exp(k)); %steady-state value of consumption
v = (1/(1-SIG))*log(((1/(1-BETTA)) * (exp(c)^(1-SIG))));
vk = (1-GAM)*log(exp(v));
a = 0;
end;
shocks;
var epsilon; stderr 1;
end;
steady(solve_algo=2, maxit=1000, nocheck);
check;
options_.k_order_solver=1; %this is important as then for order=3 there will be jacobia_ not found error.
stoch_simul(order=3, periods=0, drop=0, nodisplay,noprint,nograph,nocorr,nofunctions,nomoments);
```
in a loop:
```
for ii=1:10
dynare Rec1 noclearall
end
```
Matlab crashes in the third iteration. This again suggests there is an issue with running the mex-files in loops. It reminds me of the memory leak issues
Given that this issue apparently also happens under Linux, it might be easier to debug than https://github.com/DynareTeam/dynare/issues/60, https://github.com/DynareTeam/dynare/issues/612, and https://github.com/DynareTeam/dynare/issues/1026
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/762svar identification2020-11-13T13:42:46ZHoutan Bastanisvar identificationimplement partial/global identification for svar, based on Tao's paperimplement partial/global identification for svar, based on Tao's paperMichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/1004Make initvalf and histvalf compatible with translation to one-lag problem2021-09-22T07:54:34ZJohannes PfeiferMake initvalf and histvalf compatible with translation to one-lag problemWe currently have both `initvalf` and `histvalf` but with auxiliary variable substitution it is not clear to me how separate the two and how to properly initialize a model. Also, `histvalf` automatically takes care of auxiliary variables...We currently have both `initvalf` and `histvalf` but with auxiliary variable substitution it is not clear to me how separate the two and how to properly initialize a model. Also, `histvalf` automatically takes care of auxiliary variables while `initvalf` does not.
Related to #6175.xhttps://git.dynare.org/Dynare/dynare/-/issues/1245Make sure _dynamic-file from block returns with proper arguments2019-12-04T14:52:11ZJohannes PfeiferMake sure _dynamic-file from block returns with proper argumentsCurrently, there are a few `return` statements where `varargout` has not been set, leading to crashes instead of proper switching to homotopy.
Currently, there are a few `return` statements where `varargout` has not been set, leading to crashes instead of proper switching to homotopy.
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1503Do we really need to have specific dynamic routines for deterministic and sto...2020-12-08T13:50:02ZStéphane Adjemianstepan@adjemian.euDo we really need to have specific dynamic routines for deterministic and stochastic models?See discussion in #1501.See discussion in #1501.https://git.dynare.org/Dynare/dynare/-/issues/713Block recursive prior definitions2021-09-21T15:21:04ZJohannes PfeiferBlock recursive prior definitionsRecursive specification of priors seem to be currently allowed, e.g.
```
a1 0.2,1E-5,1, BETA_PDF,0.5,0.1;
a2 0.5,1E-5,1, a1 BETA_PDF,0.85,0.1;
```
where the upper bound for `a2` is actually set based on the value `a1` has in the parame...Recursive specification of priors seem to be currently allowed, e.g.
```
a1 0.2,1E-5,1, BETA_PDF,0.5,0.1;
a2 0.5,1E-5,1, a1 BETA_PDF,0.85,0.1;
```
where the upper bound for `a2` is actually set based on the value `a1` has in the parameter initialization section (and never updates it during estimation based on new values of `a1`). But the user clearly intends to make the prior conditional, which Dynare does not allow. We should block this kind of behavior in the preprocessor, because the actual behavior is unexpected.
Sidenote: would it be sensible to allow for conditional priors at some point in the future?5.xhttps://git.dynare.org/Dynare/dynare/-/issues/1243Allow model-local variables with block and bytecode2020-11-13T09:06:11ZJohannes PfeiferAllow model-local variables with block and bytecodeWe currently return the error
`'block' or 'bytecode' options are not yet compatible with pound expressions`
Given that `steady_state_model` cannot be used for handling parameter dependence in the `perfect_foresight`, model-local variable...We currently return the error
`'block' or 'bytecode' options are not yet compatible with pound expressions`
Given that `steady_state_model` cannot be used for handling parameter dependence in the `perfect_foresight`, model-local variables seem the only way to go. We should therefore allow them.
@houtanb Where exactly is the challenge from the proprocessor-side?
5.xSébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1490Again investigate memory problems with k_order_perturbation on Windows2018-11-14T11:34:59ZJohannes PfeiferAgain investigate memory problems with k_order_perturbation on WindowsTwo users at https://forum.dynare.org/t/cant-work-with-third-order/10523/12 report problems with Dynare 4.5.1. I cannot replicate the issue on my machine.
The stack trace on both affected machines is
```
Register State (from fault...Two users at https://forum.dynare.org/t/cant-work-with-third-order/10523/12 report problems with Dynare 4.5.1. I cannot replicate the issue on my machine.
The stack trace on both affected machines is
```
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 00000000000000c4 RDX = 0000000000000000
RSP = 000000012c03fe20 RBP = 000000012c03fed8
RSI = 0000000000000000 RDI = 0000000006032530
R8 = 000000012c03fdf8 R9 = 000000012c03fed8
R10 = 0000000000000000 R11 = 0000000000000206
R12 = 0000000000000000 R13 = 0000000000000000
R14 = 0000000000000000 R15 = 0000000000000000
RIP = 000000002911f5c7 EFL = 00010202
CS = 0033 FS = 0053 GS = 002b
Stack Trace (from fault):
[ 0] 0x000000002911f5c7 C:\dynare\4.5.1\mex\matlab\win64-7.8-9.2\k_order_perturbation.mexw64+00390599 mexFunction+00384471
[ 1] 0x00000000290eca69 C:\dynare\4.5.1\mex\matlab\win64-7.8-9.2\k_order_perturbation.mexw64+00182889 mexFunction+00176761
[ 2] 0x0000000029120cc4 C:\dynare\4.5.1\mex\matlab\win64-7.8-9.2\k_order_perturbation.mexw64+00396484 mexFunction+00390356
[ 3] 0x000007feff08415f C:\Windows\system32\msvcrt.dll+00016735 srand+00000147
[ 4] 0x000007feff086ebd C:\Windows\system32\msvcrt.dll+00028349 ftime64_s+00000477
[ 5] 0x0000000076a659cd C:\Windows\system32\kernel32.dll+00088525 BaseThreadInitThunk+00000013
[ 6] 0x000000007717a561 C:\Windows\SYSTEM32\ntdll.dll+00173409 RtlUserThreadStart+00000033
```
So it might have to do with Visual Studies's `msvcrt.dll` and the random number generator's call to the system time.4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1225Make sure mex-files are compatible with 64bit Matlab2018-11-09T10:20:27ZJohannes PfeiferMake sure mex-files are compatible with 64bit MatlabSee http://de.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
See http://de.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/699Allow for constrained forecast paths of different length2019-09-20T13:05:20ZJohannes PfeiferAllow for constrained forecast paths of different lengthUser request, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5888
User request, see http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5888
https://git.dynare.org/Dynare/dynare/-/issues/915Integrate convert_dyn_45_to_44 into convert_oo_.m2020-09-03T16:10:28ZJohannes PfeiferIntegrate convert_dyn_45_to_44 into convert_oo_.mSee the discussion in https://github.com/DynareTeam/dynare/commit/a93e0157e4ea0d3a2ee4d5b10842066a0a39c2e9#commitcomment-10984144
See the discussion in https://github.com/DynareTeam/dynare/commit/a93e0157e4ea0d3a2ee4d5b10842066a0a39c2e9#commitcomment-10984144
4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1210Allow string arrays to be passed to options2018-11-09T14:13:22ZHoutan BastaniAllow string arrays to be passed to optionsFollowing the discussion in #1199, allow the preprocessor to accept string array values: `['a' 'b' 'c']`
Following the discussion in #1199, allow the preprocessor to accept string array values: `['a' 'b' 'c']`
Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1483if Dynare++ will not be built, do not build mex files that depend on it2019-08-14T12:33:08ZHoutan Bastaniif Dynare++ will not be built, do not build mex files that depend on it`mex/build/matlab/configure.ac` does not account for the case when makefiles are not created for dynare++ by the main configure script. Hence, `libdynare++` and `gensylv` will still be built, causing an error. See #1482.
Easy solution...`mex/build/matlab/configure.ac` does not account for the case when makefiles are not created for dynare++ by the main configure script. Hence, `libdynare++` and `gensylv` will still be built, causing an error. See #1482.
Easy solution: test for BLAS, LAPACK, and MatIO. don't build `libdynare++`, `gensylv`, `k_order_perturbation`, or `dynare_simul_` if one of these libraries is not found (same test that we implement for building Dynare++ in the main config file.
Another solution would be to pass the value of `BUILD_DYNAREPLUSPLUS` to `AC_CONFIG_SUBDIRS([mex/build/matlab])` in `configure.ac`4.6Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/674Improve error message in Dynare++ for BK-Violation2019-11-27T13:11:54ZJohannes PfeiferImprove error message in Dynare++ for BK-ViolationSee http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5790
See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5790
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1478Configure Windows Installer to allow silent install2019-10-23T14:40:47ZJohannes PfeiferConfigure Windows Installer to allow silent installThis is a feature request from a university wanting to do an unattended installation of Dynare on a computer pool. The NSIS installer we use seems to not be configured for silent installs, i.e. passing '/D /d=test_directory' does not wo...This is a feature request from a university wanting to do an unattended installation of Dynare on a computer pool. The NSIS installer we use seems to not be configured for silent installs, i.e. passing '/D /d=test_directory' does not work.
We should follow the instructions at http://nsis.sourceforge.net/Docs/Chapter4.html#silent t to allow for this.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1205Allows period=1 with all perfect foresight model solvers2019-04-26T14:25:20ZStéphane Adjemianstepan@adjemian.euAllows period=1 with all perfect foresight model solversSee discussion in #1176.
See discussion in #1176.
4.6Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1476create our own version of the Matlab table command2018-11-08T11:46:00ZHoutan Bastanicreate our own version of the Matlab table command`table` was provided in Matlab R2013b. Doing this will allow us to have consistent-looking output`table` was provided in Matlab R2013b. Doing this will allow us to have consistent-looking outputHoutan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/637M_.state_var2020-02-11T10:08:30ZMichelJuillardM_.state_varCurrently, the vector M_.state_var is created by the preprocessor only when estimation is taking place. Because, this vector contains information useful in any context involving linear representation, I suggest to create it in all cases....Currently, the vector M_.state_var is created by the preprocessor only when estimation is taking place. Because, this vector contains information useful in any context involving linear representation, I suggest to create it in all cases.
M_.state_var points to variables in declaration order, but is not sorted. This is confusing
In addition, dr_block copies it to oo_.dr. This is confusing.
4.6Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/1204Crash in unstable mex when called from parallel workers2020-11-13T13:44:38ZTom 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) ...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/1438Write a unit test for mjdgges (m implementation)2020-11-13T17:10:16ZStéphane Adjemianstepan@adjemian.euWrite a unit test for mjdgges (m implementation)Based on matrices E and D from the example contributed by @JohannesPfeifer in #1154.Based on matrices E and D from the example contributed by @JohannesPfeifer in #1154.Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/630Improving Ramsey computations2021-09-14T16:48:39ZMichelJuillardImproving Ramsey computations- [ ] adding the possibility to use one of the parameters of the model as the planner_discount factor
- [x] give independent access to the fonction evaluating the objective function- [ ] adding the possibility to use one of the parameters of the model as the planner_discount factor
- [x] give independent access to the fonction evaluating the objective function6.xMichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/1197Get rid of globals in various functions2019-09-13T08:16:48ZJohannes PfeiferGet rid of globals in various functionsAs discussed with @MichelJuillard, we should try to get rid of globals in
- `stoch_simul`
- `simult_`
as most of their callers and subsequently called functions already use local instances of the variables
As discussed with @MichelJuillard, we should try to get rid of globals in
- `stoch_simul`
- `simult_`
as most of their callers and subsequently called functions already use local instances of the variables
4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1175Investigate whether commmit 3c7e60b really fixes a bug2018-11-16T14:28:24ZJohannes PfeiferInvestigate whether commmit 3c7e60b really fixes a bugSee the discussion at https://github.com/DynareTeam/dynare/commit/3c7e60b744567f6f39a9c611bce6dcaadcd52bc6
See the discussion at https://github.com/DynareTeam/dynare/commit/3c7e60b744567f6f39a9c611bce6dcaadcd52bc6
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/1407Keep track of whether smoother results are in logs and adjust smoother2histva...2021-09-17T16:07:34ZJohannes PfeiferKeep track of whether smoother results are in logs and adjust smoother2histval accordinglySee !1396See !13965.xhttps://git.dynare.org/Dynare/dynare/-/issues/569Integrate OccBin2021-07-21T16:03:22ZHoutan BastaniIntegrate OccBinhttps://github.com/lucashare/occbin
https://www2.bc.edu/matteo-iacoviello/research_files/TOOLKIT_PAPER.pdfhttps://github.com/lucashare/occbin
https://www2.bc.edu/matteo-iacoviello/research_files/TOOLKIT_PAPER.pdf5.xMarco RattoMarco Rattohttps://git.dynare.org/Dynare/dynare/-/issues/568Integrate DMM2021-09-15T15:49:13ZHoutan BastaniIntegrate DMMhttp://ipsc.jrc.ec.europa.eu/?id=790
http://ipsc.jrc.ec.europa.eu/fileadmin/repository/sfa/finepro/software/DMMmanual.pdf
http://ipsc.jrc.ec.europa.eu/?id=790
http://ipsc.jrc.ec.europa.eu/fileadmin/repository/sfa/finepro/software/DMMmanual.pdf
MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/564ramsey policy at order 22019-12-12T10:30:42ZMichelJuillardramsey policy at order 2The code for computing a 2nd order approximation of Ramsey policy is already in place. I just need to complete the evaluation of objective function (at 3rd order).
The code for computing a 2nd order approximation of Ramsey policy is already in place. I just need to complete the evaluation of objective function (at 3rd order).
MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/466Make build system for MEX files compatible with future automake versions2019-04-06T07:33:00ZSébastien VillemotMake build system for MEX files compatible with future automake versionsIn future versions of automake, the `subdir-objects` option will be activated by default. This option breaks the way we build the MEX files. We need to redesign the build system for MEX files, or find a workaround.
In future versions of automake, the `subdir-objects` option will be activated by default. This option breaks the way we build the MEX files. We need to redesign the build system for MEX files, or find a workaround.
Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1627Bug in evaluate_steady_state.m for models with [dynamic] tags which update pa...2018-11-15T09:25:10ZTom HoldenBug in evaluate_steady_state.m for models with [dynamic] tags which update parametersA steady-state file (e.g. one created via a steady_state_model block) may update parameters. These get stored in the params output of evaluate_steady_state.m, not in M.params. However, within the `if M.static_and_dynamic_models_differ` b...A steady-state file (e.g. one created via a steady_state_model block) may update parameters. These get stored in the params output of evaluate_steady_state.m, not in M.params. However, within the `if M.static_and_dynamic_models_differ` block at the bottom of the file, M.params is used rather than params. This seems like a mistake.https://git.dynare.org/Dynare/dynare/-/issues/1628Document new preprocessor options2019-10-09T10:33:13ZJohannes PfeiferDocument new preprocessor optionsAs far as I can see, the options `[output=dynamic|first|second|third]` and `[language=julia]` have not yet been documentedAs far as I can see, the options `[output=dynamic|first|second|third]` and `[language=julia]` have not yet been documented4.6https://git.dynare.org/Dynare/dynare/-/issues/1629Problems with 4.5.4-1 on Ubuntu 18.042018-11-16T16:48:01ZGhost UserProblems with 4.5.4-1 on Ubuntu 18.04Ubuntu 18.04 LTS has Dynare 4.5.4-1 in the repositories (funny enough Debian has newer packages but I can't install them because they require the newer dependencies as well). This version, however, is not playing nicely with Matlab 2018b...Ubuntu 18.04 LTS has Dynare 4.5.4-1 in the repositories (funny enough Debian has newer packages but I can't install them because they require the newer dependencies as well). This version, however, is not playing nicely with Matlab 2018b and fails to configure everything. Dynare works through Matlab but every time I run `apt upgrade` or `apt install somepackagename` it tries to finish configuring and exits with the following error:
```
Setting up dynare-matlab (4.5.4-1) ...
Building Matlab extensions (logfile at /tmp/dynare-matlab-mexbuild-1542385181.sBPwNf2)
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: '9.5
Invalid configuration `'9.5': machine `'9.5' not recognized
configure: error: /bin/bash ./config.sub '9.5 failed
dpkg: error processing package dynare-matlab (--configure):
installed dynare-matlab package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
dynare-matlab
E: Sub-process /usr/bin/dpkg returned an error code (1)
```
I tried to tinker with the `configure` file in `/usr/src/matlab/dynare-matlab/mex/build/matlab` but to no avail.
If I run
```
cd /usr/src/matlab/dynare-matlab
cd mex/build/matlab && ./configure --with-matlab=$(dirname $(dirname $(readlink -f `which matlab`))) MATLAB_VERSION=9.5 && make
```
It performs many operations but fails with:
```
Making all in mjdgges
make[1]: Entering directory '/usr/src/matlab/dynare-matlab/mex/build/matlab/mjdgges'
gcc -fexceptions -fPIC -pthread -g -O2 -fno-omit-frame-pointer -Wall -Wno-parentheses -shared -Wl,--no-undefined -Wl,-rpath-link,/usr/local/MATLAB/R2018b/bin/glnxa64 -L/usr/local/MATLAB/R2018b/bin/glnxa64 -Wl,--version-script,/usr/local/MATLAB/R2018b/extern/lib/glnxa64/mexFunction.map -o mjdgges.mexa64 mjdgges.o -lmx -lmex -lmat -lm -lstdc++ -lmwlapack -lmwblas
mjdgges.o: In function `mexFunction':
/usr/src/matlab/dynare-matlab/mex/build/matlab/mjdgges/../../../sources/mjdgges/mjdgges.c:123: undefined reference to `mxGetPiIsDeprecated'
collect2: error: ld returned 1 exit status
Makefile:393: recipe for target 'mjdgges.mexa64' failed
make[1]: *** [mjdgges.mexa64] Error 1
make[1]: Leaving directory '/usr/src/matlab/dynare-matlab/mex/build/matlab/mjdgges'
Makefile:405: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
```https://git.dynare.org/Dynare/dynare/-/issues/1630Options at the top of a mod file should be parsed by the preprocessor2018-12-19T15:16:36ZSébastien VillemotOptions at the top of a mod file should be parsed by the preprocessorThe options at the top of a mod file are currently read from `dynare.m`, then passed when invoking the preprocessor.
But we want this feature to work outside of MATLAB. So this parsing should be done by the preprocessor itself, who shou...The options at the top of a mod file are currently read from `dynare.m`, then passed when invoking the preprocessor.
But we want this feature to work outside of MATLAB. So this parsing should be done by the preprocessor itself, who should accept these options as if they had been passed on the command-line.Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1631Fix calls to dynamic routines in identification2019-01-09T14:19:54ZJohannes PfeiferFix calls to dynamic routines in identificationThe attached file contains a moving average process. It crashes identification in calls like
```
[residual, g1 ] = feval([M_.fname,'_dynamic'],yy0, ...
repmat(oo_.exo_steady_state',[M_.maximum_exo_lag+M_....The attached file contains a moving average process. It crashes identification in calls like
```
[residual, g1 ] = feval([M_.fname,'_dynamic'],yy0, ...
repmat(oo_.exo_steady_state',[M_.maximum_exo_lag+M_.maximum_exo_lead+1]), M_.params, ...
oo_.dr.ys, 1);
```
Here, the period number (last argument) is always set to 1 instead of presumably `M_.maximum_exo_lag+1 `.
[dsge_mada_debt1.mod](/uploads/cad3e4c1ca2f06c5f85913d13b27a715/dsge_mada_debt1.mod)4.6Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/1632Inconsistency in treatment of qz_criterium in dyn_first_order_solver.m / mjdg...2019-01-15T18:06:09ZTom HoldenInconsistency in treatment of qz_criterium in dyn_first_order_solver.m / mjdgges.cI was under the impression that `qz_criterium` was intended to be a threshold on the absolute value of `dr.eigval`. See e.g. line 85 of `AIM_first_order_solver.m`:
`nba = nd-sum( abs(dr.eigval) < qz_criterium );`
However, it appears th...I was under the impression that `qz_criterium` was intended to be a threshold on the absolute value of `dr.eigval`. See e.g. line 85 of `AIM_first_order_solver.m`:
`nba = nd-sum( abs(dr.eigval) < qz_criterium );`
However, it appears that in `dyn_first_order_solver.m` it is instead a threshold on the squared absolute value of `dr.eigval`. See line 190 of `dyn_first_order_solver.m`:
`[err, ss, tt, w, sdim, dr.eigval, info1] = mjdgges(E, D, DynareOptions.qz_criterium, DynareOptions.qz_zero_threshold);`
line 31 of `mjdgges.c`:
`return ((*alphar **alphar + *alphai **alphai) < criterium **beta **beta);`
and line 107 of `mjdgges.c`:
`criterium = *mxGetPr(prhs[2]);`
The eigenvalues are `( alphar[j] + alphai[j] * 1i ) / beta[j]` according to [the MKL manual](https://software.intel.com/en-us/mkl-developer-reference-fortran-gges). Thus, it seems that this code is comparing the **squared** absolute value of the eigenvalue to `qz_criterium`.
The easiest fix would be to replace line 190 of `dyn_first_order_solver.m` with:
`[err, ss, tt, w, sdim, dr.eigval, info1] = mjdgges(E, D, DynareOptions.qz_criterium .^ 2, DynareOptions.qz_zero_threshold);`
so you're comparing squared to squared.Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dynare/-/issues/1633Filter out cases where stochastic simulation is run with no shocks2019-09-10T08:47:48ZJohannes PfeiferFilter out cases where stochastic simulation is run with no shocksWhen using `stoch_simul` without varexo, a cryptic error message will appear. See https://forum.dynare.org/t/how-to-compute-the-decision-rule-matrix-oo-dr-ghx-of-a-deterministic-model/13095
We should provide an informative message, poten...When using `stoch_simul` without varexo, a cryptic error message will appear. See https://forum.dynare.org/t/how-to-compute-the-decision-rule-matrix-oo-dr-ghx-of-a-deterministic-model/13095
We should provide an informative message, potentially at the level of the preprocessor.4.6https://git.dynare.org/Dynare/dynare/-/issues/1634Bug in positive/negative IRFs in Dynare++2019-02-05T20:00:07ZJohannes PfeiferBug in positive/negative IRFs in Dynare++See
https://forum.dynare.org/t/asymmetric-irfs-at-first-order-in-dynare/12246/4
The issue seems to have not yet been solved.See
https://forum.dynare.org/t/asymmetric-irfs-at-first-order-in-dynare/12246/4
The issue seems to have not yet been solved.4.6Sébastien VillemotSébastien Villemot