@Test public void testP() { System.out.println("p"); ExponentialDistribution instance = new ExponentialDistribution(2.0); instance.rand(); assertEquals(0, instance.p(-0.1), 1E-7); assertEquals(2.0, instance.p(0.0), 1E-7); assertEquals(0.2706706, instance.p(1.0), 1E-7); assertEquals(0.03663128, instance.p(2.0), 1E-7); assertEquals(0.004957504, instance.p(3.0), 1E-7); assertEquals(0.0006709253, instance.p(4.0), 1E-7); }
@Override public double p(double x) { if (x < 0) { return 0.0; } else { return lambda * Math.exp(-lambda * x); } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double p(double x) { if (x < 0) { return 0.0; } else { return lambda * Math.exp(-lambda * x); } } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double p(double x) { if (x < 0) { return 0.0; } else { return lambda * Math.exp(-lambda * x); } } ExponentialDistribution(double lambda); }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double p(double x) { if (x < 0) { return 0.0; } else { return lambda * 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 p(double x) { if (x < 0) { return 0.0; } else { return lambda * 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; }