@Test public void testCdf() { System.out.println("cdf"); LogisticDistribution instance = new LogisticDistribution(2.0, 1.0); instance.rand(); assertEquals(0.1193080, instance.cdf(0.001), 1E-7); assertEquals(0.1202569, instance.cdf(0.01), 1E-7); assertEquals(0.1301085, instance.cdf(0.1), 1E-7); assertEquals(0.1418511, instance.cdf(0.2), 1E-7); assertEquals(0.1824255, instance.cdf(0.5), 1E-7); assertEquals(0.2689414, instance.cdf(1.0), 1E-7); assertEquals(0.5 , instance.cdf(2.0), 1E-7); assertEquals(0.9525741, instance.cdf(5.0), 1E-7); assertEquals(0.9996646, instance.cdf(10.0), 1E-7); }
@Override public double cdf(double x) { double e = Math.exp(-(x - mu) / scale); return 1.0 / (1.0 + e); }
LogisticDistribution extends AbstractDistribution { @Override public double cdf(double x) { double e = Math.exp(-(x - mu) / scale); return 1.0 / (1.0 + e); } }
LogisticDistribution extends AbstractDistribution { @Override public double cdf(double x) { double e = Math.exp(-(x - mu) / scale); return 1.0 / (1.0 + e); } LogisticDistribution(double mu, double scale); }
LogisticDistribution extends AbstractDistribution { @Override public double cdf(double x) { double e = Math.exp(-(x - mu) / scale); return 1.0 / (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 cdf(double x) { double e = Math.exp(-(x - mu) / scale); return 1.0 / (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; }