Poisson random variable generator
#include "dip_noise.h"
dip_Error dip_PoissonRandomVariable ( random, mean, value )
PoissonRandomVariable uses the algorithm as described in "Numerical Recipes in C, 2nd edition", section 7.3. For values of mean larger or equal to 32 the rejection method is used.
See RandomVariable for more information on the random number generator.
Data type | Name | Description |
dip_Random * | random | Pointer to a random value structure |
dip_float | mean | Mean value for the distribution |
dip_float * | value | Poisson distributed output value |
Get a Poisson random variable as follows:
dip_Random random; dip_float mean, value; mean = 23.0; DIPXJ( dip_RandomSeed( &random, 0 )); DIPXJ( dip_PoissonRandomVariable( &random, mean, &value ));
Press, W.H., Teukolsky, S.A., Vetterling, W.T., and Flannery, B.P. Numerical Recipes in C, 2nd edition, Cambridge University Press, Cambridge, 1992.
RandomVariable, RandomSeed, RandomSeedVector, UniformRandomVariable, GaussianRandomVariable, BinaryRandomVariable