Class BinomialDistribution
java.lang.Object
com.compomics.util.math.statistics.distributions.BinomialDistribution
- All Implemented Interfaces:
Distribution
Implementation of a binomial distribution.
- Author:
- Marc Vaudel
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructorBinomialDistribution(int n, double p) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetCumulativeProbabilityAt(double x) Returns the cumulative density function value at a given position.doublegetDescendingCumulativeProbabilityAt(double x) Returns the cumulative density function value at a given position when starting from the high values.doublegetMaxValueForProbability(double p) The value after which the density function will be smaller than p.doublegetMinValueForProbability(double p) The value before which the density function will be smaller than p.doublegetProbabilityAt(double x) Returns the density function value at a given position.doublegetSmallestCumulativeProbabilityAt(double x) Returns the cumulative density function value at a given position, starting from the low values if before the median, from the high otherwise.doublegetValueAtCumulativeProbability(double p) The value after which the cumulative density function will be smaller than p.doubleThe value after which the cumulative density function will be smaller than p when starting from high values.booleanIndicates whether all caches are empty.
-
Constructor Details
-
BinomialDistribution
public BinomialDistribution()Empty default constructor -
BinomialDistribution
public BinomialDistribution(int n, double p) Constructor.- Parameters:
n- the number of trialsp- the probability of success of each trial
-
-
Method Details
-
getProbabilityAt
public double getProbabilityAt(double x) Description copied from interface:DistributionReturns the density function value at a given position.- Specified by:
getProbabilityAtin interfaceDistribution- Parameters:
x- the position of interest- Returns:
- the value of the density function at the give position
-
getCumulativeProbabilityAt
public double getCumulativeProbabilityAt(double x) Description copied from interface:DistributionReturns the cumulative density function value at a given position.- Specified by:
getCumulativeProbabilityAtin interfaceDistribution- Parameters:
x- the position of interest- Returns:
- the value of the density function at the give position
-
getDescendingCumulativeProbabilityAt
public double getDescendingCumulativeProbabilityAt(double x) Description copied from interface:DistributionReturns the cumulative density function value at a given position when starting from the high values.- Specified by:
getDescendingCumulativeProbabilityAtin interfaceDistribution- Parameters:
x- the position of interest- Returns:
- the value of the density function at the give position
-
isCacheEmpty
public boolean isCacheEmpty()Indicates whether all caches are empty.- Returns:
- a boolean indicating whether all caches are empty
-
getSmallestCumulativeProbabilityAt
public double getSmallestCumulativeProbabilityAt(double x) Description copied from interface:DistributionReturns the cumulative density function value at a given position, starting from the low values if before the median, from the high otherwise.- Specified by:
getSmallestCumulativeProbabilityAtin interfaceDistribution- Parameters:
x- the position of interest- Returns:
- the value of the density function at the give position
-
getMaxValueForProbability
public double getMaxValueForProbability(double p) Description copied from interface:DistributionThe value after which the density function will be smaller than p.- Specified by:
getMaxValueForProbabilityin interfaceDistribution- Parameters:
p- the probability of interest- Returns:
- the value after which the density function will be smaller than p
-
getMinValueForProbability
public double getMinValueForProbability(double p) Description copied from interface:DistributionThe value before which the density function will be smaller than p.- Specified by:
getMinValueForProbabilityin interfaceDistribution- Parameters:
p- the probability of interest- Returns:
- the value before which the density function will be smaller than p
-
getValueAtCumulativeProbability
public double getValueAtCumulativeProbability(double p) Description copied from interface:DistributionThe value after which the cumulative density function will be smaller than p.- Specified by:
getValueAtCumulativeProbabilityin interfaceDistribution- Parameters:
p- the probability of interest- Returns:
- the value after which the cumulative density function will be smaller than p
-
getValueAtDescendingCumulativeProbability
public double getValueAtDescendingCumulativeProbability(double p) Description copied from interface:DistributionThe value after which the cumulative density function will be smaller than p when starting from high values.- Specified by:
getValueAtDescendingCumulativeProbabilityin interfaceDistribution- Parameters:
p- the probability of interest- Returns:
- the value after which the cumulative density function will be smaller than p
-