Skip to content

Commit

Permalink
Fix invalid k letter in hypergeometric formula docs.
Browse files Browse the repository at this point in the history
Done according to [this comment](#192 (comment)) I.. think?
  • Loading branch information
iago-lito authored Mar 10, 2024
1 parent 80c1fd4 commit 73865d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/distribution/hypergeometric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ impl DiscreteCDF<u64, f64> for Hypergeometric {
/// # Formula
///
/// ```ignore
/// 1 - ((n choose k+1) * (N-n choose K-k-1)) / (N choose K) * 3_F_2(1,
/// k+1-K, k+1-n; k+2, N+k+2-K-n; 1)
/// 1 - ((n choose x+1) * (N-n choose K-x-1)) / (N choose K) * 3_F_2(1,
/// x+1-K, x+1-n; k+2, N+x+2-K-n; 1)
/// ```
///
/// where `N` is population, `K` is successes, `n` is draws,
Expand All @@ -150,7 +150,7 @@ impl DiscreteCDF<u64, f64> for Hypergeometric {
/// org/wiki/Generalized_hypergeometric_function)
///
/// Calculated as a discrete integral over the probability mass
/// function evaluated from 0..k+1
/// function evaluated from 0..x+1
fn cdf(&self, x: u64) -> f64 {
if x < self.min() {
0.0
Expand All @@ -174,8 +174,8 @@ impl DiscreteCDF<u64, f64> for Hypergeometric {
/// # Formula
///
/// ```ignore
/// 1 - ((n choose k+1) * (N-n choose K-k-1)) / (N choose K) * 3_F_2(1,
/// k+1-K, k+1-n; k+2, N+k+2-K-n; 1)
/// 1 - ((n choose x+1) * (N-n choose K-x-1)) / (N choose K) * 3_F_2(1,
/// x+1-K, x+1-n; x+2, N+x+2-K-n; 1)
/// ```
///
/// where `N` is population, `K` is successes, `n` is draws,
Expand All @@ -184,7 +184,7 @@ impl DiscreteCDF<u64, f64> for Hypergeometric {
/// org/wiki/Generalized_hypergeometric_function)
///
/// Calculated as a discrete integral over the probability mass
/// function evaluated from (k+1)..max
/// function evaluated from (x+1)..max
fn sf(&self, x: u64) -> f64 {
if x < self.min() {
1.0
Expand Down

0 comments on commit 73865d8

Please sign in to comment.