[R] Incomplete Gamma function
Robin Hankin
r.hankin at noc.soton.ac.uk
Fri Aug 31 14:32:15 CEST 2007
Hi Kris
lgamma() gives the log of the gamma function.
You need gamma_inc() of the gsl package, a wrapper for the
GSL library:
> gamma_inc(9,11.1)
[1] 9000.501
>
HTH
rksh
On 31 Aug 2007, at 00:29, poolloopus at yahoo.com wrote:
> Hello
>
> I am trying to evaluate an Incomplete gamma function
> in R. Library Zipfr gives the Igamma function. From
> Mathematica, I have:
>
> "Gamma[a, z] is the incomplete gamma function."
>
> In[16]: Gamma[9,11.1]
> Out[16]: 9000.5
>
> Trying the same in R, I get
>
>> Igamma(9,11.1)
> [1] 31319.5
> OR
>> Igamma(11.1,9)
> [1] 1300998
>
> I know I have to understand the theory and the math
> behind it rather than just ask for help, but while I
> am trying to do that (and only taking baby steps, I
> must admit), I was hoping someone could help me out.
>
> Regard
>
> Kris.
>
>
>
> ______________________________________________________________________
> ______________
> Got a little couch potato?
> Check out fun summer activities for kids.
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
tel 023-8059-7743
More information about the R-help
mailing list