dnegocc: The Negative Occupancy Distribution

Description Usage Arguments Details Value References Examples

View source: R/dnegocc.R

Description

Density, distribution function, quantile function and random generation for the negative occupancy distribution with space and occupancy parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)

Arguments

x

vector of quantiles.

space

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

occupancy

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

prob

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

approx

A logical value specifying whether to use an approximation for the distribution

log

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

max.x

A vector of numeric values to be used as arguments for the mass function

max.occupancy

The maximum occupancy parameter for the negative occupancy 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 ≤ 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

dnegcount.all returns the entire PMF.

The computation method uses a recursive algorithm described in the reference.

Value

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

References

O'Neill, B. (2021) An examination of the negative-occupancy distribution and the coupon-collector distribution.

Examples

1
2
3
4
x <- rnegocc(10, 2, 2)
p <- pnegocc(x, 2, 2)
qnegocc(0:9/10, 2, 2)
dnegocc.all(5,2,2)

occupancy documentation built on June 24, 2021, 5:06 p.m.

Related to dnegocc in occupancy...