The cdf of the inverse gamma distribution defined over the support
x>0 with shape parameter a and scale parameter b is
F_{IG}(x, a, b) =\int_0^x t^{-a -1} \exp (-b/t)
\frac{b^a}{\Gamma(a)} dt
inversegamcdf computes the inverse-gamma cdf at each of the values in x using the
corresponding shape parameters in a and scale parameters in b. x, a, and
b can be vectors, matrices, or multidimensional arrays that all have the
same size. A scalar input is expanded to a constant array with the same
dimensions as the other inputs. The parameters in a and b must all be
positive, and the values in x must lie on the interval [0, \infty).
Note that F_{IG}(x,a,b)=\frac{\Gamma(a,b/x)}{\Gamma(\alpha)} therefore
Therefore, the CDF for an inverse Gamma distribution can be computed
using the incomplete gamma function (also called regularized gamma
function, i.e. MATLAB function gammainc) of course keeping into account
that we need the upper tail.
The chief use of the inverse gamma distribution is in Bayesian
statistics, where the distribution arises as the marginal posterior
distribution for the unknown variance of a normal distribution if an
uninformative prior is used; and as an analytically tractable conjugate
prior if an informative prior is required.
Relation with the Gamma distribution.
If X \sim Gamma(a,b) then \frac{1}{X} \sim inverse-gamma distribution
with paramters a and 1/b.