1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>RANDP Generate Poisson Random Variable
</TITLE>
</HEAD>
<BODY>
<H2>RANDP Generate Poisson Random Variable
</H2>
<P>
Section: <A HREF=sec_random.html> Random Number Generation </A>
<H3>Usage</H3>
Generates a vector Poisson random variables with the given
parameters. The general syntax for its use is
<PRE>
y = randp(nu),
</PRE>
<P>
where <code>nu</code> is an array containing the rate parameters
for the generated random variables.
<H3>Function Internals</H3>
A 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 <code>1/N</code>).
The Poisson distribution is given by
<P>
<DIV ALIGN="CENTER">
<IMG SRC="randp_eqn1.png">
</DIV>
<P>
<H3>Example</H3>
Here is an exmaple of using <code>randp</code> to generate some Poisson
random variables, and also using <code>randbin</code> to do the same
using <code>N=1000</code> trials to approximate the Poisson result.
<PRE>
--> 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
</PRE>
<P>
</BODY>
</HTML>
|