@Test public void testCdf() { System.out.println("cdf"); ExponentialDistribution instance = new ExponentialDistribution(2.0); instance.rand(); assertEquals(0, instance.cdf(-0.1), 1E-7); assertEquals(0, instance.cdf(0.0), 1E-7); assertEquals(0.8646647, instance.cdf(1.0), 1E-7); assertEquals(0.9816844, instance.cdf(2.0), 1E-7); assertEquals(0.9975212, instance.cdf(3.0), 1E-7); assertEquals(0.9996645, instance.cdf(4.0), 1E-7); assertEquals(0.9999999, instance.cdf(8.0), 1E-7); assertEquals(1.0, instance.cdf(10.0), 1E-7); }
@Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return 1 - Math.exp(-lambda * x); } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return 1 - Math.exp(-lambda * x); } } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return 1 - Math.exp(-lambda * x); } } ExponentialDistribution(double lambda); }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return 1 - Math.exp(-lambda * x); } } ExponentialDistribution(double lambda); static ExponentialDistribution fit(double[] data); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(double x); @Override double logp(double x); @Override double cdf(double x); @Override double quantile(double p); @Override Mixture.Component M(double[] x, double[] posteriori); }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return 1 - Math.exp(-lambda * x); } } ExponentialDistribution(double lambda); static ExponentialDistribution fit(double[] data); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(double x); @Override double logp(double x); @Override double cdf(double x); @Override double quantile(double p); @Override Mixture.Component M(double[] x, double[] posteriori); final double lambda; }