Learn R Programming

VGAM (version 1.1-14)

truncweibull: Truncated Weibull Distribution Family Function

Description

Maximum likelihood estimation of the 2-parameter Weibull distribution with lower truncation. No observations should be censored.

Usage

truncweibull(lower.limit = 1e-5,
             lAlpha = "loglink", lBetaa = "loglink",
             iAlpha = NULL,   iBetaa = NULL,
             nrfs = 1, probs.y = c(0.2, 0.5, 0.8),
             imethod = 1, zero = "Betaa")

Arguments

Value

An object of class "vglmff"

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

Details

MLE of the two parameters of the Weibull distribution are computed, subject to lower truncation. That is, all response values are greater than lower.limit, element-wise. For a particular observation this is any known positive value. This function is currently based directly on Wingo (1989) and his parameterization is used (it differs from weibullR.) In particular, \(\beta = a\) and \(\alpha = (1/b)^a\) where \(a\) and \(b\) are as in weibullR and dweibull.

Upon fitting the extra slot has a component called lower.limit which is of the same dimension as the response. The fitted values are the mean, which are computed using pgamma.deriv and pgamma.deriv.unscaled.

References

Wingo, D. R. (1989). The left-truncated Weibull distribution: theory and computation. Statistical Papers, 30(1), 39--48.

See Also

weibullR, dweibull, pgamma.deriv, pgamma.deriv.unscaled.

Examples

Run this code
if (FALSE) {
nn <- 5000; prop.lost <- 0.40   # Proportion lost to truncation
wdata <- data.frame(x2 = runif(nn))  # Complete Weibull data
wdata <- transform(wdata,
         Betaa = exp(1))  # > 2 okay (satisfies regularity conds)
wdata <- transform(wdata, Alpha = exp(0.5 - 1 * x2))
wdata <- transform(wdata, Shape = Betaa,
#                         aaa   = Betaa,
#                         bbb   = 1 / Alpha^(1 / Betaa),
                          Scale = 1 / Alpha^(1 / Betaa))
wdata <- transform(wdata, y2 = rweibull(nn, Shape, scale = Scale))
summary(wdata)

# Proportion lost:
lower.limit2 <- with(wdata, quantile(y2, prob = prop.lost))
# Smaller due to truncation:
wdata <- subset(wdata, y2 > lower.limit2)

fit1 <- vglm(y2 ~ x2, maxit = 100, trace = TRUE,
             truncweibull(lower.limit = lower.limit2), wdata)
coef(fit1, matrix = TRUE)
summary(fit1)
vcov(fit1)
head(fit1@extra$lower.limit)
}

Run the code above in your browser using DataLab