Learn R Programming

occupancy (version 1.2)

doccgap: The Occupancy-Gap Distribution

Description

Density, distribution function, quantile function and random generation for the Occupancy-Gap Distribution with size and scale parameters (see note).

Usage

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)

Arguments

x

vector of quantiles.

size

The size parameter for the occupancy-gap distribution (number of balls)

space

The space parameter for the occupancy-gap distribution (number of bins)

occupancy

The occupancy parameter for the occupancy-gap distribution (number of occupied bins)

prob

The probability parameter for the occupancy-gap distribution (probability of ball occupying its bin)

scale

The scale parameter for the occupancy-gap distribution

log

logical; if TRUE, probabilities p are given as log(p).

max.occupancy

The maximum occupancy parameter for the occupancy-gap distribution (number of occupied bins)

log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\) otherwise, \(P[X > x]\).

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Value

If all inputs are correctly specified (i.e., parameters are in allowable range) then the output will be a matrix of probabilities/log-probabilities

Details

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:

References

O'Neill, B. (forthcoming) An examination of the occupancy-gap distribution.

Examples

Run this code
# 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