Matlab: Get the Hessian matrix using Multistart
2 次查看(过去 30 天)
显示 更早的评论
I am using Multistart in Matlab with the `fmincon` command to estimate some parameters to my maximum likelihood function. The issue that I have with Multistart is that I can't get the Hessian matrix. It is easy to get the Hessian with `fmincon` but how to retrieve it using Multistart, I am absolutely clueless despite some explanation by MatWork here . They say:
"If you use GlobalSearch or MultiStart, your objective function can return derivatives (gradient, Jacobian, or Hessian). For details on how to include this syntax in your objective function, see Writing Objective Functions in the Optimization Toolbox documentation"
I tried to understand their documentation but still clueless.
Here's my current Multistart code:
options = optimset(options,'Algorithm','sqp','MaxFunEvals',10000,'MaxIter',10000);
problem = createOptimProblem('fmincon','objective', @(x)myfunc(x),'x0',initialparameter,'lb',[min],'ub',[max],'options',options);
ms = MultiStart('UseParallel','always','Display','iter','TolX',1e-8);
[x fval] = run(ms,problem,20);
Where in my code should I specify that I want to retrieve the Hessian? I tried `'Hessian','on'` in `optimset` but that didn't give me the Hessian matrix...
0 个评论
采纳的回答
Alan Weiss
2014-8-27
MultiStart does not return the Hessian. But, if you really want the Hessian for computing confidence intervals, you shouldn't use the fmincon Hessian anyway, because, as documented, it is inaccurate.
I do not know what the confidence interval calculation is when there are active constraints in a maximum likelihood calculation. If, at the end of the calculation, there are no active constraints, then you can call fminunc on the function at the final point. As documented, fminunc Hessians are accurate.
Alan Weiss
MATLAB mathematical toolbox documentation
0 个评论
更多回答(2 个)
Matt J
2014-8-27
编辑:Matt J
2014-8-27
You cannot use the Hessian with the sqp algorithm option, only with interior point and trust-region-reflective. The Hessian computation is specified in different ways depending on the fmincon algorithm uses. You must choose a value for the Hessian option following the guidelines here,
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Global or Multiple Starting Point Search 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!