dynare issueshttps://git.dynare.org/Dynare/dynare/-/issues2019-02-08T08:30:47Zhttps://git.dynare.org/Dynare/dynare/-/issues/949Fix loop in identification2019-02-08T08:30:47ZJohannes PfeiferFix loop in identificationIn `identification_analysis.m` we have
```
indJJ = (find(max(abs(JJ'),[],1)>1.e-8));
...
while length(indJJ)<nparam && nlags<10,
disp('The number of moments with non-zero derivative is smaller than the number...In `identification_analysis.m` we have
```
indJJ = (find(max(abs(JJ'),[],1)>1.e-8));
...
while length(indJJ)<nparam && nlags<10,
disp('The number of moments with non-zero derivative is smaller than the number of parameters')
disp(['Try increasing ar = ', int2str(nlags+1)])
nlags=nlags+1;
[JJ, H, gam, gp, dA, dOm, dYss] = getJJ(A, B, M_,oo0,options_,kron_flag,indx,indexo,bayestopt_.mf2,nlags,useautocorr);
derivatives_info.DT=dA;
derivatives_info.DOm=dOm;
derivatives_info.DYss=dYss;
evalin('caller',['options_ident.ar=',int2str(nlags),';']);
end
```
As far as I can see, the condition on `indJJ` is not updated in the loop. This looks wrong to me.
4.5https://git.dynare.org/Dynare/dynare/-/issues/946Add new preprocessor option minimal_workspace2019-06-19T15:37:58ZJohannes PfeiferAdd new preprocessor option minimal_workspaceMatlab has a limit on the number of variables allowed in the workspace. To prevent problems with this limit, introduce new preprocessor option `minimal_workspace` that when used, suppresses writing the parameters to a variable with their...Matlab has a limit on the number of variables allowed in the workspace. To prevent problems with this limit, introduce new preprocessor option `minimal_workspace` that when used, suppresses writing the parameters to a variable with their name in the workspace. That is, instead of
```
M_.params( 1 ) = 0.999;
beta = M_.params( 1 );
```
only write
`M_.params( 1 ) = 0.999;`
Also set `options_.minimal_workspace` to 1 (default: 0) so that we can suppress the call to `dyn2vec` in stoch_simul to prevent duplicating simulated variables in the workspace. See the email of Stéphane from 26/05/15
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/943Update manual on ordering of variables coming from smoother2019-06-19T15:37:58ZJohannes PfeiferUpdate manual on ordering of variables coming from smootherSee http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6020. Needs to be done after #804
See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6020. Needs to be done after #804
4.5https://git.dynare.org/Dynare/dynare/-/issues/945Fix bug in identification when estimating only standard deviations2019-06-19T15:37:58ZJohannes PfeiferFix bug in identification when estimating only standard deviationsSee email from 05/23/15.
See email from 05/23/15.
4.5https://git.dynare.org/Dynare/dynare/-/issues/944Fix description of Ramsey timeless perspective in manual2019-06-19T15:37:58ZJohannes PfeiferFix description of Ramsey timeless perspective in manualMichel writes:
```
I don't agree with the part on timeless perspective. Setting the initial
multiplier to its steady state value is not timeless
perspective. "Setting the initial Lagrange multipliers as if optimal
policy was started a ...Michel writes:
```
I don't agree with the part on timeless perspective. Setting the initial
multiplier to its steady state value is not timeless
perspective. "Setting the initial Lagrange multipliers as if optimal
policy was started a long time ago" would take into consideration the
value of the initial state variables.
```
4.5https://git.dynare.org/Dynare/dynare/-/issues/940Add interface for TaRB algorithm2019-06-19T15:37:58ZJohannes PfeiferAdd interface for TaRB algorithmIn `estimation` we would need the following options:
1. `use_TaRB` which translates to `options_.TaRB.use_TaRB=1`;
2. `TaRB_mode_compute=integer` resembling `mode_compute` and translating into `options_.TaRB.mode_compute=4`
3. `TaRB_new_...In `estimation` we would need the following options:
1. `use_TaRB` which translates to `options_.TaRB.use_TaRB=1`;
2. `TaRB_mode_compute=integer` resembling `mode_compute` and translating into `options_.TaRB.mode_compute=4`
3. `TaRB_new_block_probability=double` translating into `options_.TaRB.new_block_probability` and checking whether it is between 0 and 1.
4. `TaRB_optim` resembling `optim` and translating into `options_.TaRB.optim_opt`
4.5Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/934Clarify notation of MS-SBVAR2019-06-19T15:37:58ZJohannes PfeiferClarify notation of MS-SBVARSection 4.18 of the manual refers to variables limke A^0, A^+ or Q. But they seem to come from a different paper than the cited Sims/Waggoner/Zha (2008). My guess is Sims/Zha (1998). See also
http://www.dynare.org/phpBB3/viewtopic.php?f...Section 4.18 of the manual refers to variables limke A^0, A^+ or Q. But they seem to come from a different paper than the cited Sims/Waggoner/Zha (2008). My guess is Sims/Zha (1998). See also
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6801&p=19671#p19671
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/925Add preprocessor interface for selecting proposal density2019-06-19T15:37:58ZJohannes PfeiferAdd preprocessor interface for selecting proposal densityIn the MCMC, we seem to have everything in place for using a student t-distribution as the proposal density, but we have no interface.
Modify the estimation command to accept the following new options:
- proposal_distribution, which tak...In the MCMC, we seem to have everything in place for using a student t-distribution as the proposal density, but we have no interface.
Modify the estimation command to accept the following new options:
- proposal_distribution, which takes two arguments: `rand_multivariate_normal` (default) or `rand_multivariate_student` and maps to `options_.proposal_distribution`
- `student_degrees_of_freedom`, which accepts an integer argument and maps to `options_.student_degrees_of_freedom`
These options already exist in `global_initialization.m`.
After doing this, we need to convert `tests/estimation/t_proposal/fs2000_student.mod` to use this interface.
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/924Add preprocessor interface and documentation for dr_display_tol and huge_number2019-06-19T15:37:58ZJohannes PfeiferAdd preprocessor interface and documentation for dr_display_tol and huge_numberSee #906 and 6d0dfc2d3fe302333204bac446458b1dd3b62b49
See #906 and 6d0dfc2d3fe302333204bac446458b1dd3b62b49
4.5Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/916Investigate preprocessor crash with external function in model-local variable2019-06-19T15:37:58ZJohannes PfeiferInvestigate preprocessor crash with external function in model-local variableSee `use_local_variable_for_beta.mod` at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6772
See `use_local_variable_for_beta.mod` at http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6772
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/914place oo_.exo_simul in the same format as oo_.endo_simul2019-06-19T15:37:58ZHoutan Bastaniplace oo_.exo_simul in the same format as oo_.endo_simulSee #546, #806, #875,
See #546, #806, #875,
4.5https://git.dynare.org/Dynare/dynare/-/issues/912Fix bug for mh_recover that prevents using mh-files already created2019-06-19T15:37:58ZJohannes PfeiferFix bug for mh_recover that prevents using mh-files already createdThere seems to be a bug hidden in `metropolis_hastings_initialization.m` when using `mh_recover`.
We have at the end
```
NumberOfSavedMhFiles = NumberOfSavedMhFilesInTheCrashedBlck+LastFileNumberInThePreviousMh;
if NumberOfSaved...There seems to be a bug hidden in `metropolis_hastings_initialization.m` when using `mh_recover`.
We have at the end
```
NumberOfSavedMhFiles = NumberOfSavedMhFilesInTheCrashedBlck+LastFileNumberInThePreviousMh;
if NumberOfSavedMhFiles
load([BaseName '_mh' int2str(NumberOfSavedMhFiles) '_blck' int2str(fblck) '.mat']);
ilogpo2(fblck) = logpo2(end);
ix2(fblck,:) = x2(end,:);
end
```
That means that the starting values for the chain are taken from the last mh-file on the disk. In the unit test at #911 , there are 4 in the current block and the crash happened after file number 3 (as the fourth file is deleted). In this case, we start the MCMC with the last draw in mh-file number 3. But we do not set `Fline`, `nruns`, and `NewFile` to account for the presence of three quarters of the MCMC. Instead, we run the full chain again, but starting at the endpoint of the last crashed chain.
Moreover, I think we are not accounting for the state of the random number generator when using mh_recover. My proposal is to save the last seed of each mh-file in `record` (instead of always only keeping the very last one for use in `load_mh_file`, saved to `record.LastSeeds` in `random_walk_metropolis_hastings_core`). We could then continue after the respective last mh-file on the disk at this state by changing `record.InitialSeeds(curr_block)` together with `Fline`, `nruns`, and `NewFile` in `metropolis_hastings_initialization.m`
4.5MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/910Allow specifying output directory for estimation2019-06-19T15:37:58ZJohannes PfeiferAllow specifying output directory for estimation`dynare_estimation.m` takes as an input `dname`, but as far as I can see, there is no way to set this. `ComputingTasks.cc` in line 482 only writes `var_list_` as an argument.
`dynare_estimation.m` takes as an input `dname`, but as far as I can see, there is no way to set this. `ComputingTasks.cc` in line 482 only writes `var_list_` as an argument.
4.5Houtan BastaniHoutan Bastanihttps://git.dynare.org/Dynare/dynare/-/issues/896Fix treatment of complex elements in perfect foresight simulations2019-02-08T08:30:47ZJohannes PfeiferFix treatment of complex elements in perfect foresight simulationsThe mod-file
```
%----------------------------------------------------------------
% define variables
%----------------------------------------------------------------
var y c k n r w invest G lambda q phi; %I excluded ghat
vare...The mod-file
```
%----------------------------------------------------------------
% define variables
%----------------------------------------------------------------
var y c k n r w invest G lambda q phi; %I excluded ghat
varexo eps_g;
%----------------------------------------------------------------
% define parameters
%----------------------------------------------------------------
parameters beta eta b mu delta alpha gamma tau_k tau_n kappa gshare;
%----------------------------------------------------------------
% set parameter values
%----------------------------------------------------------------
beta=1.03^(-1/4);
b=0;
mu=0;
delta=0.021;
alpha = 0.34;
gamma=1.005;
tau_k=0;
tau_n=0;
kappa=0;
gshare= 0.2038;
%----------------------------------------------------------------
% enter model equations
%----------------------------------------------------------------
model;
1/(c-c(-1)*b/gamma)-beta*b*1/(c(+1)*gamma-b*c)=lambda;
q=beta*lambda(+1)/(lambda*gamma)*((1-delta)*q(+1)+(1-tau_k)*r+delta*tau_k);
1=q*(1-kappa/2*(invest/invest(-1)*gamma-gamma)^2-kappa*(invest/invest(-1)*gamma-gamma)*invest*gamma/invest(-1))+beta*q(+1)*lambda(+1)/(lambda*gamma)*kappa*(invest(+1)/invest*gamma-gamma)*(invest(+1)*gamma/invest)^2;
lambda*w*(1-tau_n)=eta/((1-n)^mu);
c+invest=(1-tau_n)*w*n+(1-tau_k)*r*k(-1)+delta*tau_k*k(-1)-phi;
G=tau_n*w*n+tau_k*(r-delta)*k(-1)+phi;
k(-1)=w/r*n*alpha/(1-alpha);
k*gamma=(1-delta)*k(-1)+(1-kappa/2*(invest/invest(-1)*gamma-gamma)^2)*invest;
y=k(-1)^alpha*n^(1-alpha);
y=c+invest+G;
G=gshare*steady_state(y)*exp(eps_g);
end;
%----------------------------------------------------------------
% set steady state values and calibrate the model to steady state labor of 0.24, i.e. compute the corresponding steady state values
% and the labor disutility parameter by hand
%---------------------------------------------------------------
steady_state_model;
n=0.24;
q=1;
r=(q*gamma/beta-(1-delta)*q-delta*tau_k)/(1-tau_k);
k=n*(1/alpha*r)^(1/(alpha-1));
y=r*k/alpha;
G=gshare*y;
c=r*k/alpha-(gamma+delta-1)*k-G;
w=(c+(gamma+delta-1-r)*k+G)/n;
invest=(gamma+delta-1)*k;
phi=G-tau_n*w*n-tau_k*(r-delta)*k;
lambda=(1/c)*((1-b/gamma)^(-1)-beta*b*(gamma-b)^(-1));
eta=lambda*w*(1-tau_n)*(1-n)^(mu);
end;
shocks;
var eps_g;
periods 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50;
values -0.008075285 0.006460228 0.024225855 0.046836652 0.062987222 0.074292621 0.077522735 0.080752848 0.082367905 0.080752848 0.080752848 0.079137791 0.077522735 0.075907678 0.071062507 0.067832393 0.064602279 0.061372165 0.058142051 0.054911937 0.051681823 0.050066766 0.046836652 0.043606538 0.041991481 0.040376424 0.038761367 0.03714631 0.035531253 0.032301139 0.030686082 0.029071025 0.027455968 0.027455968 0.025840912 0.025840912 0.024225855 0.024225855 0.022610798 0.022610798 0.020995741 0.020995741 0.019380684 0.019380684 0.017765627 0.017765627 0.01615057 0.01615057 0.014535513 0.012920456;
end;
%----------------------------------------------------------------
% check the starting values for the steady state
%---------------------------------------------------------------
resid(1);
%----------------------------------------------------------------
% compute steady state given the starting values
%---------------------------------------------------------------
steady;
%----------------------------------------------------------------
% check Blanchard-Kahn-conditions
%---------------------------------------------------------------
check;
simul(periods=100,maxit=1000,stack_solve_algo=6);
```
terminates with imaginary parts in the results. Judging from the size of imaginary parts (maximum in the range of 1e-13) this is due to numerical inaccuracies.
With `stack_solve_algo=6`, the message is `Perfect foresight solution found` while with `stack_solve_algo=0`, it fails with
`Simulation terminated with imaginary parts in the residuals or endogenous variables.`
We should aim at making this consistent. My proposal would be to discard any imaginary parts smaller than 1e-10 in perfect foresight simulations and return the cleaned values as a solution.
Sidenote: in the attached mod-file, capital explodes despite the model being Blanchard-Kahn stable. This is something regularly reported by users in the forum in the presence of endogenous stocks. IS there a good explanation for this?
4.5MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/894An option (noprint?) should be available to disable output of solvers2019-06-19T15:38:00ZTom HoldenAn option (noprint?) should be available to disable output of solversIf I'm not misremembering, prior versions of dynare used to allow you to pass custom options to solvers.
While complete flexibility in solver options is probably unnecessary, it would be good if there was an option to disable output fro...If I'm not misremembering, prior versions of dynare used to allow you to pass custom options to solvers.
While complete flexibility in solver options is probably unnecessary, it would be good if there was an option to disable output from solvers (e.g., to set 'display', 'off' in the fsolve optimset call). Otherwise, when optimising the parameters of a model in a loop over resol (e.g. in a partially global solution procedure), the screen is so full of junk that you cannot track the progress of the outer optimisation.
4.5Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/887Document new optimizers...2019-06-19T15:38:00ZStéphane Adjemianstepan@adjemian.euDocument new optimizers...... And fix license.txt. See #873.
... And fix license.txt. See #873.
4.5https://git.dynare.org/Dynare/dynare/-/issues/885move creation of M_ to a separate file2019-06-19T15:38:00ZHoutan Bastanimove creation of M_ to a separate file4.5Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dynare/-/issues/879update doc for markov_switching2019-06-19T15:38:00ZHoutan Bastaniupdate doc for markov_switching`number_of_states` should be `number_of_regimes`
The `restrictions`, `number_of_lags`, and `parameters` options have not been documented
`number_of_states` should be `number_of_regimes`
The `restrictions`, `number_of_lags`, and `parameters` options have not been documented
4.5Johannes PfeiferJohannes Pfeiferhttps://git.dynare.org/Dynare/dynare/-/issues/875Fix extended path with varexo_det2019-06-19T15:38:00ZJohannes PfeiferFix extended path with varexo_detAs noted in #806 `oo_.exo_simul` is `periods` by `exo_nbr` while `endo_simul` has periods as the second dimension. This seems to be a problem for e.g. `extended_path`. See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6675
As noted in #806 `oo_.exo_simul` is `periods` by `exo_nbr` while `endo_simul` has periods as the second dimension. This seems to be a problem for e.g. `extended_path`. See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6675
4.5MichelJuillardMichelJuillardhttps://git.dynare.org/Dynare/dynare/-/issues/874Update license file2019-06-19T15:38:00ZJohannes PfeiferUpdate license fileWe have massively changed the folder structure, but these changes are not reflected in the license file yet.
We have massively changed the folder structure, but these changes are not reflected in the license file yet.
4.5Johannes PfeiferJohannes Pfeifer