# [R] Incomplete Gamma function

Martin Maechler maechler at stat.math.ethz.ch
Fri Aug 31 22:37:31 CEST 2007

```>>>>> "AN" == Anup Nandialath <anup_nandialath at yahoo.com>
>>>>>     on Fri, 31 Aug 2007 13:15:08 -0700 (PDT) writes:

AN> Hi Kris, You just need to understand the mathematics of
AN> the incomplete gamma function and the various
AN> relationships it has. The answers from both Mathematica
AN> and R are correct, except that they are giving you
AN> different estimated quantities. It depends on the way
AN> the gamma function is written. For instance in R to get
AN> the equivalent result from mathematica you should do the
AN> following

AN>  answer <- gamma(9) - Igamma(9,11.1). This will give you
AN> the incomplete gamma for (9,11.1) as given by
AN> Mathematica.

AN>  You can read more about the model and am sure you will
AN> figure it out.

Yes, and then,  *PLEASE*  do as Brian Ripley suggested,
and understand that the
(normalized) incomplete gamma function is the same as the gamma
distribution functions and has been available in S and R "for ever"
__and__ in R has been very thoroughly tested and quite a few extreme
cases have been made to work more accurately, etc etc: pgamma() !

BTW: The same applies to the incomplete beta function which --
in one of it's equivalent forms -- is called the beta
distribution function in probability and statistics and has been
available in S and R "for ever", and for R, has been very
carefully tested  and for extreme border cases gradually
improved over the years,  most recently for the upcoming R
2.6.0, where the precision of pbeta(*,  log=TRUE)  has been
dramatically improved in some extreme tail/range cases.
--> which benefits  pt(), pf(), pbinom() etc in equivalent
situations.

Martin Maechler,
ETH Zurich and R-core

AN>  Anup

AN> --------------------------------- Got a little couch
AN> potato?  Check out fun summer activities for kids.
AN> [[alternative HTML version deleted]]

AN> ______________________________________________
AN> R-help at stat.math.ethz.ch mailing list