Skip to content
Snippets Groups Projects
Commit e7df9878 authored by Marco Ratto's avatar Marco Ratto
Browse files

1) changed options of optimizer n. 1 with analytic derivs;

2) force no analytic derivative with mode_check;
(cherry picked from commit 40e1e60f)
parent e37c2532
No related branches found
No related tags found
No related merge requests found
...@@ -186,7 +186,7 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation ...@@ -186,7 +186,7 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
eval(['optim_options = optimset(optim_options,' options_.optim_opt ');']); eval(['optim_options = optimset(optim_options,' options_.optim_opt ');']);
end end
if options_.analytic_derivation, if options_.analytic_derivation,
optim_options = optimset(optim_options,'GradObj','on'); optim_options = optimset(optim_options,'GradObj','on','TolX',1e-7);
end end
[xparam1,fval,exitflag,output,lamdba,grad,hessian_fmincon] = ... [xparam1,fval,exitflag,output,lamdba,grad,hessian_fmincon] = ...
fmincon(objective_function,xparam1,[],[],[],[],lb,ub,[],optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_); fmincon(objective_function,xparam1,[],[],[],[],lb,ub,[],optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
...@@ -426,7 +426,10 @@ if ~options_.mh_posterior_mode_estimation && options_.cova_compute ...@@ -426,7 +426,10 @@ if ~options_.mh_posterior_mode_estimation && options_.cova_compute
end end
if options_.mode_check == 1 && ~options_.mh_posterior_mode_estimation if options_.mode_check == 1 && ~options_.mh_posterior_mode_estimation
ana_deriv = options_.analytic_derivation;
options_.analytic_derivation = 0;
mode_check(objective_function,xparam1,hh,dataset_,options_,M_,estim_params_,bayestopt_,oo_); mode_check(objective_function,xparam1,hh,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
options_.analytic_derivation = ana_deriv;
end end
oo_.posterior.optimization.mode = xparam1; oo_.posterior.optimization.mode = xparam1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment