yat  0.8.3pre
Public Member Functions | Protected Attributes
theplu::yat::random::Poisson Class Reference

Poisson Distribution. More...

#include <yat/random/random.h>

Inheritance diagram for theplu::yat::random::Poisson:
theplu::yat::random::Discrete

List of all members.

Public Member Functions

 Poisson (const double m=1)
 Constructor.
unsigned long operator() (void) const
unsigned long operator() (const double m) const
void seed (unsigned long s) const
 Set the seed to s.
unsigned long seed_from_devurandom (void)
 Set the seed using the /dev/urandom device.

Protected Attributes

RNGrng_
 GSL random gererator.

Detailed Description

Poisson Distribution.

Having a Poisson process (i.e. no memory), number of occurences within a given time window is Poisson distributed. This distribution is the limit of a Binomial distribution when number of attempts is large, and the probability for one attempt to be succesful is small (in such a way that the expected number of succesful attempts is $ m $.

Probability function $ p(k) = e^{-m}\frac{m^k}{k!} $ for $ 0 \le k $
Expectation value: $ m $
Variance: $ m $


Constructor & Destructor Documentation

theplu::yat::random::Poisson::Poisson ( const double  m = 1)
explicit

Constructor.

Parameters:
mis expectation value

Member Function Documentation

unsigned long theplu::yat::random::Poisson::operator() ( void  ) const
virtual
Returns:
A Poisson distributed number.

Implements theplu::yat::random::Discrete.

unsigned long theplu::yat::random::Poisson::operator() ( const double  m) const
Returns:
A Poisson distributed number with expectation value m
Note:
this operator ignores parameters set in Constructor
void theplu::yat::random::Discrete::seed ( unsigned long  s) const
inherited

Set the seed to s.

Set the seed to s in the underlying rng. If s is zero, a default value from the rng's original implementation is used (cf. GSL documentation).

Deprecated:
Provided for backward compatibility with the 0.7 API. Use RNG::instance()->seed(s) instead.
unsigned long theplu::yat::random::Discrete::seed_from_devurandom ( void  )
inherited

Set the seed using the /dev/urandom device.

Returns:
The seed acquired from /dev/urandom.
Deprecated:
Provided for backward compatibility with the 0.7 API. Use RNG::instance()->seed_from_devurandom() instead.

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

Generated on Thu Dec 20 2012 03:12:59 for yat by  doxygen 1.8.0-20120409