hypergeometric_distribution Class Reference

#include <hyper.h>

Inheritance diagram for hypergeometric_distribution:

discrete_distribution

List of all members.

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)


Detailed Description

The Hypergeometric distribution.

References:

  1. Eric W. Weisstein. "Hypergeometric Distribution." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/HypergeometricDistribution.html

Constructor & Destructor Documentation

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.

Parameters:
m the population number of successes.
n the population number of failures.
k the sample size.


Member Function Documentation

double hypergeometric_distribution::cdf ( int  x  )  const [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.

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.

Parameters:
p the cumulative probability.
Returns:
x
The inverse CDF for this distribution. This method returns x such that, P(X < x) = p.
Parameters:
p the cumulative probability.
Returns:
x

Implements discrete_distribution.

double hypergeometric_distribution::pmf ( int  x  )  const [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.

Implements discrete_distribution.

int hypergeometric_distribution::number_of_failures (  )  const

Access the number of failures.

Returns:
the number of failures.

void hypergeometric_distribution::number_of_failures ( int  n  ) 

Modify the number of failures.

Parameters:
n the new number of failures.

int hypergeometric_distribution::number_of_successes (  )  const

Access the number of successes.

Returns:
the number of successes.

void hypergeometric_distribution::number_of_successes ( int  n  ) 

Modify the number of successes.

Parameters:
n the new number of successes.

int hypergeometric_distribution::sample_size (  )  const

Access the sample size.

Returns:
the sample size.

void hypergeometric_distribution::sample_size ( int  n  ) 

Modify the sample size.

Parameters:
n the new sample size.


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