@Test public void testBinomialCdf() { logger.info("BinomialCdf"); int k = 3; double p = 0.5; int n = 10; double expResult = 0.17187500002003; double result = DiscreteDistributions.binomialCdf(k, p, n); assertEquals(expResult, result, Constants.DOUBLE_ACCURACY_HIGH); }
public static double binomialCdf(int k, double p, int n) { if(k<0 || p<0 || n<1) { throw new IllegalArgumentException("All the parameters must be positive and n larger than 1."); } k = Math.min(k, n); double probabilitySum = approxBinomialCdf(k,p,n); return probabilitySum; }
DiscreteDistributions { public static double binomialCdf(int k, double p, int n) { if(k<0 || p<0 || n<1) { throw new IllegalArgumentException("All the parameters must be positive and n larger than 1."); } k = Math.min(k, n); double probabilitySum = approxBinomialCdf(k,p,n); return probabilitySum; } }
DiscreteDistributions { public static double binomialCdf(int k, double p, int n) { if(k<0 || p<0 || n<1) { throw new IllegalArgumentException("All the parameters must be positive and n larger than 1."); } k = Math.min(k, n); double probabilitySum = approxBinomialCdf(k,p,n); return probabilitySum; }  }
DiscreteDistributions { public static double binomialCdf(int k, double p, int n) { if(k<0 || p<0 || n<1) { throw new IllegalArgumentException("All the parameters must be positive and n larger than 1."); } k = Math.min(k, n); double probabilitySum = approxBinomialCdf(k,p,n); return probabilitySum; }  static double bernoulli(boolean k, double p); static double bernoulliCdf(int k, double p); static double binomial(int k, double p, int n); static double binomialCdf(int k, double p, int n); static double geometric(int k, double p); static double geometricCdf(int k, double p); static double negativeBinomial(int n, int r, double p); static double negativeBinomialCdf(int n, int r, double p); static double uniform(int n); static double uniformCdf(int k, int n); static double hypergeometric(int k, int n, int Kp, int Np); static double hypergeometricCdf(int k, int n, int Kp, int Np); static double poisson(int k, double lamda); static double poissonCdf(int k, double lamda); }
DiscreteDistributions { public static double binomialCdf(int k, double p, int n) { if(k<0 || p<0 || n<1) { throw new IllegalArgumentException("All the parameters must be positive and n larger than 1."); } k = Math.min(k, n); double probabilitySum = approxBinomialCdf(k,p,n); return probabilitySum; }  static double bernoulli(boolean k, double p); static double bernoulliCdf(int k, double p); static double binomial(int k, double p, int n); static double binomialCdf(int k, double p, int n); static double geometric(int k, double p); static double geometricCdf(int k, double p); static double negativeBinomial(int n, int r, double p); static double negativeBinomialCdf(int n, int r, double p); static double uniform(int n); static double uniformCdf(int k, int n); static double hypergeometric(int k, int n, int Kp, int Np); static double hypergeometricCdf(int k, int n, int Kp, int Np); static double poisson(int k, double lamda); static double poissonCdf(int k, double lamda);  }