Learn R Programming

evd (version 1.0-0)

extmle: Maximum-likelihood Fitting of Maxima/Minima

Description

Maximum-likelihood estimates for the distribution of the maximum/minimum of a random sample from any specified distribution function.

Usage

fext(x, start, densfun, distnfun, ..., distn, mlen = 1, largest = TRUE)

Arguments

x
a numeric vector.
start
a named list giving the parameters to be optimized with initial values.
densfun, distnfun
density and distribution function of the specified distribution.
...
additional parameters, either for the specified distribution or for optim. If parameters of the distribution are included they will be held fixed. If parameters of the distribution are not included either here or as a named compon
distn
a character string, optionally specified as an alternative to densfun and distnfun such that the density and distribution and functions are formed upon the addition of the prefixes d and p re
mlen
the size of the random sample.
largest
logical; if TRUE (default) use maxima, otherwise minima.

Value

  • A list with with components
  • estimatea vector containing the maximum likelihood estimates.
  • std.erra vector containing the standard errors.
  • deviancethe deviance at the maximum likelihood estimates.
  • countsa two-element integer vector giving the number of calls to the log-likelihood function and the number gradient approximations respectively.

Details

Maximization of the log-likelihood is performed. The estimated standard errors are taken from the observed information, calculated by a numerical approximation.

If the density and distribution functions are user defined, the order of the arguments must mimic those in R base (i.e. data first, parameters second). Density functions must have log arguments.

See Also

forder, optim

Examples

Run this code
data <- rext(100, qnorm, mean = 0.56, mlen = 365)
fext(data, list(mean = 0, sd = 1), distn = "norm", mlen = 365)
fext(data, list(rate = 1), distn = "exp", mlen = 365)
fext(data, list(scale = 1), shape = 1, distn = "gamma", mlen = 365)
fext(data, list(shape = 1, scale = 1), distn = "gamma", mlen = 365)

Run the code above in your browser using DataLab