Re: [R] Implementation of gamma function for large number

2009-10-24 Thread Robert A LaBudde
At 04:53 PM 10/24/2009, R_help Help wrote: Hi - I ran into a problem when the argument to gamma function is large. Says, if I do the following: > gamma(17000) [1] Inf Warning message: value out of range in 'gammafn' Is there anyway to get around this or other implementation? Thank you. -rc T

Re: [R] Implementation of gamma function for large number

2009-10-24 Thread Richard M. Heiberger
Use the lgamma function. > log(gamma(170)) [1] 701.4373 > lgamma(170) [1] 701.4373 > In typical uses of gamma(), they are multiplied or divided by other gamma() values, bringing the final result into the range of double precision numbers. Also, look at beta(), which does those divisions of gamm

[R] Implementation of gamma function for large number

2009-10-24 Thread R_help Help
Hi - I ran into a problem when the argument to gamma function is large. Says, if I do the following: > gamma(17000) [1] Inf Warning message: value out of range in 'gammafn' Is there anyway to get around this or other implementation? Thank you. -rc __