@Test public void testExponentialDistribution() { System.out.println("ExponentialDistribution"); MathEx.setSeed(19650218); ExponentialDistribution instance = new ExponentialDistribution(3); double[] data = instance.rand(1000); ExponentialDistribution est = ExponentialDistribution.fit(data); assertEquals(3.08, est.lambda, 1E-2); }
public ExponentialDistribution(double lambda) { if (lambda <= 0) { throw new IllegalArgumentException("Invalid lambda: " + lambda); } this.lambda = lambda; }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { public ExponentialDistribution(double lambda) { if (lambda <= 0) { throw new IllegalArgumentException("Invalid lambda: " + lambda); } this.lambda = lambda; } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { public ExponentialDistribution(double lambda) { if (lambda <= 0) { throw new IllegalArgumentException("Invalid lambda: " + lambda); } this.lambda = lambda; } ExponentialDistribution(double lambda); }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { public ExponentialDistribution(double lambda) { if (lambda <= 0) { throw new IllegalArgumentException("Invalid lambda: " + lambda); } this.lambda = 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 { public ExponentialDistribution(double lambda) { if (lambda <= 0) { throw new IllegalArgumentException("Invalid lambda: " + lambda); } this.lambda = 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; }