s-news
[Top] [All Lists]

Re: about the percentiles of a Gamma distribution

To: Stefano Sofia <stefano.sofia@usa.net>
Subject: Re: about the percentiles of a Gamma distribution
From: Spencer Graves <spencer.graves@PDF.COM>
Date: Thu, 21 Aug 2003 03:20:02 -0700
Cc: s-news@lists.biostat.wustl.edu
References: <585HHuimY2768S03.1061453570@uwdvg003.cms.usa.net>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
It only looks like 1:

> 1 - pgamma(30:50, 12.51, 1.41)
[1] 2.160711e-008 7.609174e-009 2.649777e-009 9.130586e-010 3.115069e-010 1.052827e-010 [7] 3.526857e-011 1.171563e-011 3.860801e-012 1.262657e-012 4.100054e-013 1.322276e-013 [13] 4.241052e-014 1.343370e-014 4.218847e-015 1.332268e-015 4.440892e-016 1.110223e-016
[19] 0.000000e+000 0.000000e+000 0.000000e+000

If you want more accurate numbers for the upper tail, try R (from www.r-project.org), in which pgamma has an "upper.tail=FALSE" option:

> pgamma(30:50, 12.51, 1.41, lower.tail=FALSE)
 [1] 2.160711e-08 7.609174e-09 2.649777e-09 9.130586e-10 3.115069e-10
 [6] 1.052827e-10 3.526857e-11 1.171559e-11 3.860768e-12 1.262673e-12
[11] 4.099940e-13 1.322157e-13 4.235910e-14 1.348649e-14 4.268358e-15
[16] 1.343216e-15 4.203973e-16 1.308888e-16 4.054780e-17 1.250091e-17
[21] 3.836261e-18

hope this helps.  spencer graves

Stefano Sofia wrote:
I need a trivial confirm: given a Gamma distribution with
shape = alpha and rate = beta

I need to evaluate the p_th percentile. For the 10th percentile of a
Gamma(12.51, 1.41), for example, it would simply be

pgamma(10, 12.51, 1.41)

Correct?
Why pgamma(q, 12.51, 1.41) for q greater than 30 always gives as result 1?

thank you
Stefano


--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news



<Prev in Thread] Current Thread [Next in Thread>