Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: distribs
See also: cdfpois pdfpois qpois

Quantlet: ranpois
Description: generates arrays (up to 8 dimensions) of pseudo random variables with Poisson distribution.

Usage: y = ranpois(n,lambda)
Input:
n m x 1 vector of positive integers, x_m is the number of elements in m-th dimension of the array (m <= 8)
lambda scalar, parameter of the Poisson distribution (0 < lambda)
Output:
y x1 x ... x x_m array, random generated numbers with Poisson distribution

Example:
library("distribs")
randomize2(1000)
R = ranpois(3,15)	;	generates 3 numbers with Poisson distribution
;	and parameter lambda = 15
R

Result:
Contents of R

[1,]        14
[2,]        13
[3,]        15
Example:
library("distribs")
randomize2(1000)
lambda = 15
a = #(5,6)
R = ranpois(a,lambda)		;	generates matrix(5x6) of 30 numbers
;	with Poisson distribution
;       and parameter lambda = 15
R

Result:
Contents of R

      [1,]       14       14       11       14       18       20
      [2,]       13       17       14       18       15       17
      [3,]       15       16       11       15       18       14
      [4,]       25       16       16       13       13       19
      [5,]       15       19       20       16        7       10



Author: P. Mista, 20041104 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006