Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
poissrnd

Subject: poissrnd

From: Goftam YaNagoftam

Date: 13 May, 2012 00:01:51

Message: 1 of 3

Hi,

I know exactly what a poisson variable is, however, can someone explain how does poissrnd function exactly work?

when I try
R=poissrnd(2/10,[20 4]);
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?)

I would really appreciate the answer.

Subject: poissrnd

From: Roger Stafford

Date: 13 May, 2012 03:24:47

Message: 2 of 3

". YaN" wrote in message <jomtlf$dan$1@newscl01ah.mathworks.com>...
> when I try
> R=poissrnd(2/10,[20 4]);
> 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?)
- - - - - - - - - -
  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:

 http://en.wikipedia.org/wiki/Poisson_distribution

for an explanation. To be precise, the probability of getting a non-negative 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:

 (0.2)^0/0!*exp(-0.2) = .818730753
 (0.2)^1/1!*exp(-0.2) = .153746151
 (0.2)^2/2!*exp(-0.2) = .016374615,

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).

  And yes, the output array R would have a 20 by 4 size, as you can easily check for yourself.

  I don't understand your reference to "errors". The 'poissrnd' function generates non-negative 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.

Roger Stafford

Subject: poissrnd

From: . YaN

Date: 13 May, 2012 04:12:20

Message: 3 of 3

"Roger Stafford" wrote in message <jon9hv$r79$1@newscl01ah.mathworks.com>...
> ". YaN" wrote in message <jomtlf$dan$1@newscl01ah.mathworks.com>...
> > when I try
> > R=poissrnd(2/10,[20 4]);
> > 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?)
> - - - - - - - - - -
> 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:
>
> http://en.wikipedia.org/wiki/Poisson_distribution
>
> for an explanation. To be precise, the probability of getting a non-negative 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:
>
> (0.2)^0/0!*exp(-0.2) = .818730753
> (0.2)^1/1!*exp(-0.2) = .153746151
> (0.2)^2/2!*exp(-0.2) = .016374615,
>
> 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).
>
> And yes, the output array R would have a 20 by 4 size, as you can easily check for yourself.
>
> I don't understand your reference to "errors". The 'poissrnd' function generates non-negative 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.
>
> Roger Stafford

Thanks alot Roger,
you completely answered my question.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us