s-news
[Top] [All Lists]

Re: gamma function

To: David Smith <dsmith@insightful.com>
Subject: Re: gamma function
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Fri, 30 Jan 2004 18:28:02 +0000 (GMT)
Cc: Spencer Graves <spencer.graves@pdf.com>, Christoph Scherber <Christoph.Scherber@uni-jena.de>, s-news <s-news@wubios.wustl.edu>
In-reply-to: <EDAC416B87ECCA44BEAB4D0CF48034EF2684F4@se2kexch01.insightful.com>
On Fri, 30 Jan 2004, David Smith wrote:

> > Unless Insightful wants to tell you exactly how they 
> > compute the gamma function, you may be out of luck.
> 
> Insightful is quite happy to do so. :)  The details are right there in
> help(gamma):

That's not what help(gamma) gives on my Linux S-PLUS 6.1 system, and it
does give help on gamma and not [dpq]gamma (which are in help(GAMMA)).
Under Windows, neither give useful information, and I suspect David was
using 6.2 under Windows and that has got a case-insensitivity problem ....

Most OSes have gamma and lgamma as functions in libc, and indeed the 
current C standard requires that.  My guess is that Insightful call the 
standard C functions where available.

There are lots of C implementations of gamma around.  Spencer has 
mentioned that R has one, and I recall locfit as having one ....

> For shape less than 10^8 pgamma(q,shape) is computed using formulae 6.5.31
> and 6.5.32 of Abramowitz and Stegun (1970). For these values of shape dgamma
> is computed based on the lgamma function. For larger values of shape pgamma
> and dgamma use a normal approximation, adjusted for skewness only. See
> formulae 26.2.48 and 26.1.32 of Abramowitz and Stegun. There may be slight
> discontinuities in higher derivatives at shape==10^8. 

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


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