@Test public void testP() { System.out.println("p"); LogisticDistribution instance = new LogisticDistribution(2.0, 1.0); instance.rand(); assertEquals(0.1050736, instance.p(0.001), 1E-7); assertEquals(0.1057951, instance.p(0.01), 1E-7); assertEquals(0.1131803, instance.p(0.1), 1E-7); assertEquals(0.1217293, instance.p(0.2), 1E-7); assertEquals(0.1491465, instance.p(0.5), 1E-7); assertEquals(0.1966119, instance.p(1.0), 1E-7); assertEquals(0.25, instance.p(2.0), 1E-7); assertEquals(0.04517666, instance.p(5.0), 1E-7); assertEquals(0.0003352377, instance.p(10.0), 1E-7); }
@Override public double p(double x) { double e = Math.exp(-(x - mu) / scale); return e / (scale * (1.0 + e) * (1.0 + e)); }
LogisticDistribution extends AbstractDistribution { @Override public double p(double x) { double e = Math.exp(-(x - mu) / scale); return e / (scale * (1.0 + e) * (1.0 + e)); } }
LogisticDistribution extends AbstractDistribution { @Override public double p(double x) { double e = Math.exp(-(x - mu) / scale); return e / (scale * (1.0 + e) * (1.0 + e)); } LogisticDistribution(double mu, double scale); }
LogisticDistribution extends AbstractDistribution { @Override public double p(double x) { double e = Math.exp(-(x - mu) / scale); return e / (scale * (1.0 + e) * (1.0 + e)); } LogisticDistribution(double mu, double scale); @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); }
LogisticDistribution extends AbstractDistribution { @Override public double p(double x) { double e = Math.exp(-(x - mu) / scale); return e / (scale * (1.0 + e) * (1.0 + e)); } LogisticDistribution(double mu, double scale); @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); final double mu; final double scale; }