nag_rand_compd_poisson (g05tkc) generates a vector of pseudorandom integers, each from a discrete Poisson distribution with differing parameter.
nag_rand_compd_poisson (g05tkc) generates
integers
, each from a discrete Poisson distribution with mean
, where the probability of
is
where
The methods used by this function have low set up times and are designed for efficient use when the value of the parameter
changes during the simulation. For large samples from a distribution with fixed
using
nag_rand_poisson (g05tjc) to set up and use a reference vector may be more efficient.
When
the product of uniforms method is used, see for example
Dagpunar (1988). For larger values of
an envelope rejection method is used with a target distribution:
This distribution is generated using a ratio of uniforms method. A similar approach has also been suggested by
Ahrens and Dieter (1989). The basic method is combined with quick acceptance and rejection tests given by
Maclaren (1990). For values of
Stirling's approximation is used in the computation of the Poisson distribution function, otherwise tables of factorials are used as suggested by
Maclaren (1990).
One of the initialization functions
nag_rand_init_repeatable (g05kfc) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable sequence) must be called prior to the first call to nag_rand_compd_poisson (g05tkc).
Ahrens J H and Dieter U (1989) A convenient sampling method with bounded computation times for Poisson distributions Amer. J. Math. Management Sci. 1–13
Not applicable.
Not applicable.
None.
This example prints ten pseudorandom integers from five Poisson distributions with means
,
,
,
and
. These are generated by ten calls to nag_rand_compd_poisson (g05tkc), after initialization by
nag_rand_init_repeatable (g05kfc).
None.