FUNCTION REFERENCE

mle

Maximum likelihood estimates for a named or custom distribution.

Maximum likelihood estimates for a named or custom distribution.

Syntax

phat = mle(data)

Syntax

[phat, pci] = mle(data, 'Distribution', name, Name, Value)

Syntax

[phat, pci] = mle(data, 'pdf', pdf, 'Start', start, Name, Value)

Syntax

[phat, pci] = mle(data, 'logpdf', logpdf, 'Start', start, Name, Value)

Syntax

[phat, pci] = mle(data, 'nloglf', nloglf, 'Start', start, Name, Value)

With no distribution the data are fitted as Normal. Names are the fitdist families except Kernel. Unlike fitdist and normfit, the Normal and Lognormal sigma is the maximum likelihood (biased) estimate; pci holds the paramci intervals (row 1 lower, row 2 upper). phat lists the free parameters only (Binomial p with 'NTrials', GeneralizedPareto k and sigma with 'Theta'). Options: 'Censoring' (1 = right-censored), 'Frequency', 'Alpha', 'NTrials', 'Theta', 'Options' (statset: MaxIter, MaxFunEvals, TolX, TolFun). Custom distributions: pdf(x, p1, p2, ...) or logpdf(x, p1, ...) returns one value per observation, with 'cdf' or 'logsf' for censored data; nloglf(params, data, cens, freq) returns the negative log-likelihood. They are minimised by Nelder-Mead from 'Start' within 'LowerBound'/'UpperBound', then refined by Newton steps; pci are Wald intervals from the numerical Hessian.

Example

phat = mle([4.1 5.3 2.2 6.0 4.8 5.1])

Example

[phat, pci] = mle([1.2 0.4 2.2 0.9 3.1], 'Distribution', 'Exponential')

Example

phat = mle([4.1 5.3 2.2 6.0 4.8 5.1], 'pdf', @(x,m,s) normpdf(x,m,s), 'Start', [4 1])

Differences from MATLAB: left censoring (-1), 'OptimFun','fmincon', truncation, 'TruncationBounds' and gradient options are not supported; nloglf is always called with four inputs.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.