truncweibull(lower.limit = 1e-5,
lAlpha = "loge", lBetaa = "loge",
iAlpha = NULL, iBetaa = NULL,
nrfs = 1, probs.y = c(0.2, 0.5, 0.8),
imethod = 1, zero = -2)
weibull
Alpha
(called $\alpha$ below) and
(positive) Betaa
(called $\beta$ below).
See Links
for more choices.weibull
."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
,
and vgam
.weibull
at any time.
Yet to do: one element of the EIM may be wrong (due to
two interpretations of a formula; but it seems to work).
Convergence is slower than usual and this may imply something
is wrong; use argument maxit
.
In fact, it's probably because pgamma.deriv.unscaled
is
inaccurate at q = 1
and q = 2
.
Also,
convergence should be monitored, especially if the truncation
means that a large proportion of the data is lost compared to an
ordinary Weibull distribution.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 weibull
.)
In particular,
$\beta = a$ and $\alpha = (1/b)^a$
where $a$ and $b$ are as in weibull
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
.weibull
,
dweibull
,
pgamma.deriv
,
pgamma.deriv.unscaled
.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 is 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 = Shape, scale = Scale))
summary(wdata)
lower.limit2 <- with(wdata, quantile(y2, prob = prop.lost)) # Proportion lost
wdata <- subset(wdata, y2 > lower.limit2) # Smaller due to truncation
fit1 <- vglm(y2 ~ x2, maxit = 100, trace = TRUE,
truncweibull(lower.limit = lower.limit2), data = wdata)
coef(fit1, matrix = TRUE)
summary(fit1)
vcov(fit1)
head(fit1@extra$lower.limit)
Run the code above in your browser using DataLab