ParetoDistribution extends AbstractRealDistribution { public double cumulativeProbability(double x) { if (x <= scale) { return 0; } return 1 - FastMath.pow(scale / x, shape); } ParetoDistribution();  ParetoDistribution(double scale, double shape);  ParetoDistribution(double scale, double shape, double inverseCumAccuracy);  ParetoDistribution(RandomGenerator rng, double scale, double shape);  ParetoDistribution(RandomGenerator rng,
                              double scale,
                              double shape,
                              double inverseCumAccuracy); double getScale(); double getShape(); double density(double x); @Override double logDensity(double x); double cumulativeProbability(double x); @Override @Deprecated double cumulativeProbability(double x0, double x1); double getNumericalMean(); double getNumericalVariance(); double getSupportLowerBound(); double getSupportUpperBound(); boolean isSupportLowerBoundInclusive(); boolean isSupportUpperBoundInclusive(); boolean isSupportConnected(); @Override double sample(); static final double DEFAULT_INVERSE_ABSOLUTE_ACCURACY; }
@Test public void testExtremeValues() { ParetoDistribution d = new ParetoDistribution(1, 1); for (int i = 0; i < 1e5; i++) { double upperTail = d.cumulativeProbability(i); if (i <= 1000) { Assert.assertTrue(upperTail < 1.0d); } else { Assert.assertTrue(upperTail > 0.999); } } Assert.assertEquals(d.cumulativeProbability(Double.MAX_VALUE), 1, 0); Assert.assertEquals(d.cumulativeProbability(-Double.MAX_VALUE), 0, 0); Assert.assertEquals(d.cumulativeProbability(Double.POSITIVE_INFINITY), 1, 0); Assert.assertEquals(d.cumulativeProbability(Double.NEGATIVE_INFINITY), 0, 0); }