Unverified Commit e3207b1d authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Extended path: remove ep.use_bytecode flag

It’s actually useless and complicates the code. Simply rely on
options_.bytecode.

Ref. #1742
parent 10333f99
......@@ -37,7 +37,6 @@ ep:
ortpol: 'hermite'
nodes: 5
pruned: [1x1 struct]
use_bytecode: 0
verbosity: 0
initial_period: NaN
lmmcp:
......@@ -59,7 +58,6 @@ ut: (unscented free parameter)
pfm.stochastic_order = DynareOptions.ep.stochastic.order;
pfm.periods = DynareOptions.ep.periods;
pfm.verbose = DynareOptions.ep.verbosity;
pfm.use_bytecode = DynareOptions.ep.use_bytecode ;
* in extended_path_core, one passes options.ep and individual options
......
function e = euler_equation_error(y0,x,innovations,M,options,oo,pfm,nodes,weights)
% Copyright (C) 2016-2017 Dynare Team
% Copyright (C) 2016-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -23,7 +23,7 @@ ep = options.ep;
M.endo_nbr, M.exo_nbr, ...
innovations.positive_var_indx, ...
x, ep.init, y0, oo.steady_state, ...
0, ep.use_bytecode, ...
0, ...
ep.stochastic.order, M, ...
pfm, ep.stochastic.algo, ...
ep.solve_algo, ...
......@@ -39,7 +39,7 @@ for i=1:length(nodes)
[y2, info_convergence, endogenousvariablespaths] = ...
extended_path_core(ep.periods, M.endo_nbr, M.exo_nbr, ...
innovations.positive_var_indx, x2, ep.init, ...
y1, oo.steady_state, 0, ep.use_bytecode, ...
y1, oo.steady_state, 0, ...
ep.stochastic.order, M, pfm, ep.stochastic.algo, ...
ep.solve_algo, ep.stack_solve_algo, options.lmmcp, ...
options, oo, []);
......@@ -47,4 +47,4 @@ for i=1:length(nodes)
z = [y0(i_pred); y1; y2(i_fwrd)];
res(:,i) = dynamic_model(z,x,M.params,oo.steady_state,2);
end
e = res*weights;
\ No newline at end of file
e = res*weights;
......@@ -19,7 +19,7 @@ function [ts, DynareResults] = extended_path(initialconditions, samplesize, exog
%
% SPECIAL REQUIREMENTS
% Copyright (C) 2009-2018 Dynare Team
% Copyright (C) 2009-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -70,7 +70,7 @@ while (t <= samplesize)
[endogenous_variables_paths(:,t), info_convergence, endogenousvariablespaths] = extended_path_core(ep.periods, DynareModel.endo_nbr, DynareModel.exo_nbr, innovations.positive_var_indx, ...
spfm_exo_simul, ep.init, endogenous_variables_paths(:,t-1), ...
DynareResults.steady_state, ...
verbosity, ep.use_bytecode, ep.stochastic.order, ...
verbosity, ep.stochastic.order, ...
DynareModel, pfm, ep.stochastic.algo, ep.solve_algo, ep.stack_solve_algo, ...
DynareOptions.lmmcp, ...
DynareOptions, ...
......@@ -105,4 +105,4 @@ assignin('base', 'Simulated_time_series', ts);
if ~nargout || nargout<2
assignin('base', 'oo_', DynareResults);
end
\ No newline at end of file
end
function [y, info_convergence, endogenousvariablespaths] = extended_path_core(periods,endo_nbr,exo_nbr,positive_var_indx, ...
exo_simul,init,initial_conditions,...
steady_state, ...
debug,bytecode_flag,order,M,pfm,algo,solve_algo,stack_solve_algo,...
debug,order,M,pfm,algo,solve_algo,stack_solve_algo,...
olmmcp,options,oo,initialguess)
% Copyright (C) 2016-2020 Dynare Team
......@@ -40,7 +40,7 @@ if debug
save ep_test_1.mat endo_simul exo_simul
end
if bytecode_flag && order > 0
if options.bytecode && order > 0
error('Option order > 0 of extended_path command is not compatible with bytecode option.')
end
if options.block && order > 0
......@@ -53,7 +53,6 @@ if order == 0
oo.endo_simul = endo_simul;
oo.exo_simul = exo_simul;
oo.steady_state = steady_state;
options.bytecode = bytecode_flag;
options.lmmcp = olmmcp;
options.solve_algo = solve_algo;
options.stack_solve_algo = stack_solve_algo;
......
......@@ -35,9 +35,6 @@ function [initial_conditions, innovations, pfm, ep, verbosity, DynareOptions, Dy
ep = DynareOptions.ep;
% Set bytecode flag (see #1717)
ep.use_bytecode = DynareOptions.bytecode;
% Set verbosity levels.
DynareOptions.verbosity = ep.verbosity;
verbosity = ep.verbosity+ep.debug;
......
......@@ -19,7 +19,7 @@ function Simulations = extended_path_mc(initialconditions, samplesize, replic, e
%
% SPECIAL REQUIREMENTS
% Copyright (C) 2016-2017 Dynare Team
% Copyright (C) 2016-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -83,7 +83,7 @@ if ep.parallel
[endogenous_variables_paths(:,t), info_convergence] = extended_path_core(ep.periods, DynareModel.endo_nbr, DynareModel.exo_nbr, innovations_.positive_var_indx, ...
spfm_exo_simul, ep.init, endogenous_variables_paths(:,t-1), ...
DynareResults_.steady_state, ...
ep.verbosity, ep.use_bytecode, ep.stochastic.order, ...
ep.verbosity, ep.stochastic.order, ...
DynareModel, pfm,ep.stochastic.algo, ep.solve_algo, ep.stack_solve_algo, ...
DynareOptions.lmmcp, DynareOptions, DynareResults_);
if ~info_convergence
......@@ -112,7 +112,7 @@ else
[endogenous_variables_paths(:,t), info_convergence] = extended_path_core(ep.periods, DynareModel.endo_nbr, DynareModel.exo_nbr, innovations.positive_var_indx, ...
spfm_exo_simul, ep.init, endogenous_variables_paths(:,t-1), ...
DynareResults.steady_state, ...
ep.verbosity, ep.use_bytecode, ep.stochastic.order, ...
ep.verbosity, ep.stochastic.order, ...
DynareModel, pfm,ep.stochastic.algo, ep.solve_algo, ep.stack_solve_algo, ...
DynareOptions.lmmcp, DynareOptions, DynareResults);
if ~info_convergence
......
function pfm = setup_stochastic_perfect_foresight_model_solver(DynareModel,DynareOptions,DynareOutput)
% Copyright (C) 2013-2017 Dynare Team
% Copyright (C) 2013-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -72,4 +72,3 @@ end
pfm.verbose = DynareOptions.ep.verbosity;
pfm.maxit_ = DynareOptions.simul.maxit;
pfm.tolerance = DynareOptions.dynatol.f;
pfm.use_bytecode = DynareOptions.ep.use_bytecode ;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment