Navigation

Operators and Keywords

Function List:

C++ API

: randp (l, n)
: randp (l, m, n, …)
: randp (l, [m n …])
: v = randp ("state")
: randp ("state", v)
: randp ("state", "reset")
: v = randp ("seed")
: randp ("seed", v)
: randp ("seed", "reset")
: randp (…, "single")
: randp (…, "double")

Return a matrix with Poisson distributed random elements with mean value parameter given by the first argument, l.

The arguments are handled the same as the arguments for rand, except for the argument l.

Five different algorithms are used depending on the range of l and whether or not l is a scalar or a matrix.

For scalar l ≤ 12, use direct method.

W.H. Press, et al., Numerical Recipes in C, Cambridge University Press, 1992.

For scalar l > 12, use rejection method.[1]

W.H. Press, et al., Numerical Recipes in C, Cambridge University Press, 1992.

For matrix l ≤ 10, use inversion method.[2]

E. Stadlober, et al., WinRand source code, available via FTP.

For matrix l > 10, use patchwork rejection method.

E. Stadlober, et al., WinRand source code, available via FTP, or H. Zechner, Efficient sampling from continuous and discrete unimodal distributions, Doctoral Dissertation, 156pp., Technical University Graz, Austria, 1994.

For l > 1e8, use normal approximation.

L. Montanet, et al., Review of Particle Properties, Physical Review D 50 p1284, 1994.

The class of the value returned can be controlled by a trailing "double" or "single" argument. These are the only valid classes.

See also: rand, randn, rande, randg.

Package: octave