Learn R Programming

VGAM (version 0.7-1)

cexpon: Censored Exponential Distribution

Description

Maximum likelihood estimation for the exponential distribution with left and right censoring.

Usage

cexpon(link = "loge", location = 0)

Arguments

link
Character. Parameter link function applied to the positive parameter $rate$. See Links for more choices.
location
Numeric of length 1, the known location parameter, $A$, say.

Value

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

Details

The family function assumes the response $Y$ has density $$f(y) = \lambda \exp(-\lambda (y-A))$$ for $y > A$, where $A$ is the known location parameter. By default, $A=0$. Then $E(Y) = A + 1/ \lambda$ (returned as the fitted values) and $Var(Y) = 1/ \lambda^2$.

The data may be left-censored so that the true value would be less than the observed value; else right-censored so that the true value would be greater than the observed value. To indicate which type of censoring, input extra = list(leftcensored = vec1, rightcensored = vec2) where vec1 and vec2 are logical vectors the same length as the response. If the two components of this list are missing then all the logical values are taken to be FALSE. The fitted object has these two components stored in the extra slot.

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

exponential.

Examples

Run this code
n = 100
lambda = exp(-0.1)
ystar  = rexp(n, rate=lambda)
L = 2 # Lower censoring point
U = 3 # Upper censoring point
y = pmax(L, ystar) # left  censoring
y = pmin(U, y)     # right censoring
hist(y)
extra = list(leftcensored = ystar < L, rightcensored = ystar > U)
fit = vglm(y ~ 1, cexpon, trace=TRUE, extra=extra)
coef(fit, matrix=TRUE)
Coef(fit)
fit@extra

Run the code above in your browser using DataLab