FDistribution extends AbstractRealDistribution { public double cumulativeProbability(double x) { double ret; if (x <= 0) { ret = 0; } else { double n = numeratorDegreesOfFreedom; double m = denominatorDegreesOfFreedom; ret = Beta.regularizedBeta((n * x) / (m + n * x), 0.5 * n, 0.5 * m); } return ret; } FDistribution(double numeratorDegreesOfFreedom,
                         double denominatorDegreesOfFreedom);  FDistribution(double numeratorDegreesOfFreedom,
                         double denominatorDegreesOfFreedom,
                         double inverseCumAccuracy);  FDistribution(RandomGenerator rng,
                         double numeratorDegreesOfFreedom,
                         double denominatorDegreesOfFreedom);  FDistribution(RandomGenerator rng,
                         double numeratorDegreesOfFreedom,
                         double denominatorDegreesOfFreedom,
                         double inverseCumAccuracy); double density(double x); @Override double logDensity(double x); double cumulativeProbability(double x); double getNumeratorDegreesOfFreedom(); double getDenominatorDegreesOfFreedom(); double getNumericalMean(); double getNumericalVariance(); double getSupportLowerBound(); double getSupportUpperBound(); boolean isSupportLowerBoundInclusive(); boolean isSupportUpperBoundInclusive(); boolean isSupportConnected(); static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY; }
@Test public void testLargeDegreesOfFreedom() { FDistribution fd = new FDistribution(100000, 100000); double p = fd.cumulativeProbability(.999); double x = fd.inverseCumulativeProbability(p); Assert.assertEquals(.999, x, 1.0e-5); }
@Test public void testSmallDegreesOfFreedom() { FDistribution fd = new FDistribution(1, 1); double p = fd.cumulativeProbability(0.975); double x = fd.inverseCumulativeProbability(p); Assert.assertEquals(0.975, x, 1.0e-5); fd = new FDistribution(1, 2); p = fd.cumulativeProbability(0.975); x = fd.inverseCumulativeProbability(p); Assert.assertEquals(0.975, x, 1.0e-5); }