Skip to main content

Inverse Gamma Distribution

Name​

UxHwDoubleInverseGammaDist, UxHwFloatInverseGammaDist — Create an Inverse Gamma distribution.

Synopsis​

#include <uxhw.h>

double UxHwDoubleInverseGammaDist(double alpha, double beta);
float UxHwFloatInverseGammaDist(float alpha, float beta);

Description​

The UxHwDoubleInverseGammaDist() function, on architectures that associate distributional information with floating-point values, creates an Inverse Gamma distribution with parameters alpha and beta and associates it with its return value. The particle return value is the mean value of an Inverse Gamma distribution with parameters alpha and beta. The probability density function of the Inverse Gamma distribution is

{βαΓ(α)x−α−1e−β/xx>0,0x≤0.\begin{cases} \frac{\beta^\alpha}{\Gamma(\alpha)}x^{-\alpha - 1}e^{-\beta / x} & x>0, \\ 0 & x \le 0. \end{cases}

Parameters​

  • alpha ∈(1,∞)\in (1, \infty) — The shape parameter (α\alpha) of the Inverse Gamma distribution.
  • theta ∈[0,∞)\in [0, \infty) — The scale parameter (β\beta) of the Inverse Gamma distribution.

Return values​

The UxHwDoubleInverseGammaDist() function returns the mean value of an Inverse Gamma distribution with parameters alpha and beta and associates it with an Inverse Gamma distribution with parameters alpha and beta. If beta = 0 and alpha > 0, the function returns 00.

Illegal parameter values​

If alpha <= 0 or beta < 0, the function returns NaN. If alpha or beta are NaN, the function returns -NaN. See Handling of NaN.

Examples​

#include <stdio.h>
#include <uxhw.h>

int
main(void)
{
double value = UxHwDoubleInverseGammaDist(3.0, 2.0);
printf("value = %lf\n", value);

return 0;
}