org.jquantlib.math.distributions
Class BinomialDistribution
- java.lang.Object
-
- org.jquantlib.math.distributions.BinomialDistribution
-
- All Implemented Interfaces:
- Ops.IntToDouble
public class BinomialDistribution extends java.lang.Object implements Ops.IntToDouble
Binomial DistributionIn probability theory and statistics, the binomial distribution is the discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability p. Such a success/failure experiment is also called a Bernoulli experiment or Bernoulli trial. In fact, when n = 1, the binomial distribution is a Bernoulli distribution.
The binomial distribution is the basis for the popular binomial test of statistical significance. A binomial distribution should not be confused with a bimodal distribution.
- See Also:
- Binomial Distribution
-
-
Constructor Summary
Constructors Constructor and Description BinomialDistribution(double p, int n)Constructor of the Binomial Distribution taking two arguments for initialization.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleop(int k)Computes the probability ofksuccessful trials.static doublePeizerPrattMethod2Inversion(double z, long n)Given an odd integer n and a real number z it returns p such that:
-
-
-
Constructor Detail
-
BinomialDistribution
public BinomialDistribution(double p, int n)Constructor of the Binomial Distribution taking two arguments for initialization.- Parameters:
p- Probability of success of each trialn- Sequence of independent yes/no experiments
-
-
Method Detail
-
op
public double op(int k)
Computes the probability ofksuccessful trials.- Specified by:
opin interfaceOps.IntToDouble- Parameters:
k- Number of successful trials- Returns:
- Math.exp(binomialCoefficientLn(nExp, k) + k * logP + (nExp-k) * logOneMinusP);
-
PeizerPrattMethod2Inversion
public static double PeizerPrattMethod2Inversion(double z, long n)Given an odd integer n and a real number z it returns p such that:1 - CumulativeBinomialDistribution((n-1)/2, n, p) = CumulativeNormalDistribution(z)
Pre-condition: n must be odd
-
-
DataMelt 3.0 © DataMelt by jWork.ORG