#include <hyper.h>
Public Member Functions | |
hypergeometric_distribution (int m=1, int n=1, int k=1) | |
double | cdf (int x) const |
int | inverse_cdf (double p) const |
double | pmf (int x) const |
int | number_of_failures () const |
void | number_of_failures (int n) |
int | number_of_successes () const |
void | number_of_successes (int n) |
int | sample_size () const |
void | sample_size (int n) |
References:
NUM_NAMESPACE_BEGIN hypergeometric_distribution::hypergeometric_distribution | ( | int | m = 1 , |
|
int | n = 1 , |
|||
int | k = 1 | |||
) |
Create a distribution with the given population number of successes, population number of failures, and sample size.
m | the population number of successes. | |
n | the population number of failures. | |
k | the sample size. |
double hypergeometric_distribution::cdf | ( | int | x | ) | const [virtual] |
The CDF for this distribution. This method returns P(X x).
x | the value at which the CDF is evaluated. |
Implements discrete_distribution.
int hypergeometric_distribution::inverse_cdf | ( | double | p | ) | const [virtual] |
The inverse CDF for this distribution. This method returns the largest x such that, P(X x) p.
p | the cumulative probability. |
p | the cumulative probability. |
Implements discrete_distribution.
double hypergeometric_distribution::pmf | ( | int | x | ) | const [virtual] |
The PMF for this distribution. This method returns P(X = x).
x | the value at which the PMF is evaluated. |
Implements discrete_distribution.
int hypergeometric_distribution::number_of_failures | ( | ) | const |
Access the number of failures.
void hypergeometric_distribution::number_of_failures | ( | int | n | ) |
Modify the number of failures.
n | the new number of failures. |
int hypergeometric_distribution::number_of_successes | ( | ) | const |
Access the number of successes.
void hypergeometric_distribution::number_of_successes | ( | int | n | ) |
Modify the number of successes.
n | the new number of successes. |
int hypergeometric_distribution::sample_size | ( | ) | const |
Access the sample size.
void hypergeometric_distribution::sample_size | ( | int | n | ) |
Modify the sample size.
n | the new sample size. |