qGammaBinom: Quantile function for the Gamma-extended Binomial...

View source: R/betafunctions.R

qGammaBinomR Documentation

Quantile function for the Gamma-extended Binomial distribution.

Description

Quantile function for the Gamma-extended Binomial distribution.

Usage

qGammaBinom(p, size, prob, lower.tail = TRUE, precision = 1e-07)

Arguments

p

Vector of probabilities.

size

Number of "trials" (zero or more, including positive non-integers).

prob

Probability of success on each "trial".

lower.tail

Logical. If TRUE (default), probabilities are P[X < x], otherwise P[X > x].

precision

The precision with which the quantile is to be calculated. Default is 1e-7 (i.e., search terminates when there is no registered change in estimate at the seventh decimal). Tuning this value will impact the time it takes for the search algorithm to arrive at an estimate.

Note

This function uses a bisection search-algorithm to find the number of successes corresponding to the specified quantile(s). This algorithm is inefficient with respect to the number of iterations required to converge on the solution. More efficient algorithms might be added in later versions.

References

Loeb, D. E. (1992). A generalization of the binomial coefficients. Discrete Mathematics, 105(1-3).

Examples

# For a Gamma-extended Binomial distribution with number of trials = 10 and
# probability of success per trial of 0.75, calculate the number of success-
# ful trials at or below the 25% quantile:
qGammaBinom(p = 0.25, size = 10, prob = 0.75)

# Conversely, for a Gamma-extended Binomial distribution with number of
# trials = 10 and probability of success per trial of 0.75, calculate the
# number of successful trials at or above the 25% quantile:
qGammaBinom(p = 0.25, size = 10, prob = 0.75, lower.tail = FALSE)

betafunctions documentation built on May 29, 2024, 1:13 a.m.