Density, distribution function, quantile function and random generation for the Occupancy-Gap Distribution with size and scale parameters (see note).
doccgap(
x,
size,
space = NULL,
occupancy = size,
prob = NULL,
scale = NULL,
log = FALSE
)doccgap.all(
size,
space = NULL,
max.occupancy = size,
prob = NULL,
scale = NULL,
log = FALSE
)
poccgap(
x,
size,
space = NULL,
occupancy = size,
prob = NULL,
scale = NULL,
log.p = FALSE,
lower.tail = TRUE
)
qoccgap(
p,
size,
space = NULL,
occupancy = size,
prob = NULL,
scale = NULL,
log.p = FALSE,
lower.tail = TRUE
)
roccgap(n, size, space = NULL, occupancy = size, prob = NULL, scale = NULL)
vector of quantiles.
The size parameter for the occupancy-gap distribution (number of balls)
The space parameter for the occupancy-gap distribution (number of bins)
The occupancy parameter for the occupancy-gap distribution (number of occupied bins)
The probability parameter for the occupancy-gap distribution (probability of ball occupying its bin)
The scale parameter for the occupancy-gap distribution
logical; if TRUE, probabilities p are given as log(p).
The maximum occupancy parameter for the occupancy-gap 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) then the output will be a matrix of probabilities/log-probabilities
docc.all returns the entire PMF.
This function computes probabilities or log-probabilities from the mass function of the occupancy-gap distribution. The computation method uses a recursive algorithm from the following paper:
O'Neill, B. (forthcoming) An examination of the occupancy-gap distribution.
# NOT RUN {
x <- roccgap(10, 20, 2, 2, .5)
p <- poccgap(x, 20, 2, 2, .5)
stopifnot(x == qoccgap(p, 20, 2, 2, .5))
doccgap.all(20, 2, 2, .5)
# }
Run the code above in your browser using DataLab