Learn R Programming

lmomco (version 2.4.14)

mle2par: Use Maximum Likelihood to Estimate Parameters of a Distribution

Description

This function uses the method of maximum likelihood (MLE) to estimate the parameters of a distribution. MLE is a straightforward optimization problem that is formed by maximizing the sum of the logarithms of probability densities. Let \(\Theta\) represent a vector of parameters for a candidate fit to the specified probability density function \(g(x|\Theta)\) and \(x_i\) represent the observed data for a sample of size \(n\). The objective function is $$\mathcal{L}(\Theta) = -\sum_{i=1}^{n} \log\, g(x_i|\Theta)\mbox{,}$$ where the \(\Theta\) for a maximized \({-}\mathcal{L}\) (note the 2nd negation for the adjective “maximized”, optim() defaults as a minimum optimizer) represents the parameters fit by MLE. The initial parameter estimate by default will be seeded by the method of L-moments.

Usage

mle2par(x, type, init.para=NULL, silent=TRUE, null.on.not.converge=TRUE,
                 ptransf=  function(t) return(t),
                 pretransf=function(t) return(t), ...)

Value

An R

list is returned. This list should contain at least the following items, but some distributions such as the revgum have extra.

type

The type of distribution in three character (minimum) format.

para

The parameters of the distribution.

source

Attribute specifying source of the parameters.

AIC

The Akaike information criterion (AIC).

optim

The returned list of the optim() function.

Arguments

x

A vector of data values.

type

Three character (minimum) distribution type (for example, type="gev"), see dist.list.

init.para

Initial parameters as a vector \(\Theta\) or as an lmomco parameter “object” from say vec2par. If a vector is given, then internally vec2par is called with distribution equal to type.

silent

A logical to silence the try() function wrapping the optim() function.

null.on.not.converge

A logical to trigging simple return of NULL if the optim() function returns a nonzero convergence status.

ptransf

An optional parameter transformation function (see Examples) that is useful to guide the optimization run. For example, suppose the first parameter of a three parameter distribution resides in the positive domain, then
ptransf(t) = function(t) c(log(t[1]), t[2], t[3]).

pretransf

An optional parameter retransformation function (see Examples) that is useful to guide the optimization run. For example, suppose the first parameter of a three parameter distribution resides in the positive domain, then
pretransf(t) = function(t) c(exp(t[1]), t[2], t[3]).

...

Additional arguments for the optim() function and other uses.

Author

W.H. Asquith

See Also

lmom2par, mps2par, tlmr2par