Class ChiSquaredDistribution

  • All Implemented Interfaces:
    Distribution

    public class ChiSquaredDistribution
    extends GammaDistribution
    Chi-Squared distribution (a specialization of the Gamma distribution).
    Since:
    0.5.0
    Author:
    Erich Schubert
    • Constructor Detail

      • ChiSquaredDistribution

        public ChiSquaredDistribution​(double dof)
        Constructor.
        Parameters:
        dof - Degrees of freedom.
    • Method Detail

      • cdf

        public static double cdf​(double val,
                                 double dof)
        The CDF, static version.
        Parameters:
        val - Value
        dof - Degrees of freedom.
        Returns:
        cdf value
      • pdf

        public static double pdf​(double x,
                                 double dof)
        Chi-Squared distribution PDF (with 0.0 for x < 0)
        Parameters:
        x - query value
        dof - Degrees of freedom.
        Returns:
        probability density
      • logpdf

        public static double logpdf​(double x,
                                    double dof)
        Chi-Squared distribution PDF (with 0.0 for x < 0)
        Parameters:
        x - query value
        dof - Degrees of freedom.
        Returns:
        probability density
      • quantile

        @Reference(authors="D. J. Best, D. E. Roberts",
                   title="Algorithm AS 91: The percentage points of the \u03c7\u00b2 distribution",
                   booktitle="Journal of the Royal Statistical Society. Series C (Applied Statistics)",
                   url="https://doi.org/10.2307/2347113",
                   bibkey="doi:10.2307/2347113")
        public static double quantile​(double x,
                                      double dof)
        Return the quantile function for this distribution

        Reference:

        D. J. Best, D. E. Roberts
        Algorithm AS 91: The percentage points of the χ² distribution
        Journal of the Royal Statistical Society. Series C (Applied Statistics)

        Parameters:
        x - Quantile
        dof - Degrees of freedom
        Returns:
        quantile position
      • toString

        public java.lang.String toString()
        Description copied from class: GammaDistribution
        Simple toString explaining the distribution parameters. Used in producing a model description.
        Specified by:
        toString in interface Distribution
        Overrides:
        toString in class GammaDistribution
        Returns:
        description