Learn R Programming

evd (version 1.1-0)

ordermle: Maximum-likelihood Fitting of Order Statistics

Description

Maximum-likelihood estimates for the distribution of a given order statistic of a sample from any specified distribution function.

Usage

forder(x, start, densfun, distnfun, ..., distn, mlen = 1, j = 1, 
largest = TRUE, std.err = TRUE, 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 and functions are formed upon the addition of the prefixes d and p re
mlen
The size of the random sample.
j
The order statistic, taken as the jth largest (default) or smallest of mlen, according to the value of largest.
largest
Logical; if TRUE (default) use the jth largest order statistic, otherwise use the jth smallest.
std.err
Logical; if TRUE (the default), the standard errors are returned.
method
The optimization method (see optim for details).

Value

  • A list with with components
  • estimatea vector containing the maximum likelihood estimates.
  • std.erra vector containing the standard errors (if $\code{std.err} = \code{TRUE}$).
  • 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.

Although j can be any integer in $[1,\code{mlen}]$ it is preferable, for computational reasons, to specify j in the interval $[1,\code{ceiling}(\code{mlen}/2)]$, which can always be achieved using the argument largest.

See Also

fext, optim

Examples

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

Run the code above in your browser using DataLab