http://www.mathworks.com/matlabcentral/newsreader/view_thread/320013
MATLAB Central Newsreader  poissrnd
Feed for thread: poissrnd
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sun, 13 May 2012 00:01:51 +0000
poissrnd
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320013#876628
Goftam YaNagoftam
Hi,<br>
<br>
I know exactly what a poisson variable is, however, can someone explain how does poissrnd function exactly work?<br>
<br>
when I try <br>
R=poissrnd(2/10,[20 4]);<br>
does this mean I am creating the a size [20, 4] matrix that shows where/when my errors are and whats is the amount of error ? (is 2/10 the probability of occurrence of error for each element in the [20 4] matrix?)<br>
<br>
I would really appreciate the answer.

Sun, 13 May 2012 03:24:47 +0000
Re: poissrnd
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320013#876635
Roger Stafford
". YaN" wrote in message <jomtlf$dan$1@newscl01ah.mathworks.com>...<br>
> when I try <br>
> R=poissrnd(2/10,[20 4]);<br>
> does this mean I am creating the a size [20, 4] matrix that shows where/when my errors are and whats is the amount of error ? (is 2/10 the probability of occurrence of error for each element in the [20 4] matrix?)<br>
         <br>
No, the 2/10 you have used is the value of the lambda parameter for the poisson distribution. It is both the mean value and the variance of the distribution. See:<br>
<br>
<a href="http://en.wikipedia.org/wiki/Poisson_distribution">http://en.wikipedia.org/wiki/Poisson_distribution</a><br>
<br>
for an explanation. To be precise, the probability of getting a nonnegative integer k as an output of 'poissrnd' is lambda^k/k!*exp(lambda). In your case with lambda = 2/10, the probability of getting a 0, 1, or 2, for example, would be:<br>
<br>
(0.2)^0/0!*exp(0.2) = .818730753<br>
(0.2)^1/1!*exp(0.2) = .153746151<br>
(0.2)^2/2!*exp(0.2) = .016374615,<br>
<br>
respectively. (You should observe the zeros predominating in your case.) The infinite sum of all such probabilities will be exactly 1, as you can easily demonstrate using the power series expansion for exp(+0.2).<br>
<br>
And yes, the output array R would have a 20 by 4 size, as you can easily check for yourself.<br>
<br>
I don't understand your reference to "errors". The 'poissrnd' function generates nonnegative integers in a random fashion and these can have whatever significance is attached to the stochastic process being simulated. There is nothing inherently erroneous about these numbers.<br>
<br>
Roger Stafford

Sun, 13 May 2012 04:12:20 +0000
Re: poissrnd
http://www.mathworks.com/matlabcentral/newsreader/view_thread/320013#876638
. YaN
"Roger Stafford" wrote in message <jon9hv$r79$1@newscl01ah.mathworks.com>...<br>
> ". YaN" wrote in message <jomtlf$dan$1@newscl01ah.mathworks.com>...<br>
> > when I try <br>
> > R=poissrnd(2/10,[20 4]);<br>
> > does this mean I am creating the a size [20, 4] matrix that shows where/when my errors are and whats is the amount of error ? (is 2/10 the probability of occurrence of error for each element in the [20 4] matrix?)<br>
>          <br>
> No, the 2/10 you have used is the value of the lambda parameter for the poisson distribution. It is both the mean value and the variance of the distribution. See:<br>
> <br>
> <a href="http://en.wikipedia.org/wiki/Poisson_distribution">http://en.wikipedia.org/wiki/Poisson_distribution</a><br>
> <br>
> for an explanation. To be precise, the probability of getting a nonnegative integer k as an output of 'poissrnd' is lambda^k/k!*exp(lambda). In your case with lambda = 2/10, the probability of getting a 0, 1, or 2, for example, would be:<br>
> <br>
> (0.2)^0/0!*exp(0.2) = .818730753<br>
> (0.2)^1/1!*exp(0.2) = .153746151<br>
> (0.2)^2/2!*exp(0.2) = .016374615,<br>
> <br>
> respectively. (You should observe the zeros predominating in your case.) The infinite sum of all such probabilities will be exactly 1, as you can easily demonstrate using the power series expansion for exp(+0.2).<br>
> <br>
> And yes, the output array R would have a 20 by 4 size, as you can easily check for yourself.<br>
> <br>
> I don't understand your reference to "errors". The 'poissrnd' function generates nonnegative integers in a random fashion and these can have whatever significance is attached to the stochastic process being simulated. There is nothing inherently erroneous about these numbers.<br>
> <br>
> Roger Stafford<br>
<br>
Thanks alot Roger, <br>
you completely answered my question.