doccgap {occupancy}R Documentation

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.

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:

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

References

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

Note

The distribution is parameterised by a scale parameter, but in applied problems in the context of the extended occupancy problem this parameter is a function of space and prob parameters. The function allows either parameterisation (i.e., the user can either specify the scale paramater or both the space and prob parameters).

Examples

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)

[Package occupancy version 1.2 Index]