DIPlib Documentation - ©1995-2008 Quantitative Imaging Group, Delft University of Technology.

PoissonRandomVariable

Poisson random variable generator

SYNOPSIS

#include "dip_noise.h"

dip_Error dip_PoissonRandomVariable ( random, input, output )

FUNCTION

dip_PoissonRandomVariable uses the algorithm as described in "Numerical Recipes in C, 2nd edition", section 7.3. The define DIP_NOISE_POISSON_APPROXIMATE (default 30) in dip_noise.h determines the minimum value of the mean for which the rejection method is used. Setting this value higher will result in variables whose distribution is a slightly better approximation of the true Poisson distribution, but at the expense of a significantly higher computational effort.

ARGUMENTS

Data typeNameDescription
dip_Random *randomPointer to a random value structure
dip_floatinputInput value
dip_float *outputPoisson distributed output value

EXAMPLE

Get a Poisson random variable as follows:

   dip_Random random;
   dip_float mean, value;

   mean = 23.0;
   DIPXX( dip_PoissonRandomVariable( &random, mean, &value));

LITERATURE

Press, W.H., Teukolsky, S.A., Vetterling, W.T., and Flannery, B.P. Numerical Recipes in C, 2nd edition, Cambridge University Press, Cambridge, 1992.

SEE ALSO

RandomVariable, RandomSeed, UniformRandomVariable, GaussianRandomVariable, BinaryRandomVariable

DIPlib on-line documentation | Function reference | Global function index