Description Usage Arguments Details Value Note References Examples
View source: R/binomialtable.R
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.
1 | binomialtable(n, p, output = "density")
|
n |
number of observations. |
p |
probability of "success" |
output |
The output can be 'density', 'distribution' or 'both'. Default output is 'density' |
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.
a matrix containing the required values of the hypergeometric probabilities indexed by the columns x=0,1,..,n.
n can be very large in our algorthim.
Alvo, M., & Cabilio, P. (2000). Calculation of hypergeometric probabilities using Chebyshev polynomials. The American Statistician, 54(2), 141-144.
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.