Re: MLE vs. FMINSEARCH
- From: Peter Perkins <Peter.PerkinsRemoveThis@xxxxxxxxxxxxx>
- Date: Wed, 28 May 2008 09:51:13 -0400
John D'Errico wrote:
Lets see. The mle code is in the stats
toolbox. It is a trust region optimizer,
that needs the gradient of its objective
function, which it computes for you.
John's right about that, mostly.
MLE allows you to specify one of about two dozen "canned" univariate distributions to fit, and it calls things like GAMFIT or NORMFIT to do the work. Those functions are written specifically for a particular distribution, and so they take advantage of whatever they can in terms of starting values and so on. Sometimes those functions compute the MLEs explicitly (like NORMFIT, when there's no censoring), sometimes they use FMINSEARCH, sometimes they use a trust region optimizer. Sometimes they find a zero of the log-likelihood gradient. Depends on the distribution, we've tried to use the method that works best in terms of actually finding the estimates. They all do maximum likelihood (except for trivialities like NORMFIT using the unbiased estimator for sigma^2, not the MLE).
On the other hand, MLE also allows you to provide a function or functions (in the firm of function handles) that define the log-likelihood of a distribution that you define. In that case, MLE uses FMINSEARCH, but you can also tell it to use FMINCON if you have the Optimization Toolbox. FMINCON is usually more efficient, but FMINSEARCH can be more robust in some odd cases. You also have to provide a starting value.
Hope this helps.
- Peter Perkins
The MathWorks, Inc.