mle: Maximum Likelihood Estimation of Univariate Probability...

View source: R/mle.R

mleR Documentation

Maximum Likelihood Estimation of Univariate Probability Distributions

Description

For a given dataset, this function serves to find maximum likelihood parameter estimates for some specified parametric probability distribution.

Usage

mle(x, dist, start = NULL, method = "Nelder-Mead")

Arguments

x

A univariate dataset (a vector).

dist

Distribution to be fitted to x.

start

Starting parameter values for the optimization algorithm (see optim).

method

The optimization method to be used (see optim).

Value

fit

optim output (see optim).

x.info

Array that contains the following columns:
i: (1:length(x)),
x: (original dataset),
z: (sorted dataset),
Fx: (CDF of x evaluated at the estimated parameter values),
Fz: (sorted values of Fx),
Emp: (i/(length(x)+1)),
zF: (distr(Emp,'dist',par.hat,'q') evaluated at estimated parameter values (par.hat)),
fx: (PDF of x evaluated at the estimated parameter values),
fz: (PDF of z evaluated at the estimated parameter values)

dist

Distribution fitted to x.

par.hat

Vector of estiamted parameters.

cov.hat

Observed Fisher's information matrix.

k

Number of parameters

n

Number of observations (i.e., length(x)).

log.like

Log-likelihood value evaluated at the estimated parameter (i.e. par.hat).

aic

Akaike information criterion computed as 2*k - 2*log.like.

ad

Anderson Darling statistic evaluated at the estimated parameter values.

data.name

Name for x.

rho

Pearson's correlation coefficient computed as cor(x.info[,'z'],x.info[,'zF']).

See Also

optim, distr, boot.mle, metropolis, Q.conf.int

Examples

data(yarns)
x <- yarns$x
fit.x <- mle(x,'weibull',c(.1,.1))
fit.x
names(fit.x)
#plot(fit.x)
#plot(fit.x,TRUE,alpha=.01)
p <- c(.9,.95,.99)
distr(p,model=fit.x,type='q')
Q.conf.int(p,fit.x,.01)
Q.conf.int(p,fit.x,.01,TRUE)

FAmle documentation built on March 18, 2022, 5:29 p.m.