@Test public void testCdf() { Exponential dist = new Exponential(5.0, RandomUtils.getRandom()); for (int i = 0; i < 1000; i++) { double x = i / 50.0; assertEquals(1 - Math.exp(-x * 5.0), dist.cdf(x), 1.0e-9); } }
@Override public double cdf(double x) { if (x <= 0.0) { return 0.0; } return 1.0 - Math.exp(-x * lambda); }
Exponential extends AbstractContinousDistribution { @Override public double cdf(double x) { if (x <= 0.0) { return 0.0; } return 1.0 - Math.exp(-x * lambda); } }
Exponential extends AbstractContinousDistribution { @Override public double cdf(double x) { if (x <= 0.0) { return 0.0; } return 1.0 - Math.exp(-x * lambda); } Exponential(double lambda, Random randomGenerator); }
Exponential extends AbstractContinousDistribution { @Override public double cdf(double x) { if (x <= 0.0) { return 0.0; } return 1.0 - Math.exp(-x * lambda); } Exponential(double lambda, Random randomGenerator); @Override double cdf(double x); @Override double nextDouble(); @Override double pdf(double x); void setState(double lambda); @Override String toString(); }
Exponential extends AbstractContinousDistribution { @Override public double cdf(double x) { if (x <= 0.0) { return 0.0; } return 1.0 - Math.exp(-x * lambda); } Exponential(double lambda, Random randomGenerator); @Override double cdf(double x); @Override double nextDouble(); @Override double pdf(double x); void setState(double lambda); @Override String toString();  }