Re: [R] Ratio of gammas

From: Duncan Murdoch <>
Date: Wed, 27 Aug 2008 11:27:10 -0400

On 8/27/2008 11:14 AM, wrote:
> hello,
> gamma(a) works fine for a<173, but gamma(173) returns
> [1] Inf
> Warning message:
> value out of range in 'gammafn'
> What I really need is the ratio
> gamma(nu/2) / gamma((nu+1)/2)
> is anyone aware of a way to re-express this in a form that pushes the
> threshold past which a warning message is generated?

Use logs:

exp( lgamma(nu/2) - lgamma((nu+1)/2) )

Duncan Murdoch mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 27 Aug 2008 - 15:41:00 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Aug 2008 - 16:34:01 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive