Density, distribution function, quantile function and random generation for the negative occupancy distribution with space and occupancy parameters.
dnegocc(x, space, occupancy, prob = 1, approx = FALSE, log = FALSE)dnegocc.all(max.x, space, max.occupancy, prob = 1, approx = FALSE, log = FALSE)
pnegocc(
x,
space,
occupancy,
prob = 1,
approx = FALSE,
log.p = FALSE,
lower.tail = TRUE
)
qnegocc(
p,
space,
occupancy,
prob = 1,
approx = FALSE,
log.p = FALSE,
lower.tail = TRUE
)
rnegocc(n, space, occupancy, prob = 1)
vector of quantiles.
The space parameter for the negative occupancy distribution (number of bins)
The occupancy parameter for the negative occupancy distribution (number of occupied bins)
The probability parameter for the negative occupancy distribution (probability of ball occupying its bin)
A logical value specifying whether to use an approximation for the distribution
logical; if TRUE, probabilities p are given as log(p).
A vector of numeric values to be used as arguments for the mass function
The maximum occupancy parameter for the negative occupancy distribution (number of occupied bins)
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\).
vector of probabilities.
number of observations. If length(n) > 1, the length is taken to be the number required.
If all inputs are correctly specified (i.e., parameters are in allowable range and arguments are integers) then the output will be a matrix of probabilities/log-probabilities
dnegcount.all returns the entire PMF.
The computation method uses a recursive algorithm described in the reference.
O'Neill, B. (2021) An examination of the negative-occupancy distribution and the coupon-collector distribution.
# NOT RUN {
x <- rnegocc(10, 2, 2)
p <- pnegocc(x, 2, 2)
qnegocc(0:9/10, 2, 2)
dnegocc.all(5,2,2)
# }
Run the code above in your browser using DataLab