com.datumbox.framework.core.statistics.distributions
Class DiscreteDistributions
- java.lang.Object
-
- com.datumbox.framework.core.statistics.distributions.DiscreteDistributions
-
public class DiscreteDistributions extends java.lang.ObjectThis class provides methods for the CDFs and PDFs of the most common discrete distributions.
-
-
Constructor Summary
Constructors Constructor and Description DiscreteDistributions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublebernoulli(boolean k, double p)Returns the probability of k and pstatic doublebernoulliCdf(int k, double p)Returns the cumulative probability under bernoullistatic doublebinomial(int k, double p, int n)Returns the probability of k of a specific number of tries n and probability pstatic doublebinomialCdf(int k, double p, int n)Returns the cumulative probability of k of a specific number of tries n and probability pstatic doublegeometric(int k, double p)Returns the probability that the first success requires k trials with probability of success pstatic doublegeometricCdf(int k, double p)Returns the cumulative probability of geometricstatic doublehypergeometric(int k, int n, int Kp, int Np)Returns the probability of finding k successes on a sample of n, from a population with Kp successes and size Npstatic doublehypergeometricCdf(int k, int n, int Kp, int Np)Returns the cumulative probability of hypergeometricstatic doublenegativeBinomial(int n, int r, double p)Returns the probability of requiring n tries to achieve r successes with probability of success pstatic doublenegativeBinomialCdf(int n, int r, double p)Returns the cumulative probability of negativeBinomialstatic doublepoisson(int k, double lamda)Returns the probability of k occurrences when rate is lamdastatic doublepoissonCdf(int k, double lamda)Returns the cumulative probability of poissonstatic doubleuniform(int n)Returns the probability of uniform discrete distribution with parameter nstatic doubleuniformCdf(int k, int n)Returns the cumulative probability of uniform
-
-
-
Method Detail
-
bernoulli
public static double bernoulli(boolean k, double p)Returns the probability of k and p- Parameters:
k-p-- Returns:
-
bernoulliCdf
public static double bernoulliCdf(int k, double p)Returns the cumulative probability under bernoulli- Parameters:
k-p-- Returns:
-
binomial
public static double binomial(int k, double p, int n)Returns the probability of k of a specific number of tries n and probability p- Parameters:
k-p-n-- Returns:
-
binomialCdf
public static double binomialCdf(int k, double p, int n)Returns the cumulative probability of k of a specific number of tries n and probability p- Parameters:
k-p-n-- Returns:
-
geometric
public static double geometric(int k, double p)Returns the probability that the first success requires k trials with probability of success p- Parameters:
k-p-- Returns:
-
geometricCdf
public static double geometricCdf(int k, double p)Returns the cumulative probability of geometric- Parameters:
k-p-- Returns:
-
negativeBinomial
public static double negativeBinomial(int n, int r, double p)Returns the probability of requiring n tries to achieve r successes with probability of success p- Parameters:
n-r-p-- Returns:
-
negativeBinomialCdf
public static double negativeBinomialCdf(int n, int r, double p)Returns the cumulative probability of negativeBinomial- Parameters:
n-r-p-- Returns:
-
uniform
public static double uniform(int n)
Returns the probability of uniform discrete distribution with parameter n- Parameters:
n-- Returns:
-
uniformCdf
public static double uniformCdf(int k, int n)Returns the cumulative probability of uniform- Parameters:
k-n-- Returns:
-
hypergeometric
public static double hypergeometric(int k, int n, int Kp, int Np)Returns the probability of finding k successes on a sample of n, from a population with Kp successes and size Np- Parameters:
k-n-Kp-Np-- Returns:
-
hypergeometricCdf
public static double hypergeometricCdf(int k, int n, int Kp, int Np)Returns the cumulative probability of hypergeometric- Parameters:
k-n-Kp-Np-- Returns:
-
poisson
public static double poisson(int k, double lamda)Returns the probability of k occurrences when rate is lamda- Parameters:
k-lamda-- Returns:
-
poissonCdf
public static double poissonCdf(int k, double lamda)Returns the cumulative probability of poisson- Parameters:
k-lamda-- Returns:
-
-
DataMelt 3.0 © DataMelt by jWork.ORG