Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

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/

**References**:**st: gamma***From:*Jason Rosenberg <RSNJAS002@myuct.ac.za>

**Re: st: gamma***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**Re: st: break string into multiple variables: correction** - Next by Date:
**st: New versions of -qqvalue- and -smileplot- on SSC** - Previous by thread:
**Re: st: gamma** - Next by thread:
**st: encode command** - Index(es):