Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: gamma


From   "JVerkuilen (Gmail)" <jvverkuilen@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: gamma
Date   Thu, 11 Oct 2012 10:17:29 -0400

On Thu, Oct 11, 2012 at 8:31 AM, Nick Cox <njcoxstata@gmail.com> wrote:
> There is no function -gamma()-, largely I suspect because its values
> become very big.

The gamma function will overflow rapidly. That's why almost all
computation involving the gamma function is done on log scale, which
make sense because the gamma function is essentially a factorial, so
using log makes it behave like an additive rather than a
multiplicative function. http://en.wikipedia.org/wiki/Gamma_function

I don't know about Stata's lngamma function specifically, but in SAS
it will overflow for arguments 10^7 or 10^-7 or so. It is thus
important to program carefully to avoid very small or very large
arguments appearing suddenly. I doubt that Stata's function is much
different because both probably use the same basic numerics libraries
and double precision arithmetic.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index