binomialtable {hypersampleplan}R Documentation

Calculation exact Binomial Probabilities Table using Chebyshev Polynomials

Description

This is an algorithm for efficient and exact calculation of Binomial probabilities using Chebyshev polynomials. For a fixed population size n and probability of "success" p, such calculations simultaneously produce distributions for all possible values of the number of "successes" x. The algorthim calculate the exact probability even for large n, while other algorthims simply use normal approximation.

Usage

binomialtable(n, p, output = "density")

Arguments

n

number of observations.

p

probability of "success"

output

The output can be 'density', 'distribution' or 'both'. Default output is 'density'

Details

The detailed algorthim can be found: Alvo, M., & Cabilio, P. (2000). Calculation of hypergeometric probabilities using Chebyshev polynomials. The American Statistician, 54(2), 141-144.

Value

a matrix containing the required values of the hypergeometric probabilities indexed by the columns x=0,1,..,n.

Note

n can be very large in our algorthim.

References

Alvo, M., & Cabilio, P. (2000). Calculation of hypergeometric probabilities using Chebyshev polynomials. The American Statistician, 54(2), 141-144.

Examples

# Calculate the binomialtable probabilities for n=10, p=0.4.
binomialtable(10,0.4)
# Calculate the binomialtable distribution for n=10, p=0.4.
binomialtable(10,0.4,output='distribution')

[Package hypersampleplan version 0.1.1 Index]