@Test public void testCdf() { System.out.println("cdf"); NegativeBinomialDistribution instance = new NegativeBinomialDistribution(3, 0.3); instance.rand(); assertEquals(0.027, instance.cdf(0), 1E-7); assertEquals(0.0837, instance.cdf(1), 1E-7); assertEquals(0.16308, instance.cdf(2), 1E-7); assertEquals(0.25569, instance.cdf(3), 1E-7); assertEquals(0.7975217, instance.cdf(10), 1E-7); }
@Override public double cdf(double k) { if (k < 0) { return 0.0; } else { return regularizedIncompleteBetaFunction(r, k + 1, p); } }
NegativeBinomialDistribution extends DiscreteDistribution { @Override public double cdf(double k) { if (k < 0) { return 0.0; } else { return regularizedIncompleteBetaFunction(r, k + 1, p); } } }
NegativeBinomialDistribution extends DiscreteDistribution { @Override public double cdf(double k) { if (k < 0) { return 0.0; } else { return regularizedIncompleteBetaFunction(r, k + 1, p); } } NegativeBinomialDistribution(double r, double p); }
NegativeBinomialDistribution extends DiscreteDistribution { @Override public double cdf(double k) { if (k < 0) { return 0.0; } else { return regularizedIncompleteBetaFunction(r, k + 1, p); } } NegativeBinomialDistribution(double r, double p); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(int k); @Override double logp(int k); @Override double cdf(double k); @Override double quantile(double p); }
NegativeBinomialDistribution extends DiscreteDistribution { @Override public double cdf(double k) { if (k < 0) { return 0.0; } else { return regularizedIncompleteBetaFunction(r, k + 1, p); } } NegativeBinomialDistribution(double r, double p); @Override int length(); @Override double mean(); @Override double variance(); @Override double sd(); @Override double entropy(); @Override String toString(); @Override double rand(); @Override double p(int k); @Override double logp(int k); @Override double cdf(double k); @Override double quantile(double p); final double r; final double p; }