# Re: MLE vs. FMINSEARCH

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.

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.
.

## Relevant Pages

• Re: Computing derivative using finite differnce method
... Inorder to compute the asympotic covariance of the MLE of Weibull ... I took the data set: ... and the loglikehood function for the Weibull distribution fuction: ...
(comp.soft-sys.matlab)
• Computing derivative using finite differnce method
... Inorder to compute the asympotic covariance of the MLE of Weibull ... I took the data set: ... and the loglikehood function for the Weibull distribution fuction: ...
(comp.soft-sys.matlab)
• mle lfunction logsf NaN of Inf values
... I am using the "mle" function to estimate the parameters of some distribution and some mixtures of distributions. ... The LOGSF function returned NaN or infinite values. ...
(comp.soft-sys.matlab)
• Re: MLE
... about the distribution of error term. ... Why not in MLE? ... are you saying you need stronger assumptions for OLS to work? ... which is MLE under normality. ...
(sci.stat.math)