From: Laces Duke on
I am VERY new to Matlab, but need to work with the Poisson Distribution. I have read about the 'poisspdf' function, but I need to vary the parameter, lambda. Lambda is defined at lambda = n*p, but Matlab seems to use a fixed value or uses the Random Number Generator to determine lambda.

Ultimately, I need the user to be able to input a value of 'n' and a value of 'p' and allow Matlab to determine lambda, then include this into the Poisson function.

Any help will be greatly appreciated.


Chris
From: Peter Perkins on
On 5/20/2010 1:18 PM, Laces Duke wrote:
> I have read about the 'poisspdf' function, but I need to vary the
> parameter, lambda. Lambda is defined at lambda = n*p, but Matlab seems
> to use a fixed value or uses the Random Number Generator to determine
> lambda.
>
> Ultimately, I need the user to be able to input a value of 'n' and a
> value of 'p' and allow Matlab to determine lambda, then include this
> into the Poisson function.

Chris, the Poisson distribution is _not_ defined in terms of n and p.
You are thinking of the Poisson as the limit of a binomial as n->inf,
p->0, which, while perfectly valid

<http://en.wikipedia.org/wiki/Poisson_distribution#How_does_this_distribution_arise.3F_.E2.80.94_The_law_of_rare_events>

is not the only use of the Poisson.

It seems to me that if you want to be able to specify n and p
separately, you might as well use the binomial. But in any case, you
are allowed to choose whatever value you wish when calling POISSPDF (or
POISSRND, or POISSCDF), and you can choose n*p.

POISSFIT, on the other hand, _estimates_ lambda from data. That may be
what you are referring to by, "or uses the Random Number Generator to
determine lambda".

Hope this helps.
From: Laces Duke on
I made a mistake. I typed the wrong function. I am using the c.d.f, not the p.d.f., therefore, the function that I am using it the 'poisscdf(X,lambda)'. I would think that I could create an 'mfile' allowing me input 'n' and 'p' and then calculate 'lambda' for use in another Matlab program, but not sure if that is the case and how to do that.



"Laces Duke" <dukecm(a)gmail.com> wrote in message <ht3qsf$jet$1(a)fred.mathworks.com>...
> I am VERY new to Matlab, but need to work with the Poisson Distribution. I have read about the 'poisspdf' function, but I need to vary the parameter, lambda. Lambda is defined at lambda = n*p, but Matlab seems to use a fixed value or uses the Random Number Generator to determine lambda.
>
> Ultimately, I need the user to be able to input a value of 'n' and a value of 'p' and allow Matlab to determine lambda, then include this into the Poisson function.
>
> Any help will be greatly appreciated.
>
>
> Chris