On 05-Dec-05 Florent Bresson wrote: > 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 ? > > thanks
You should have more success with exp(lgamma(x) - lgamma(x+y)) E.g. > gamma(250) [1] Inf > exp(lgamma(250)-lgamma(251)) [1] 0.004 = 1/250 (as it should). Does this help? Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 05-Dec-05 Time: 16:29:21 ------------------------------ XFMail ------------------------------ ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
