RANDP Generate Poisson Random Variable
Section: Random Number Generation
UsageGenerates a vector Poisson random variables with the given parameters. The general syntax for its use is
y = randp(nu),
nu is an array containing the rate parameters
for the generated random variables.
Function InternalsA Poisson random variable is generally defined by taking the limit of a binomial distribution as the sample size becomes large, with the expected number of successes being fixed (so that the probability of success decreases as
1/N). The Poisson distribution is given by
ExampleHere is an exmaple of using
randpto generate some Poisson random variables, and also using
randbinto do the same using
N=1000trials to approximate the Poisson result.
--> randp(33*ones(1,10)) ans = 31 33 34 44 32 29 34 30 32 32 --> randbin(1000*ones(1,10),33/1000*ones(1,10)) ans = 32 36 36 39 33 34 41 33 42 32