yat  0.14.5pre
Public Types | Public Member Functions | Protected Attributes | List of all members
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

Public Types

typedef unsigned long int result_type
 

Public Member Functions

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

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 $

Member Typedef Documentation

typedef unsigned long int theplu::yat::random::Discrete::result_type
inherited

type returned by operator()

Since
New in yat 0.10

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 Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5