"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 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:
>
> (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 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.
>
> Roger Stafford
Thanks alot Roger,
you completely answered my question.
