[R] Ratio of gammas

Duncan Murdoch murdoch at stats.uwo.ca
Wed Aug 27 17:27:10 CEST 2008


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



More information about the R-help mailing list