@Test public void testQuantile() { System.out.println("quantile"); ExponentialDistribution instance = new ExponentialDistribution(2.0); instance.rand(); assertEquals(0.05268026, instance.quantile(0.1), 1E-7); assertEquals(0.1783375, instance.quantile(0.3), 1E-7); assertEquals(0.3465736, instance.quantile(0.5), 1E-7); assertEquals(0.6019864, instance.quantile(0.7), 1E-7); }
@Override public double quantile(double p) { if (p < 0.0 || p > 1.0) { throw new IllegalArgumentException("Invalid p: " + p); } return -Math.log(1 - p) / lambda; }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double quantile(double p) { if (p < 0.0 || p > 1.0) { throw new IllegalArgumentException("Invalid p: " + p); } return -Math.log(1 - p) / lambda; } }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double quantile(double p) { if (p < 0.0 || p > 1.0) { throw new IllegalArgumentException("Invalid p: " + p); } return -Math.log(1 - p) / lambda; } ExponentialDistribution(double lambda); }
ExponentialDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double quantile(double p) { if (p < 0.0 || p > 1.0) { throw new IllegalArgumentException("Invalid p: " + p); } return -Math.log(1 - p) / 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 quantile(double p) { if (p < 0.0 || p > 1.0) { throw new IllegalArgumentException("Invalid p: " + p); } return -Math.log(1 - p) / 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; }