| Statistics Toolbox | ![]() |
Random numbers from the Poisson distribution
Syntax
Description
R = poissrnd(LAMBDA)
generates Poisson random numbers with mean LAMBDA. The size of R is the size of LAMBDA.
R = poissrnd(LAMBDA,m)
generates Poisson random numbers with mean LAMBDA, where m is a 1-by-2 vector that contains the row and column dimensions of R.
R = poissrnd(LAMBDA,m,n)
generates Poisson random numbers with mean LAMBDA, where scalars m and n are the row and column dimensions of R.
Examples
Generate a random sample of 10 pseudo-observations from a Poisson distribution with
= 2.
lambda = 2; random_sample1 = poissrnd(lambda,1,10) random_sample1 = 1 0 1 2 1 3 4 2 0 0 random_sample2 = poissrnd(lambda,[1 10]) random_sample2 = 1 1 1 5 0 3 2 2 3 4 random_sample3 = poissrnd(lambda(ones(1,10))) random_sample3 = 3 2 1 1 0 0 4 0 2 0
See Also
poisscdf, poissfit, poissinv, poisspdf, poisstat
| poisspdf | poisstat | ![]() |