Last chance! 50% off unlimited learning
Sale ends in
cgumbel(llocation = "identity", lscale = "loge", elocation = list(),
escale = list(), iscale=NULL, mean=TRUE, percentiles=NULL, zero=2)
Links
for more choices.earg
in Links
for general information.TRUE
then the mean is returned,
otherwise percentiles given by the percentiles
argument.mean=FALSE
then the fitted values are percentiles which must
be specified by this argument.zero=NULL
then all l"vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.gumbel
but handles observations
that are 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 the logical
values are taken to be FALSE
. The fitted object has these two
components stored in the extra
slot.gumbel
,
egumbel
,
rgumbel
,
guplot
,
gev
,
venice
.# Example 1
ystar = venice[["r1"]] # Use the first order statistic as the response
n = length(ystar)
L = runif(n, 100, 104) # Lower censoring points
U = runif(n, 130, 135) # Upper censoring points
y = pmax(L, ystar) # Left censored
y = pmin(U, y) # Right censored
extra = list(leftcensored = ystar < L, rightcensored = ystar > U)
fit = vglm(y ~ scale(year), data=venice, trace=TRUE, extra=extra,
cgumbel(mean=FALSE, perc=c(5,25,50,75,95)))
coef(fit, matrix=TRUE)
head(fitted(fit))
fit@extra
# Example 2: simulated data
n = 1000
ystar = rgumbel(n, loc=1, scale=exp(0.5)) # The uncensored data
L = runif(n, -1, 1) # Lower censoring points
U = runif(n, 2, 5) # Upper censoring points
y = pmax(L, ystar) # Left censored
y = pmin(U, y) # Right censored
par(mfrow=c(1,2)); hist(ystar); hist(y);
extra = list(leftcensored = ystar < L, rightcensored = ystar > U)
fit = vglm(y ~ 1, trace=TRUE, extra=extra, cgumbel)
coef(fit, matrix=TRUE)
Run the code above in your browser using DataLab