@Test public void testMean() { System.out.println("mean"); ExponentialDistribution instance = new ExponentialDistribution(1.0); instance.rand(); assertEquals(1.0, instance.mean(), 1E-7); instance = new ExponentialDistribution(2.0); instance.rand(); assertEquals(0.5, instance.mean(), 1E-7); instance = new ExponentialDistribution(3.0); instance.rand(); assertEquals(0.3333333, instance.mean(), 1E-7); instance = new ExponentialDistribution(4.0); instance.rand(); assertEquals(0.25, instance.mean(), 1E-7); }
@Override public double mean() { return 1 / lambda; }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double mean() { return 1 / lambda; } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double mean() { return 1 / lambda; } ExponentialDistribution(double lambda); }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double mean() { return 1 / lambda; } 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 mean() { return 1 / lambda; } 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; }