Commit f5c9621c authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Changed the definition of the maximum number of function evaluations in...

Changed the definition of the maximum number of function evaluations in dynare'es iplementation of simplex algorithm (mode_compute=8).
parent 84227744
......@@ -443,7 +443,9 @@ options_.homotopy_steps = 1;
options_.homotopy_force_continue = 0;
% Simplex optimization routine (variation on Nelder Mead algorithm).
options_.simplex = [];
simplex.maxfcallfactor = 500;
simplex.maxfcall = [];
options_.simplex = simplex;
% CMAES optimization routine.
cmaes.SaveVariables='off';
......
......@@ -41,6 +41,11 @@ verbose = 2;
% Set number of control variables.
number_of_variables = length(x);
% get options.
if isempty(simplex.maxfcall)
max_func_calls = simplex.maxfcallfactor*number_of_variables
end
% Set tolerance parameter.
if isfield(options,'tolerance') && isfield(options.tolerance,'x')
x_tolerance = options.tolerance.x;
......@@ -61,12 +66,6 @@ if isfield(options,'maxiter')
else
max_iterations = 1000;
end
% Set maximum number of iterations.
if isfield(options,'maxfcall')
max_func_calls = options.maxfcall;
else
max_func_calls = 500*number_of_variables;
end
% Set reflection parameter.
if isfield(options,'reflection_parameter')
......
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