Skip to content
Snippets Groups Projects
Commit 5c883389 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Fix mode_compute=3 under Octave

parent 8c7e3d46
No related branches found
No related tags found
No related merge requests found
...@@ -221,7 +221,14 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation ...@@ -221,7 +221,14 @@ if ~isequal(options_.mode_compute,0) && ~options_.mh_posterior_mode_estimation
if options_.analytic_derivation, if options_.analytic_derivation,
optim_options = optimset(optim_options,'GradObj','on'); optim_options = optimset(optim_options,'GradObj','on');
end end
if ~exist('OCTAVE_VERSION')
[xparam1,fval,exitflag] = fminunc(objective_function,xparam1,optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_); [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 case 4
H0 = 1e-4*eye(nx); H0 = 1e-4*eye(nx);
crit = 1e-7; crit = 1e-7;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment