Documentation of 'umontreal.iro.lecuyer.probdist.ChiSquareDistQuick' Java class
ChiSquareDistQuick
umontreal.iro.lecuyer.probdist

Class ChiSquareDistQuick

  • All Implemented Interfaces:
    Distribution


    public class ChiSquareDistQuick
    extends ChiSquareDist
    Provides a variant of ChiSquareDist with faster but less accurate methods. The non-static version of inverseF calls the static version. This method is not very accurate for small n but becomes better as n increases. The other methods are the same as in ChiSquareDist.
    • Constructor Detail

      • ChiSquareDistQuick

        public ChiSquareDistQuick(int n)
        Constructs a chi-square distribution with n degrees of freedom.
    • Method Detail

      • inverseF

        public double inverseF(double u)
        Description copied from class: ContinuousDistribution
        Returns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].
        Specified by:
        inverseF in interface Distribution
        Overrides:
        inverseF in class ChiSquareDist
        Parameters:
        u - value at which the inverse distribution function is evaluated
        Returns:
        the inverse distribution function evaluated at u
      • inverseF

        public static double inverseF(int n,
                                      double u)
        Computes a quick-and-dirty approximation of F-1(u), where F is the chi-square distribution with n degrees of freedom. Uses the approximation given in Figure L.24 of Bratley, Fox and Schrage (1987) over most of the range. For u < 0.02 or u > 0.98, it uses the approximation given in Goldstein for n >= 10, and returns 2.0 * GammaDist.inverseF (n/2, 6, u) for n < 10 in order to avoid the loss of precision of the above approximations. When n >= 10 or 0.02 < u < 0.98, it is between 20 to 30 times faster than the same method in ChiSquareDist for n between 10 and 1000 and even faster for larger n.

        Note that the number d of decimal digits of precision generally increases with n. For n = 3, we only have d = 3 over most of the range. For n = 10, d = 5 except far in the tails where d = 3. For n = 100, one has more than d = 7 over most of the range and for n = 1000, at least d = 8. The cases n = 1 and n = 2 are exceptions, with precision of about d = 10.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.