@Test public void testCdf() { System.out.println("cdf"); GammaDistribution instance = new GammaDistribution(3, 2.1); instance.rand(); assertEquals(0.0, instance.cdf(-0.1), 1E-7); assertEquals(0.0, instance.cdf(0.0), 1E-7); assertEquals(0.01264681, instance.cdf(1.0), 1E-7); assertEquals(0.07175418, instance.cdf(2.0), 1E-7); assertEquals(0.1734485, instance.cdf(3.0), 1E-7); assertEquals(0.2975654, instance.cdf(4.0), 1E-7); assertEquals(0.8538087, instance.cdf(10.0), 1E-7); assertEquals(0.995916, instance.cdf(20.0), 1E-7); assertEquals(0.9999267, instance.cdf(30.0), 1E-7); }
@Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(k, x / theta); } }
GammaDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(k, x / theta); } } }
GammaDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(k, x / theta); } } GammaDistribution(double shape, double scale); }
GammaDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(k, x / theta); } } GammaDistribution(double shape, double scale); static GammaDistribution 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); }
GammaDistribution extends AbstractDistribution implements ExponentialFamily { @Override public double cdf(double x) { if (x < 0) { return 0.0; } else { return Gamma.regularizedIncompleteGamma(k, x / theta); } } GammaDistribution(double shape, double scale); static GammaDistribution 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 theta; final double k; }