/** * Construct a ChiSquareTestImpl */ public ChiSquareTestImpl() { this(new ChiSquaredDistributionImpl(1.0)); }
/** * Construct a ChiSquareTestImpl */ public ChiSquareTestImpl() { this(new ChiSquaredDistributionImpl(1.0)); }
/** * Construct a ChiSquareTestImpl */ public ChiSquareTestImpl() { this(new ChiSquaredDistributionImpl(1.0)); }
/** * Create a new chi-square distribution with the given degrees of freedom. * * @param degreesOfFreedom degrees of freedom * @return a new chi-square distribution */ public ChiSquaredDistribution createChiSquareDistribution( final double degreesOfFreedom) { return new ChiSquaredDistributionImpl(degreesOfFreedom); }
/** * Generates a random value from the {@link ChiSquaredDistributionImpl ChiSquare Distribution}. * This implementation uses {@link #nextInversionDeviate(ContinuousDistribution) inversion} * to generate random values. * * @param df the degrees of freedom of the ChiSquare distribution * @return random value sampled from the ChiSquare(df) distribution * @throws MathException if an error occurs generating the random value * @since 2.2 */ public double nextChiSquare(double df) throws MathException { return nextInversionDeviate(new ChiSquaredDistributionImpl(df)); }
public static double criticalVal(int hashCount, double alpha) { ChiSquaredDistributionImpl d = new ChiSquaredDistributionImpl(hashCount - 1); try { return d.inverseCumulativeProbability(1 - alpha); } catch (MathException e) { return Double.MIN_VALUE; } }