Re: [R] Ratio of gammas

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

On 8/27/2008 11:14 AM, Erwann.Rogard_at_sanofi-aventis.com 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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive