4

I have a problem which is posed in terms of incomplete Gamma functions and inverse incomplete Gamma functions. Recall that where a Gamma function is a particular integral from 0 to infinity, incomplete gamma functions add another parameter, x, and integrate from 0 to x (a lower incomplete) and from x to infinity (an upper incomplete.)

I know Matlab has functions covering all those functions: complete Gamma functions, upper and lower incomplete Gamma functions, and the inverses. However, Matlab implements their incomplete Gamma functions as regularized incomplete gamma functions, which is to say, they are divided by the complete Gamma functions.

I am looking for Matlab implementations of the non-regularized incomplete Gamma functions, most especially the inverse incomplete Gamma functions. Does anyone know of such a thing, or an easy way to construct one? (The 'forward' incomplete Gamma functions are easy to implement by scaling, but there may be faster implementations. If there is a simple implementation of the inverses, it eludes me.)

Novak
  • 4,687
  • 2
  • 26
  • 64
  • 1
    Wouldn't it be easier if you formulated your problem in terms of the regularized gammas? There are good reasons these functions (and others) are implemented as normalized/regularized... – Rody Oldenhuis Aug 31 '12 at 12:04
  • It's not my formulation, unfortunately. It is possible that the paper *means* regularized Gamma functions and is just badly written; one reason I'm looking for the non-regularized version is to do it both ways and compare against the original paper. (Gamma functions are outside my expertise-- I'd love to hear why the regularized functions are used, if it is an easy thing to fit in a comment.) – Novak Aug 31 '12 at 15:41

2 Answers2

2

Since the R2014a release, MATLAB incorporates the function igamma, which does what you where looking (back then in 2012...):

I am looking for Matlab implementations of the non-regularized incomplete Gamma functions, most especially the inverse incomplete Gamma functions.

Just so that everybody knows.

1

If you are willing to interface to C/C++, the GSL (GNU Scientific Library) has implementations of both the normalized and unnormalized incomplete Gamma functions, such as gsl_sf_gamma_inc.

Or run the GSL versions in C as a quick check on your Matlab results.

burningbright
  • 152
  • 1
  • 8