NAME
poisson_rand - Returns a Poisson-distributed random number
SYNOPSIS
#include "sample/sample_misc.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int poisson_rand(double lambda);
DESCRIPTION
This routine returns a Poisson-distributed random integer,
with parameter lambda. The random stream from kjb_rand() is used.
RETURNS
A Poisson-distributed integer. If lambda is negative, it
calls the bug handler and (if that returns), returns ERROR.
We advise you to use another algorithm if lambda is large;
perhaps use a normal approximation with mean = variance = lambda.
This implements Knuth's algorithm in TAOCP vol. 2.
RELATED
kjb_rand
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Ernesto Brau
DOCUMENTER
Ernesto Brau
SEE ALSO
kjb_rand_int
,
sample_from_discrete_distribution
,
sample_from_uniform_distribution
,
gamma_pdf
,
log_gamma_pdf
,
sample_from_gamma_distribution
,
sample_from_gamma_distribution_2
,
pick_m_from_n