binomialtable: Calculation exact Binomial Probabilities Table using...

Description Usage Arguments Details Value Note References Examples

View source: R/binomialtable.R

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

1
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

1
2
3
4
# 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')

hypersampleplan documentation built on May 2, 2019, 9:12 a.m.