#include <discrete.h>
Public Member Functions | |
virtual double | cdf (int x) const =0 |
virtual int | inverse_cdf (double p) const =0 |
virtual double | pmf (int x) const =0 |
Protected Member Functions | |
int | find_inverse_cdf (double p, int lower, int initial, int upper) const |
double | simple_cdf (int x0, int x1) const |
virtual double discrete_distribution::cdf | ( | int | x | ) | const [pure virtual] |
The CDF for this distribution. This method returns P(X x).
x | the value at which the CDF is evaluated. |
Implemented in binomial_distribution, geometric_distribution, hypergeometric_distribution, negative_binomial_distribution, and poisson_distribution.
virtual int discrete_distribution::inverse_cdf | ( | double | p | ) | const [pure virtual] |
The inverse CDF for this distribution. This method returns the largest x such that, P(X x) p.
p | the cumulative probability. |
Implemented in binomial_distribution, geometric_distribution, hypergeometric_distribution, negative_binomial_distribution, and poisson_distribution.
virtual double discrete_distribution::pmf | ( | int | x | ) | const [pure virtual] |
The PMF for this distribution. This method returns P(X = x).
x | the value at which the PMF is evaluated. |
Implemented in binomial_distribution, geometric_distribution, hypergeometric_distribution, negative_binomial_distribution, and poisson_distribution.
NUM_NAMESPACE_BEGIN int discrete_distribution::find_inverse_cdf | ( | double | p, | |
int | lower, | |||
int | initial, | |||
int | upper | |||
) | const [protected] |
Generic means to compute inverse cumulative probability values. This method uses the bisection method to find inverse CDF values.
p | the cumulative probability. | |
lower | the global lower bound of the inverse CDF value. | |
initial | an initial guess at the inverse CDF value. | |
upper | the global upper bound of the inverse CDF value. |
p | the cumulative probability. | |
lower | the global lower bound of the inverse CDF value. | |
initial | an initial guess at the inverse CDF value. | |
upper | the global upper bound of the inverse CDF value. |
double discrete_distribution::simple_cdf | ( | int | x0, | |
int | x1 | |||
) | const [protected] |
Generic means to compute cumulative probability values. This method uses simple summation of the probability values to find CDF values.
x0 | the lower bound of summation. | |
x1 | the upper bound of summation. |