Commit 5c883389 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix mode_compute=3 under Octave

parent 8c7e3d46
......@@ -221,7 +221,14 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
if options_.analytic_derivation,
optim_options = optimset(optim_options,'GradObj','on');
end
[xparam1,fval,exitflag] = fminunc(objective_function,xparam1,optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
if ~exist('OCTAVE_VERSION')
[xparam1,fval,exitflag] = fminunc(objective_function,xparam1,optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_);
else
% Under Octave, use a wrapper, since fminunc() does not have a 4th arg
func = @(x) objective_function(x, dataset_,options_,M_,estim_params_,bayestopt_,oo_);
[xparam1,fval,exitflag] = fminunc(func,xparam1,optim_options);
end
case 4
H0 = 1e-4*eye(nx);
crit = 1e-7;
......
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