Class NonCentralChiSquaredDistribution

  • All Implemented Interfaces:
    ProbabilityDistribution<Double>

    public class NonCentralChiSquaredDistribution
    extends Object
    implements ProbabilityDistribution<Double>
    The non-central chi-squared distribution is a continuous probability distribution with probability density function $$ \begin{align*} f_r(x) = \frac{e^-\frac{x + \lambda}{2}x^{\frac{r}{2} - 1}}{2^{\frac{r}{2}}}\sum_{k=0}^\infty \frac{(\lambda k)^k}{2^{2k}k!\Gamma(k + \frac{r}{2})} \end{align*} $$ where $r$ is the number of degrees of freedom, $\lambda$ is the non-centrality parameter and $\Gamma$ is the Gamma function (GammaFunction).

    For the case where $r + \lambda > 2000$, the implementation of the cdf is taken from "An Approximation for the Noncentral Chi-Squared Distribution", Fraser et al. (link). Otherwise, the algorithm is taken from "Computing the Non-Central Chi-Squared Distribution Function", Ding.

    • Constructor Detail

      • NonCentralChiSquaredDistribution

        public NonCentralChiSquaredDistribution​(double degrees,
                                                double nonCentrality)
        Creates an instance.
        Parameters:
        degrees - The number of degrees of freedom, not negative or zero
        nonCentrality - The non-centrality parameter, not negative