Binomial Class Reference

#include <Binomial.h>

Inheritance diagram for Binomial:
Inheritance graph
[legend]
Collaboration diagram for Binomial:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Binomial ()
 Binomial (long n, double p)
long getN () const
double getP () const
double getMean () const
double getVariance () const
double getNextSample () const

Constructor & Destructor Documentation

Binomial::Binomial (  )  [inline]
Binomial::Binomial ( long  n,
double  p 
)

Binomial distribution generator with parameters n and p. p is the probability of the favoured outcome, n is the number of trials.


Member Function Documentation

double Binomial::getMean (  )  const [virtual]

Implements Probability.

Referenced by testBinomial().

long Binomial::getN (  )  const
double Binomial::getNextSample (  )  const [virtual]

returns the next random number in this distribution as the ratio of the number of positive outcomes and the total number of trials. This is the most naive implementation. This is ok for small n. For large n such that mean > 10, we use BTRD algorithm by Hoermann. See documentation of generateTrd() for further detail.

Implements Probability.

References mtrand().

Referenced by testBinomial().

Here is the call graph for this function:

double Binomial::getP (  )  const
double Binomial::getVariance (  )  const [virtual]

Implements Probability.


The documentation for this class was generated from the following files:

Generated on 1 Jul 2015 for MOOSE by  doxygen 1.6.1