Re: Second Opinion
- To: mathgroup at smc.vnet.net
- Subject: [mg26382] Re: [mg26373] Second Opinion
- From: BobHanlon at aol.com
- Date: Sat, 16 Dec 2000 02:40:12 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Needs["Statistics`DiscreteDistributions`"];
dist = PoissonDistribution[mu];
Domain[dist]
Range[0, Infinity]
PDF[dist, x]
mu^x/(E^mu*x!)
Verify that the distribution is valid on the domain
Sum[PDF[dist, x], {x, 0, Infinity}] == 1
True
mu == Mean[dist] == Variance[dist]
True
CDF[dist, x]
GammaRegularized[1 + Floor[x], mu]
FullSimplify[
CDF[dist, x] == Sum[PDF[dist, k], {k, 0, x}],
Element[x, Integers]]
True
Plot[CDF[PoissonDistribution[5], n], {n, 0, 10}, PlotPoints -> 101,
PlotStyle -> RGBColor[1, 0, 0]];
Plot3D[CDF[PoissonDistribution[mu], n], {mu, 1, 5}, {n, 0, 6},
PlotPoints -> 25];
Demonstrating that the mean of Poisson data is the maximum likelihood
estimate for the parameter mu
data = Table["x" <> ToString[k], {k, 20}];
(mu /. Solve[D[(Plus @@ Log[PDF[dist, #] & /@ data]), mu] == 0, mu][[1]]) ==
Mean[data]
True
data = RandomArray[PoissonDistribution[10*Random[]], {250}];
(mu /. Solve[D[(Plus @@ Log[PDF[dist, #] & /@ data]), mu] == 0, mu][[1]]) ==
Mean[data]
True
Bob Hanlon
In a message dated 12/13/00 3:40:40 AM, john.lai at worldnet.att.net writes:
>I tried to calculate Poisson Distribution in a backdoor way and used
>mathematica to model it. I could not get what I wanted. I don't think
>it
>is mathematica problem and more than likely my method is flawed. So I
>toss
>this out to see if some of you may spot my error.
>
>Poisson Distribution,P(n) =1-Summation [exp(-n)*(n^x)]/Factorial(x) where
>x
>goes from 0 to N-1
>
>For given n and N, P(n) can be determined easily. However, I want to
>determine N if P(n) and n are specified and I do not want to get access
>to
>Poisson lookup table. My idea is to calculate P(n) with a series of n
>and N
>(essentially generating the tables). Plot a surface curve whose variables
>are n, P(n) and N. The idea was once this surface is obtained, with x-axis
>as n, y-axis as P(n) and z-axis as N, then for a given n and P(n) I can
>obtain N.
>
>I wrote a C program to generate P(n) and use mathematica to plot this
>surface. I have 14 sets of n and in each set of n, I have 139 variables
>(i.e. N runs from 1 to 140 ), so there are 139 corresponding values of
>P(n)
>for each n. When I tried to use the function Fit to estimate this surface,
>it took about hr for my 500MHz desktop to calculate! And the resultant
>expression is huge!
>
>Then, I cut down the dimension of my data set. For each n, I generated
>10
>values of N and repeated the process again. However, no matter what
>combination of polynomial I used (x,x^-1,Exp(-x),Exp(-x^2),Exp(-x-y).),
>the
>resulting equation of the surface is meaningless. It doesn't look right
>(at
>least I expected it to resemble some sort of Poisson or even Gaussian shape)
>and substituting P(n) and n back, I got garbage. I have enclosed a .nb
>file
>for reference. [Contact the author to obtain this file - moderator]
>
>So after all this, does it mean that my scheme of calculating Poisson
>Distribution is fundamentally wrong?
>Any suggestions are appreciated and thanks in advance.
>