2.2.5.16. InvGamma law

The inverse-Gamma distribution is a two-parameter family of continuous probability distributions. It depends on a shape parameter \(\alpha\) and a scale parameter \(\beta\). The function is usually defined for \(x\) greater than 0, but the distribution can be shifted thanks to the third parameter called location (\(\xi\)) which should be positive.

\[f(x) = \frac{\beta^{\alpha}(x-\xi)^{- \alpha - 1} e^{-\beta/(x-\xi)}}{\Gamma(\alpha) } \; {\rm 1\kern-0.28emI}_{]\xi,+\infty]}(x)\]

Uranie code to simulate a inverse-Gamma random variable is:

    TDataServer *tds = new TDataServer("tdssampler", "Sampler Uranie demo");
    tds->addAttribute( new TInvGammaDistribution("ing", 2.0, 0.5, 0.0));
    
    TSampling *fsamp = new TSampling(tds, "lhs", 300);
    fsamp->generateSample(); // Create a representative sample
    
    tds->Draw("ing");

Figure 2.28 shows the PDF, CDF and inverse CDF generated for different sets of parameters.

../../../_images/TInvGammaDistribution.png

Figure 2.28 Example of PDF, CDF and inverse CDF for InvGamma distributions.

Is it also possible to set boundaries to the infinite span of this distribution to create a truncated InvGamma law. This can be done by calling the following method:

    tds->getAttribute("ing")->setBounds(-3.0,8.0); //truncate the law

The resulting PDF, CDF and inverse CDF, with and without truncation, can be seen, in this case, in Figure 2.29 for a given set of parameters and various boundaries.

../../../_images/TInvGammaTruncatedDistribution.png

Figure 2.29 Example of PDF, CDF and inverse CDF for a InvGamma truncated distribution.