Learn R Programming

VGAM (version 0.7-1)

recexp1: Upper Record Values from a 1-parameter Exponential Distribution

Description

Maximum likelihood estimation of the rate parameter of a 1-parameter exponential distribution when the observations are upper record values.

Usage

recexp1(lrate="loge", irate=NULL, method.init=1)

Arguments

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Details

The response must be a vector or one-column matrix with strictly increasing values.

References

Arnold, B. C. and Balakrishnan, N. and Nagaraja, H. N. (1998) Records, New York: John Wiley & Sons.

See Also

exponential.

Examples

Run this code
rawy = rexp(n <- 10000, rate=exp(1))

# Keep only the records
delete = c(FALSE, rep(TRUE, len=n-1))
for(i in 2:length(rawy))
    if(rawy[i] > max(rawy[1:(i-1)])) delete[i] = FALSE
(y = rawy[!delete])

length(y) / y[length(y)]   # MLE of rate

fit = vglm(y ~ 1, recexp1, trace=TRUE)
coef(fit, matrix=TRUE)
Coef(fit)

Run the code above in your browser using DataLab