Change the default algorithm for stack_solve_algo = 0
The old algorithm (LBJ) is now available under stack_stock_algo = 6time-shift
parent
4b86df0581
commit
05dca0e3ea
|
@ -2795,7 +2795,7 @@ Algorithm used for computing the solution. Possible values are:
|
||||||
|
|
||||||
@item 0
|
@item 0
|
||||||
Newton method to solve simultaneously all the equations for every
|
Newton method to solve simultaneously all the equations for every
|
||||||
period, see @cite{Juillard (1996)} (Default).
|
period, using sparse matrices (Default).
|
||||||
|
|
||||||
@item 1
|
@item 1
|
||||||
Use a Newton algorithm with a sparse LU solver at each iteration
|
Use a Newton algorithm with a sparse LU solver at each iteration
|
||||||
|
@ -2821,6 +2821,13 @@ declaration}).
|
||||||
Use a Newton algorithm with a sparse Gaussian elimination (SPE) solver
|
Use a Newton algorithm with a sparse Gaussian elimination (SPE) solver
|
||||||
at each iteration (requires @code{bytecode} option, @pxref{Model
|
at each iteration (requires @code{bytecode} option, @pxref{Model
|
||||||
declaration}).
|
declaration}).
|
||||||
|
|
||||||
|
@item 6
|
||||||
|
Use the historical algorithm proposed in @cite{Juillard (1996)}: it is
|
||||||
|
slower than @code{stack_solve_algo=0}, but may be less memory consuming
|
||||||
|
on big models (not available with @code{bytecode} and/or @code{block}
|
||||||
|
options).
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@item markowitz = @var{DOUBLE}
|
@item markowitz = @var{DOUBLE}
|
||||||
|
|
119
matlab/sim1.m
119
matlab/sim1.m
|
@ -1,21 +1,19 @@
|
||||||
function sim1
|
function sim1
|
||||||
% function sim1
|
% function sim1
|
||||||
% performs deterministic simulations with lead or lag on one period
|
% Performs deterministic simulations with lead or lag on one period.
|
||||||
|
% Uses sparse matrices.
|
||||||
%
|
%
|
||||||
% INPUTS
|
% INPUTS
|
||||||
% ...
|
% ...
|
||||||
% OUTPUTS
|
% OUTPUTS
|
||||||
% ...
|
% ...
|
||||||
% ALGORITHM
|
% ALGORITHM
|
||||||
% Laffargue, Boucekkine, Juillard (LBJ)
|
% ...
|
||||||
% see Juillard (1996) Dynare: A program for the resolution and
|
|
||||||
% simulation of dynamic models with forward variables through the use
|
|
||||||
% of a relaxation algorithm. CEPREMAP. Couverture Orange. 9602.
|
|
||||||
%
|
%
|
||||||
% SPECIAL REQUIREMENTS
|
% SPECIAL REQUIREMENTS
|
||||||
% None.
|
% None.
|
||||||
|
|
||||||
% Copyright (C) 1996-2010 Dynare Team
|
% Copyright (C) 1996-2012 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -36,13 +34,19 @@ global M_ options_ oo_
|
||||||
|
|
||||||
lead_lag_incidence = M_.lead_lag_incidence;
|
lead_lag_incidence = M_.lead_lag_incidence;
|
||||||
|
|
||||||
ny = size(oo_.endo_simul,1) ;
|
ny = M_.endo_nbr;
|
||||||
|
|
||||||
|
max_lag = M_.maximum_endo_lag;
|
||||||
|
|
||||||
nyp = nnz(lead_lag_incidence(1,:)) ;
|
nyp = nnz(lead_lag_incidence(1,:)) ;
|
||||||
nyf = nnz(lead_lag_incidence(3,:)) ;
|
|
||||||
nrs = ny+nyp+nyf+1 ;
|
|
||||||
nrc = nyf+1 ;
|
|
||||||
iyf = find(lead_lag_incidence(3,:)>0) ;
|
|
||||||
iyp = find(lead_lag_incidence(1,:)>0) ;
|
iyp = find(lead_lag_incidence(1,:)>0) ;
|
||||||
|
ny0 = nnz(lead_lag_incidence(2,:)) ;
|
||||||
|
iy0 = find(lead_lag_incidence(2,:)>0) ;
|
||||||
|
nyf = nnz(lead_lag_incidence(3,:)) ;
|
||||||
|
iyf = find(lead_lag_incidence(3,:)>0) ;
|
||||||
|
|
||||||
|
nd = nyp+ny0+nyf;
|
||||||
|
nrc = nyf+1 ;
|
||||||
isp = [1:nyp] ;
|
isp = [1:nyp] ;
|
||||||
is = [nyp+1:ny+nyp] ;
|
is = [nyp+1:ny+nyp] ;
|
||||||
isf = iyf+nyp ;
|
isf = iyf+nyp ;
|
||||||
|
@ -50,57 +54,63 @@ isf1 = [nyp+ny+1:nyf+nyp+ny+1] ;
|
||||||
stop = 0 ;
|
stop = 0 ;
|
||||||
iz = [1:ny+nyp+nyf];
|
iz = [1:ny+nyp+nyf];
|
||||||
|
|
||||||
|
periods = options_.periods
|
||||||
|
steady_state = oo_.steady_state;
|
||||||
|
params = M_.params;
|
||||||
|
endo_simul = oo_.endo_simul;
|
||||||
|
exo_simul = oo_.exo_simul;
|
||||||
|
i_cols_1 = nonzeros(lead_lag_incidence(2:3,:)');
|
||||||
|
i_cols_A1 = find(lead_lag_incidence(2:3,:)');
|
||||||
|
i_cols_T = nonzeros(lead_lag_incidence(1:2,:)');
|
||||||
|
i_cols_j = 1:nd;
|
||||||
|
i_upd = ny+(1:periods*ny);
|
||||||
|
|
||||||
|
Y = endo_simul(:);
|
||||||
|
|
||||||
disp (['-----------------------------------------------------']) ;
|
disp (['-----------------------------------------------------']) ;
|
||||||
disp (['MODEL SIMULATION :']) ;
|
disp (['MODEL SIMULATION :']) ;
|
||||||
fprintf('\n') ;
|
fprintf('\n') ;
|
||||||
|
|
||||||
it_init = M_.maximum_lag+1 ;
|
|
||||||
|
|
||||||
|
model_dynamic = str2func([M_.fname,'_dynamic']);
|
||||||
|
z = Y(find(lead_lag_incidence'));
|
||||||
|
[d1,jacobian] = model_dynamic(z,oo_.exo_simul, params, ...
|
||||||
|
steady_state,2);
|
||||||
|
|
||||||
|
A = sparse([],[],[],periods*ny,periods*ny,periods*nnz(jacobian));
|
||||||
|
res = zeros(periods*ny,1);
|
||||||
|
|
||||||
|
|
||||||
h1 = clock ;
|
h1 = clock ;
|
||||||
for iter = 1:options_.maxit_
|
for iter = 1:options_.maxit_
|
||||||
h2 = clock ;
|
h2 = clock ;
|
||||||
|
|
||||||
if options_.terminal_condition == 0
|
i_rows = 1:ny;
|
||||||
c = zeros(ny*options_.periods,nrc) ;
|
i_cols = find(lead_lag_incidence');
|
||||||
else
|
i_cols_A = i_cols;
|
||||||
c = zeros(ny*(options_.periods+1),nrc) ;
|
|
||||||
end
|
|
||||||
|
|
||||||
it_ = it_init ;
|
for it = 2:(periods+1)
|
||||||
z = [oo_.endo_simul(iyp,it_-1) ; oo_.endo_simul(:,it_) ; oo_.endo_simul(iyf,it_+1)] ;
|
|
||||||
[d1,jacobian] = feval([M_.fname '_dynamic'],z,oo_.exo_simul, M_.params, oo_.steady_state,it_);
|
[d1,jacobian] = model_dynamic(Y(i_cols),exo_simul, params, ...
|
||||||
jacobian = [jacobian(:,iz) -d1] ;
|
steady_state,it);
|
||||||
ic = [1:ny] ;
|
if it == 2
|
||||||
icp = iyp ;
|
A(i_rows,i_cols_A1) = jacobian(:,i_cols_1);
|
||||||
c (ic,:) = jacobian(:,is)\jacobian(:,isf1) ;
|
elseif it == periods+1
|
||||||
for it_ = it_init+(1:options_.periods-1)
|
A(i_rows,i_cols_A(i_cols_T)) = jacobian(:,i_cols_T);
|
||||||
z = [oo_.endo_simul(iyp,it_-1) ; oo_.endo_simul(:,it_) ; oo_.endo_simul(iyf,it_+1)] ;
|
else
|
||||||
[d1,jacobian] = feval([M_.fname '_dynamic'],z,oo_.exo_simul, ...
|
A(i_rows,i_cols_A) = jacobian(:,i_cols_j);
|
||||||
M_.params, oo_.steady_state, it_);
|
end
|
||||||
jacobian = [jacobian(:,iz) -d1] ;
|
|
||||||
jacobian(:,[isf nrs]) = jacobian(:,[isf nrs])-jacobian(:,isp)*c(icp,:) ;
|
res(i_rows) = d1;
|
||||||
ic = ic + ny ;
|
|
||||||
icp = icp + ny ;
|
i_rows = i_rows + ny;
|
||||||
c (ic,:) = jacobian(:,is)\jacobian(:,isf1) ;
|
i_cols = i_cols + ny;
|
||||||
|
if it > 2
|
||||||
|
i_cols_A = i_cols_A + ny;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if options_.terminal_condition == 1
|
err = max(abs(res));
|
||||||
s = eye(ny) ;
|
|
||||||
s(:,isf) = s(:,isf)+c(ic,1:nyf) ;
|
|
||||||
ic = ic + ny ;
|
|
||||||
c(ic,nrc) = s\c(ic,nrc) ;
|
|
||||||
c = bksup1(c,ny,nrc,iyf,options_.periods) ;
|
|
||||||
c = reshape(c,ny,options_.periods+1) ;
|
|
||||||
oo_.endo_simul(:,it_init+(0:options_.periods)) = oo_.endo_simul(:,it_init+(0:options_.periods))+options_.slowc*c ;
|
|
||||||
else
|
|
||||||
c = bksup1(c,ny,nrc,iyf,options_.periods) ;
|
|
||||||
c = reshape(c,ny,options_.periods) ;
|
|
||||||
oo_.endo_simul(:,it_init+(0:options_.periods-1)) = oo_.endo_simul(:,it_init+(0:options_.periods-1))+options_.slowc*c ;
|
|
||||||
end
|
|
||||||
|
|
||||||
err = max(max(abs(c./options_.scalv')));
|
|
||||||
disp([num2str(iter) ' - err = ' num2str(err)]) ;
|
|
||||||
disp([' Time of iteration :' num2str(etime(clock,h2))]) ;
|
|
||||||
|
|
||||||
if err < options_.dynatol.f
|
if err < options_.dynatol.f
|
||||||
stop = 1 ;
|
stop = 1 ;
|
||||||
|
@ -112,10 +122,17 @@ for iter = 1:options_.maxit_
|
||||||
oo_.deterministic_simulation.status = 1;% Convergency obtained.
|
oo_.deterministic_simulation.status = 1;% Convergency obtained.
|
||||||
oo_.deterministic_simulation.error = err;
|
oo_.deterministic_simulation.error = err;
|
||||||
oo_.deterministic_simulation.iterations = iter;
|
oo_.deterministic_simulation.iterations = iter;
|
||||||
|
oo_.endo_simul = reshape(Y,ny,periods+2);
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
dy = -A\res;
|
||||||
|
|
||||||
|
Y(i_upd) = Y(i_upd) + dy;
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if ~stop
|
if ~stop
|
||||||
fprintf('\n') ;
|
fprintf('\n') ;
|
||||||
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
|
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
|
||||||
|
|
|
@ -1,19 +1,22 @@
|
||||||
function sim1a
|
function sim1_lbj
|
||||||
% function sim1a
|
% function sim1_lbj
|
||||||
% Performs deterministic simulations with lead or lag on one period
|
% performs deterministic simulations with lead or lag on one period
|
||||||
% Alternative algorithm to the one implemented in sim1
|
% using the historical LBJ algorithm
|
||||||
%
|
%
|
||||||
% INPUTS
|
% INPUTS
|
||||||
% ...
|
% ...
|
||||||
% OUTPUTS
|
% OUTPUTS
|
||||||
% ...
|
% ...
|
||||||
% ALGORITHM
|
% ALGORITHM
|
||||||
% ...
|
% Laffargue, Boucekkine, Juillard (LBJ)
|
||||||
|
% see Juillard (1996) Dynare: A program for the resolution and
|
||||||
|
% simulation of dynamic models with forward variables through the use
|
||||||
|
% of a relaxation algorithm. CEPREMAP. Couverture Orange. 9602.
|
||||||
%
|
%
|
||||||
% SPECIAL REQUIREMENTS
|
% SPECIAL REQUIREMENTS
|
||||||
% None.
|
% None.
|
||||||
|
|
||||||
% Copyright (C) 1996-2012 Dynare Team
|
% Copyright (C) 1996-2010 Dynare Team
|
||||||
%
|
%
|
||||||
% This file is part of Dynare.
|
% This file is part of Dynare.
|
||||||
%
|
%
|
||||||
|
@ -34,19 +37,13 @@ global M_ options_ oo_
|
||||||
|
|
||||||
lead_lag_incidence = M_.lead_lag_incidence;
|
lead_lag_incidence = M_.lead_lag_incidence;
|
||||||
|
|
||||||
ny = M_.endo_nbr;
|
ny = size(oo_.endo_simul,1) ;
|
||||||
|
|
||||||
max_lag = M_.maximum_endo_lag;
|
|
||||||
|
|
||||||
nyp = nnz(lead_lag_incidence(1,:)) ;
|
nyp = nnz(lead_lag_incidence(1,:)) ;
|
||||||
iyp = find(lead_lag_incidence(1,:)>0) ;
|
|
||||||
ny0 = nnz(lead_lag_incidence(2,:)) ;
|
|
||||||
iy0 = find(lead_lag_incidence(2,:)>0) ;
|
|
||||||
nyf = nnz(lead_lag_incidence(3,:)) ;
|
nyf = nnz(lead_lag_incidence(3,:)) ;
|
||||||
iyf = find(lead_lag_incidence(3,:)>0) ;
|
nrs = ny+nyp+nyf+1 ;
|
||||||
|
|
||||||
nd = nyp+ny0+nyf;
|
|
||||||
nrc = nyf+1 ;
|
nrc = nyf+1 ;
|
||||||
|
iyf = find(lead_lag_incidence(3,:)>0) ;
|
||||||
|
iyp = find(lead_lag_incidence(1,:)>0) ;
|
||||||
isp = [1:nyp] ;
|
isp = [1:nyp] ;
|
||||||
is = [nyp+1:ny+nyp] ;
|
is = [nyp+1:ny+nyp] ;
|
||||||
isf = iyf+nyp ;
|
isf = iyf+nyp ;
|
||||||
|
@ -54,63 +51,57 @@ isf1 = [nyp+ny+1:nyf+nyp+ny+1] ;
|
||||||
stop = 0 ;
|
stop = 0 ;
|
||||||
iz = [1:ny+nyp+nyf];
|
iz = [1:ny+nyp+nyf];
|
||||||
|
|
||||||
periods = options_.periods
|
|
||||||
steady_state = oo_.steady_state;
|
|
||||||
params = M_.params;
|
|
||||||
endo_simul = oo_.endo_simul;
|
|
||||||
exo_simul = oo_.exo_simul;
|
|
||||||
i_cols_1 = nonzeros(lead_lag_incidence(2:3,:)');
|
|
||||||
i_cols_A1 = find(lead_lag_incidence(2:3,:)');
|
|
||||||
i_cols_T = nonzeros(lead_lag_incidence(1:2,:)');
|
|
||||||
i_cols_j = 1:nd;
|
|
||||||
i_upd = ny+(1:periods*ny);
|
|
||||||
|
|
||||||
Y = endo_simul(:);
|
|
||||||
|
|
||||||
disp (['-----------------------------------------------------']) ;
|
disp (['-----------------------------------------------------']) ;
|
||||||
disp (['MODEL SIMULATION :']) ;
|
disp (['MODEL SIMULATION :']) ;
|
||||||
fprintf('\n') ;
|
fprintf('\n') ;
|
||||||
|
|
||||||
|
it_init = M_.maximum_lag+1 ;
|
||||||
|
|
||||||
model_dynamic = str2func([M_.fname,'_dynamic']);
|
|
||||||
z = Y(find(lead_lag_incidence'));
|
|
||||||
[d1,jacobian] = model_dynamic(z,oo_.exo_simul, params, ...
|
|
||||||
steady_state,2);
|
|
||||||
|
|
||||||
A = sparse([],[],[],periods*ny,periods*ny,periods*nnz(jacobian));
|
|
||||||
res = zeros(periods*ny,1);
|
|
||||||
|
|
||||||
|
|
||||||
h1 = clock ;
|
h1 = clock ;
|
||||||
for iter = 1:options_.maxit_
|
for iter = 1:options_.maxit_
|
||||||
h2 = clock ;
|
h2 = clock ;
|
||||||
|
|
||||||
i_rows = 1:ny;
|
if options_.terminal_condition == 0
|
||||||
i_cols = find(lead_lag_incidence');
|
c = zeros(ny*options_.periods,nrc) ;
|
||||||
i_cols_A = i_cols;
|
else
|
||||||
|
c = zeros(ny*(options_.periods+1),nrc) ;
|
||||||
for it = 2:(periods+1)
|
|
||||||
|
|
||||||
[d1,jacobian] = model_dynamic(Y(i_cols),exo_simul, params, ...
|
|
||||||
steady_state,it);
|
|
||||||
if it == 2
|
|
||||||
A(i_rows,i_cols_A1) = jacobian(:,i_cols_1);
|
|
||||||
elseif it == periods+1
|
|
||||||
A(i_rows,i_cols_A(i_cols_T)) = jacobian(:,i_cols_T);
|
|
||||||
else
|
|
||||||
A(i_rows,i_cols_A) = jacobian(:,i_cols_j);
|
|
||||||
end
|
|
||||||
|
|
||||||
res(i_rows) = d1;
|
|
||||||
|
|
||||||
i_rows = i_rows + ny;
|
|
||||||
i_cols = i_cols + ny;
|
|
||||||
if it > 2
|
|
||||||
i_cols_A = i_cols_A + ny;
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
err = max(abs(res));
|
it_ = it_init ;
|
||||||
|
z = [oo_.endo_simul(iyp,it_-1) ; oo_.endo_simul(:,it_) ; oo_.endo_simul(iyf,it_+1)] ;
|
||||||
|
[d1,jacobian] = feval([M_.fname '_dynamic'],z,oo_.exo_simul, M_.params, oo_.steady_state,it_);
|
||||||
|
jacobian = [jacobian(:,iz) -d1] ;
|
||||||
|
ic = [1:ny] ;
|
||||||
|
icp = iyp ;
|
||||||
|
c (ic,:) = jacobian(:,is)\jacobian(:,isf1) ;
|
||||||
|
for it_ = it_init+(1:options_.periods-1)
|
||||||
|
z = [oo_.endo_simul(iyp,it_-1) ; oo_.endo_simul(:,it_) ; oo_.endo_simul(iyf,it_+1)] ;
|
||||||
|
[d1,jacobian] = feval([M_.fname '_dynamic'],z,oo_.exo_simul, ...
|
||||||
|
M_.params, oo_.steady_state, it_);
|
||||||
|
jacobian = [jacobian(:,iz) -d1] ;
|
||||||
|
jacobian(:,[isf nrs]) = jacobian(:,[isf nrs])-jacobian(:,isp)*c(icp,:) ;
|
||||||
|
ic = ic + ny ;
|
||||||
|
icp = icp + ny ;
|
||||||
|
c (ic,:) = jacobian(:,is)\jacobian(:,isf1) ;
|
||||||
|
end
|
||||||
|
|
||||||
|
if options_.terminal_condition == 1
|
||||||
|
s = eye(ny) ;
|
||||||
|
s(:,isf) = s(:,isf)+c(ic,1:nyf) ;
|
||||||
|
ic = ic + ny ;
|
||||||
|
c(ic,nrc) = s\c(ic,nrc) ;
|
||||||
|
c = bksup1(c,ny,nrc,iyf,options_.periods) ;
|
||||||
|
c = reshape(c,ny,options_.periods+1) ;
|
||||||
|
oo_.endo_simul(:,it_init+(0:options_.periods)) = oo_.endo_simul(:,it_init+(0:options_.periods))+options_.slowc*c ;
|
||||||
|
else
|
||||||
|
c = bksup1(c,ny,nrc,iyf,options_.periods) ;
|
||||||
|
c = reshape(c,ny,options_.periods) ;
|
||||||
|
oo_.endo_simul(:,it_init+(0:options_.periods-1)) = oo_.endo_simul(:,it_init+(0:options_.periods-1))+options_.slowc*c ;
|
||||||
|
end
|
||||||
|
|
||||||
|
err = max(max(abs(c./options_.scalv')));
|
||||||
|
disp([num2str(iter) ' - err = ' num2str(err)]) ;
|
||||||
|
disp([' Time of iteration :' num2str(etime(clock,h2))]) ;
|
||||||
|
|
||||||
if err < options_.dynatol.f
|
if err < options_.dynatol.f
|
||||||
stop = 1 ;
|
stop = 1 ;
|
||||||
|
@ -122,17 +113,10 @@ for iter = 1:options_.maxit_
|
||||||
oo_.deterministic_simulation.status = 1;% Convergency obtained.
|
oo_.deterministic_simulation.status = 1;% Convergency obtained.
|
||||||
oo_.deterministic_simulation.error = err;
|
oo_.deterministic_simulation.error = err;
|
||||||
oo_.deterministic_simulation.iterations = iter;
|
oo_.deterministic_simulation.iterations = iter;
|
||||||
oo_.endo_simul = reshape(Y,ny,periods+2);
|
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
dy = -A\res;
|
|
||||||
|
|
||||||
Y(i_upd) = Y(i_upd) + dy;
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if ~stop
|
if ~stop
|
||||||
fprintf('\n') ;
|
fprintf('\n') ;
|
||||||
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
|
disp([' Total time of simulation :' num2str(etime(clock,h1))]) ;
|
|
@ -33,18 +33,23 @@ global M_ options_ oo_
|
||||||
|
|
||||||
test_for_deep_parameters_calibration(M_);
|
test_for_deep_parameters_calibration(M_);
|
||||||
|
|
||||||
if options_.stack_solve_algo < 0 || options_.stack_solve_algo > 5
|
if options_.stack_solve_algo < 0 || options_.stack_solve_algo > 6
|
||||||
error('SIMUL: stack_solve_algo must be between 0 and 5')
|
error('SIMUL: stack_solve_algo must be between 0 and 6')
|
||||||
end
|
end
|
||||||
|
|
||||||
if ~options_.block && ~options_.bytecode && options_.stack_solve_algo ~= 0
|
if ~options_.block && ~options_.bytecode && options_.stack_solve_algo ~= 0 ...
|
||||||
error('SIMUL: you must use stack_solve_algo=0 when not using block nor bytecode option')
|
&& options_.stack_solve_algo ~= 6
|
||||||
|
error('SIMUL: you must use stack_solve_algo=0 or stack_solve_algo=6 when not using block nor bytecode option')
|
||||||
end
|
end
|
||||||
|
|
||||||
if options_.block && ~options_.bytecode && options_.stack_solve_algo == 5
|
if options_.block && ~options_.bytecode && options_.stack_solve_algo == 5
|
||||||
error('SIMUL: you can''t use stack_solve_algo = 5 without bytecode option')
|
error('SIMUL: you can''t use stack_solve_algo = 5 without bytecode option')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (options_.block || options_.bytecode) && options_.stack_solve_algo == 6
|
||||||
|
error('SIMUL: you can''t use stack_solve_algo = 6 with block or bytecode option')
|
||||||
|
end
|
||||||
|
|
||||||
if exist('OCTAVE_VERSION') && options_.stack_solve_algo == 2
|
if exist('OCTAVE_VERSION') && options_.stack_solve_algo == 2
|
||||||
error('SIMUL: you can''t use stack_solve_algo = 2 under Octave')
|
error('SIMUL: you can''t use stack_solve_algo = 2 under Octave')
|
||||||
end
|
end
|
||||||
|
@ -91,7 +96,11 @@ else
|
||||||
elseif M_.maximum_endo_lag == 0 % Purely forward model
|
elseif M_.maximum_endo_lag == 0 % Purely forward model
|
||||||
sim1_purely_forward;
|
sim1_purely_forward;
|
||||||
else % General case
|
else % General case
|
||||||
sim1;
|
if options_.stack_solve_algo == 0
|
||||||
|
sim1;
|
||||||
|
else % stack_solve_algo = 6
|
||||||
|
sim1_lbj;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -78,7 +78,7 @@ for blockFlag = 0:1
|
||||||
default_stack_solve_algo = 0;
|
default_stack_solve_algo = 0;
|
||||||
if ~blockFlag && ~bytecodeFlag
|
if ~blockFlag && ~bytecodeFlag
|
||||||
solve_algos = 1:4;
|
solve_algos = 1:4;
|
||||||
stack_solve_algos = 0;
|
stack_solve_algos = [0 6];
|
||||||
elseif blockFlag && ~bytecodeFlag
|
elseif blockFlag && ~bytecodeFlag
|
||||||
solve_algos = [1:4 6:8];
|
solve_algos = [1:4 6:8];
|
||||||
stack_solve_algos = 0:4;
|
stack_solve_algos = 0:4;
|
||||||
|
|
|
@ -75,7 +75,7 @@ for blockFlag = 0:1
|
||||||
default_stack_solve_algo = 0;
|
default_stack_solve_algo = 0;
|
||||||
if !blockFlag && !bytecodeFlag
|
if !blockFlag && !bytecodeFlag
|
||||||
solve_algos = 0:4;
|
solve_algos = 0:4;
|
||||||
stack_solve_algos = 0;
|
stack_solve_algos = [0 6];
|
||||||
elseif blockFlag && !bytecodeFlag
|
elseif blockFlag && !bytecodeFlag
|
||||||
solve_algos = [0:4 6 8];
|
solve_algos = [0:4 6 8];
|
||||||
stack_solve_algos = [0 1 3 4];
|
stack_solve_algos = [0 1 3 4];
|
||||||
|
|
Loading…
Reference in New Issue