
Last chance! 50% off unlimited learning
Sale ends in
Calculations to handle censoring
dinterval(x, t, c, log = FALSE)rinterval(n = 1, t, c)
dinterval
gives the density and rinterval
generates random deviates,
but these are unusual as the density is 1 if x
indicates the interval in which t
falls and 0 otherwise and the deviates are simply the interval(s) in which t
falls.
vector of interval indices.
vector of values.
vector of one or more values delineating the intervals.
logical; if TRUE, probability density is returned on the log scale.
number of observations.
Christopher Paciorek
Used for working with censoring in BUGS code.
Taking c
to define the endpoints of two or more intervals (with implicit endpoints of plus/minus infinity), x
(or the return value of rinterval
) gives the non-negative integer valued index of the interval in which t
falls. See the NIMBLE manual for additional details.
Distributions for other standard distributions
endpoints <- c(-3, 0, 3)
vals <- c(-4, -1, 1, 5)
x <- rinterval(4, vals, endpoints)
dinterval(x, vals, endpoints)
dinterval(c(1, 5, 2, 3), vals, endpoints)
Run the code above in your browser using DataLab