# Re: st: Re: St.: Truncating Poisson - using ML

 From "Vimalanand S. Prabhu" To statalist@hsphsun2.harvard.edu Subject Re: st: Re: St.: Truncating Poisson - using ML Date Wed, 30 Aug 2006 09:06:53 -0400

Dear Jamie,

Thanks for your help. The max procedure is running, but doesn't seem to converge. May be somethings wrong with my data or likelihood function.

Thanks,

Prabhu

Jamie Griffin wrote:

You can use the incomplete gamma function. If Y~Poisson(lambda), then
prob(Y<=k)=Q(k+1, lambda), where Q is the upper incomplete gamma
function.
So in Stata code the cumulative probability prob(Y<=k) is

1-gammap(k+1, lambda)

Jamie Griffin

prabhu@unc.edu 08/30/06 12:14 am >>>
Dear all,

The MLE for poisson function is L= exp(-lambda)Lambda^Y/Y!

I found the following code for poisson on a website (by David Todd) as

follows:

program define poisreg2
args lnf theta
quietly replace `lnf' = -exp(`theta') +
\$ML_y1*(`theta')-lnfact(\$ML_y1)
end

Now, I want to truncate the distribution. The new MLE function is
L2 = L/prob(y<=ymax).
i.e. divide the likelihood function by prob(y<=ymax).
i.e subtract the log function by CDF_POISSON(lambda,ymax).

For that I need a poisson cumulative distribution function which I am not able to find out.

What is the command for finding a cumulative distribution function? It

should use two parameters and should be something like, f= poisson(lambda,ymax)

Thanks,

Prabhu

*
* 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/
*
* 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/
*
*   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/