Re: [R] The gamma function and infinity

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Tue 06 Dec 2005 - 03:14:47 EST

Florent Bresson <f_bresson@yahoo.fr> writes:

> I have to calculate some formula like:
>
> gamma(x)/(gamma(x+y)
>
> and I observed that for relatively big values of x, R
> returns infinity and so cannot compute the formula. Is
> it possible to force R to give the real value of
> gamma(x) instead of Inf ?

No, it is overflowing the floating point representation.

How about using lgamma? That's basically what it is for.

-- 
   O__  ---- Peter Dalgaard             ุster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Dec 06 03:40:16 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:41:28 EST