negative_binomial_distribution Class Reference

#include <negativebinomial.h>

Inheritance diagram for negative_binomial_distribution:

discrete_distribution

List of all members.

Public Member Functions

 negative_binomial_distribution (int r=1, double p=0.5)
double cdf (int x) const
int inverse_cdf (double p) const
double pmf (int x) const
int number_of_successes () const
void number_of_successes (int n)
double probability_of_success () const
void probability_of_success (double p)


Detailed Description

The Negative Binomial distribution.

References:

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

Constructor & Destructor Documentation

NUM_NAMESPACE_BEGIN negative_binomial_distribution::negative_binomial_distribution ( int  n = 1,
double  p = 0.5 
)

Create a distribution with the given number of successes and probability of success.

Parameters:
r the number of successes.
p the probability of success.
Create a distribution with the given number of successes and probability of success.
Parameters:
n the number of successes.
p the probability of success.


Member Function Documentation

double negative_binomial_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 negative_binomial_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 negative_binomial_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 negative_binomial_distribution::number_of_successes (  )  const

Access the number of successes.

Returns:
the number of successes.

void negative_binomial_distribution::number_of_successes ( int  n  ) 

Modify the number of successes.

Parameters:
n the new number of successes.
Modify the number of successes.
Parameters:
df the new number of successes.

double negative_binomial_distribution::probability_of_success (  )  const

Access the probability of success.

Returns:
the probability of success.

void negative_binomial_distribution::probability_of_success ( double  p  ) 

Modify the probability of success.

Parameters:
p the new probability of success.
Modify the probability of success.
Parameters:
df the new probability of success.


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