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

Fixed bug related to the dynare implementation of the simplex algorithm.

parent 8aea0bf1
......@@ -267,25 +267,15 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
[xparam1,fval,exitflag] = fminsearch(objective_function,xparam1,optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
case 8
% Dynare implementation of the simplex algorithm.
[xparam1,fval,exitflag] = simplex_optimization-routine(objective_function,xparam1,optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
case 9
[xparam1,fval,exitflag] = simplex_optimization_routine(objective_function,xparam1,options_.simplex,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
case 9
H0 = 1e-4*ones(nx,1);
opts.SaveVariables='off';
opts.DispFinal='on';
opts.WarnOnEqualFunctionValues='no';
opts.DispModulo='10';
opts.LogModulo='0';
opts.LogTime='0';
warning('off','CMAES:NonfinitenessRange');
warning('off','CMAES:InitialSigma');
if ~options_.dsge_var
[x, fval, COUNTEVAL, STOPFLAG, OUT, BESTEVER] = cmaes('dsge_likelihood',xparam1,H0,opts,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
else
[x, fval, COUNTEVAL, STOPFLAG, OUT, BESTEVER] = cmaes('DsgeVarLikelihood',xparam1,H0,opts,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
end
[x, fval, COUNTEVAL, STOPFLAG, OUT, BESTEVER] = cmaes(objective_function,xparam1,H0,options_.cmaes,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
xparam1=BESTEVER.x;
disp(sprintf('\n Objective function at mode: %f',fval))
case 101
disp(sprintf('\n Objective function at mode: %f',fval))
case 101
myoptions=soptions;
myoptions(2)=1e-6; %accuracy of argument
myoptions(3)=1e-6; %accuracy of function (see Solvopt p.29)
......
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