Matlab routines for the Inverse-Gamma distribution
This repository contains Matlab® codes to compute:
- Cumulative distribution function (
igamcdf.m
)
- Probability density function (
igampdf.m
)
- Quantile function (
igaminv.m
)
- Random number generator (
igamrnd.m
)
- (Non-central) Moments (
igammom.m
)
for the Inverse-Gamma distribution, $mathcal{IG}(alpha, beta)$.
Probability density function
$$
f(x;alpha,beta)=frac{beta^alpha}{Gamma(alpha)}left(frac{1}{x}right)^{alpha+1}expleft(-frac{beta}{x}right),
$$
where $Gamma(cdot)$ is the Gamma function.
Cumulative distribution function
$$
F(x;alpha,beta) = Qleft(alpha,frac{beta}{x}right),
$$
where $Q(cdot)$ is the regularized gamma function, that is a normalized version of the upper incomplete gamma function, $gamma(cdot)$,
$$
Qleft(alpha,frac{beta}{x}right) = frac{gammaleft(alpha,frac{beta}{x}right)}{Gamma(alpha)}.
$$
Inverse cumulative distribution function (Quantile function)
$$
F^{-1}(p;alpha,beta)=Q^{-1}left(alpha,frac{beta}{p}right),
$$
where $Q^{-1}(cdot)$ is the (regularized) upper inverse incomplete gamma function.
$n^{th}$-(non-central)-moment
$$
E[X^n]=beta^nfrac{Gamma(alpha-n)}{Gamma(alpha)},quad alpha>n.
$$