Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: genpoisson & lambda>80


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: genpoisson & lambda>80
Date   Mon, 8 Sep 2003 13:35:48 +0100

Benoit Dulong

> I searched the Stata listeserver archive and I have not
> seen any reported
> problem for -- genpoisson --.
>
> If X = Poisson distribution with parameter lambda,
> mean(X) = lambda
>
> --genpoisson-- seems to work for lambda < 80.
> --genpoisson-- seems to have problems for lambda > 80 ?
>
> Is this a known problem ?
>
> ------------------------------------------------------------
> ----------
> package installation
> ------------------------------------------------------------
> ----------
>
> package name:  gendist.pkg
>         from:  http://www.stata.com/users/rgutierrez/
>
> checking gendist consistency and verifying not already installed...
> all files already exist and are up-to-date.
>
> ------------------------------------------------------------
> ----------
> EXAMPLE
>
> . set obs 1000
> obs was 0, now 1000
>
> . genpoisson x25,  mu(25)
> . genpoisson x50,  mu(50)
> . genpoisson x75,  mu(75)
> . genpoisson x80,  mu(80)
> . genpoisson x90,  mu(90)
> . genpoisson x100, mu(100)
> . genpoisson x200, mu(200)
>
> . tabstat x*, s(n min max mean sd) c(stat) f(%9.2f)
>
>     variable |         N       min       max      mean        sd
> -------------+--------------------------------------------------
>          x25 |   1000.00     10.00     43.00     25.08      5.16
>          x50 |   1000.00     30.00     69.00     50.29      6.97
>          x75 |   1000.00     47.00    108.00     74.88      8.65
>          x80 |   1000.00     56.00    107.00     79.97      8.72
>          x90 |   1000.00     56.00    115.00     82.88      9.15
>         x100 |   1000.00     60.00    112.00     83.24      8.86
>         x200 |   1000.00     58.00    119.00     83.12      9.19
> ----------------------------------------------------------------

The problem looks like one of numerical analysis.

I suspect that the algorithm used is being stretched
beyond breaking point by your larger means. Clearly
it never generates large enough high values for you
to get the means you want. I suspect that also arises from
the difficulty of holding exp(-mean) accurately when
mean is large.

I note also that a Poisson with mean 200 has skewness 1/sqrt(200) =
.07071068
and kurtosis 3 + 1/200 = 3.005, so in practice you could not
distinguish
a sample from such a Poisson and one from a (discretised) Gaussian
with
mean 200 and sd sqrt(200).

Nick
n.j.cox@durham.ac.uk

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index