Learn R Programming

evd (version 1.2-2)

fext: Maximum-likelihood Fitting of Maxima and Minima

Description

Maximum-likelihood fitting 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, std.err = TRUE, corr = FALSE, method = "Nelder-Mead")

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 functions are formed upon the addition of the prefixes d and p respec
mlen
The size of the random sample.
largest
Logical; if TRUE (default) use maxima, otherwise minima.
std.err
Logical; if TRUE (the default), the standard errors are returned.
corr
Logical; if TRUE, the ``correlation matrix'' is returned.
method
The optimization method (see optim for details).

Value

  • Returns an object of class "evd".

    The generic accessor functions fitted (or fitted.values), std.errors and deviance extract various features of the returned object. The function anova compares nested models. An object of class "evd" is a list containing at least the following components

  • estimateA vector containing the maximum likelihood estimates.
  • std.errA vector containing the ``standard errors''.
  • devianceThe deviance at the maximum likelihood estimates.
  • corrThe ``correlation matrix''.
  • convergence,counts,messageComponents taken from the list returned by optim.
  • callThe call of the current function.
  • dataThe data passed to the argument x.
  • nThe length of x.
  • modelA character string describing the fitted model.

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

anova.evd, forder, optim

Examples

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

Run the code above in your browser using DataLab