discrete_distribution Class Reference

#include <discrete.h>

Inheritance diagram for discrete_distribution:

binomial_distribution geometric_distribution hypergeometric_distribution negative_binomial_distribution poisson_distribution

List of all members.

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


Detailed Description

Base discrete distribution.

Member Function Documentation

virtual double discrete_distribution::cdf ( int  x  )  const [pure virtual]

The CDF for this distribution. This method returns P(X x).

Parameters:
x the value at which the CDF is evaluated.
Returns:
CDF for this distribution.

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.

Parameters:
p the cumulative probability.
Returns:
x

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).

Parameters:
x the value at which the PMF is evaluated.
Returns:
PMF for this distribution.

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.

Parameters:
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.
Returns:
x such that P(X < x) = p
Generic means to compute inverse cumulative probability values. This method uses a simple search method to find inverse CDF values.
Parameters:
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.
Returns:
x such that P(X x) = p

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.

Parameters:
x0 the lower bound of summation.
x1 the upper bound of summation.
Returns:
P(x0 X x1)


The documentation for this class was generated from the following files:
Generated on Wed Nov 21 22:22:15 2007 for numerics4c++ by  doxygen 1.5.3