geometric_distribution Class Reference

#include <geometric.h>

Inheritance diagram for geometric_distribution:

discrete_distribution

List of all members.

Public Member Functions

 geometric_distribution (double p=0.5)
double cdf (int x) const
int inverse_cdf (double p) const
double pmf (int x) const
double probability_of_success () const
void probability_of_success (double p)


Detailed Description

The Geometric distribution.

References:

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

Constructor & Destructor Documentation

NUM_NAMESPACE_BEGIN geometric_distribution::geometric_distribution ( double  p = 0.5  ) 

Create a distribution with the given probability of success.

Parameters:
p the probability of success.


Member Function Documentation

double geometric_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 geometric_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 geometric_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.

double geometric_distribution::probability_of_success (  )  const

Access the probability of success.

Returns:
the probability of success.

void geometric_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:15 2007 for numerics4c++ by  doxygen 1.5.3