Class BinomialDistribution
- java.lang.Object
-
- de.uka.ipd.sdq.probfunction.math.apache.impl.AbstractDiscretePDF
-
- de.uka.ipd.sdq.probfunction.math.apache.impl.BinomialDistribution
-
- All Implemented Interfaces:
IBinomialDistribution
,IDiscretePDF
,IProbabilityDensityFunction
,IProbabilityFunction
public class BinomialDistribution extends AbstractDiscretePDF implements IBinomialDistribution
-
-
Field Summary
-
Fields inherited from class de.uka.ipd.sdq.probfunction.math.apache.impl.AbstractDiscretePDF
internalFunction, sampleDrawer
-
-
Constructor Summary
Constructors Constructor Description BinomialDistribution(int trials, double p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getArithmeticMeanValue()
For a probability function, whose domain is integer or real the arithmetic mean - the sum of all measurements divided by the number of observations in the data set - is returned.double
getLowerDomainBorder()
Returns the smallest values of the domain.double
getMean()
Object
getMedian()
A median is a number dividing the higher half of a sample, a population, or a probability distribution from the lower half.Object
getPercentile(int p)
In descriptive statistics, the 'p'th percentile is a scale value for a data series equal to the p/100 quantile.double
getProbability()
Access the probability of success for this distribution.double
getStandardDeviation()
int
getTrials()
Access the number of trials for this distribution.double
getXinf()
Returns xb such that the probability density is 0 everywhere outside the interval [xa, xb],double
getXsup()
Returns xa such that the probability density is 0 everywhere outside the interval [xa, xb]boolean
hasOrderedDomain()
If the domain of the probability functions is ordered, true is returned; false otherwise.-
Methods inherited from class de.uka.ipd.sdq.probfunction.math.apache.impl.AbstractDiscretePDF
add, cdf, cdf, checkConstrains, div, drawSample, getCoefficientOfVariance, getCumulativeFunction, getFourierTransform, getInverseFourierTransform, getProbabilitySum, getUnit, getVariance, greaterThan, inverseF, isInFrequencyDomain, isInTimeDomain, lessThan, mult, probabilisticEquals, probability, scale, shiftDomain, stretchDomain, sub
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uka.ipd.sdq.probfunction.math.IDiscretePDF
cdf, getVariance, inverseF, probability
-
Methods inherited from interface de.uka.ipd.sdq.probfunction.math.IProbabilityDensityFunction
add, div, drawSample, getCumulativeFunction, getFourierTransform, getInverseFourierTransform, greaterThan, lessThan, mult, probabilisticEquals, scale, shiftDomain, stretchDomain, sub
-
Methods inherited from interface de.uka.ipd.sdq.probfunction.math.IProbabilityFunction
checkConstrains, getProbabilitySum, getUnit, isInFrequencyDomain, isInTimeDomain
-
-
-
-
Method Detail
-
getStandardDeviation
public double getStandardDeviation()
- Specified by:
getStandardDeviation
in interfaceIDiscretePDF
-
getXinf
public double getXinf()
Description copied from interface:IDiscretePDF
Returns xb such that the probability density is 0 everywhere outside the interval [xa, xb],- Specified by:
getXinf
in interfaceIDiscretePDF
- Returns:
- lower limit of support
-
getXsup
public double getXsup()
Description copied from interface:IDiscretePDF
Returns xa such that the probability density is 0 everywhere outside the interval [xa, xb]- Specified by:
getXsup
in interfaceIDiscretePDF
- Returns:
- upper limit of support
-
getArithmeticMeanValue
public double getArithmeticMeanValue() throws DomainNotNumbersException, FunctionNotInTimeDomainException
Description copied from interface:IProbabilityFunction
For a probability function, whose domain is integer or real the arithmetic mean - the sum of all measurements divided by the number of observations in the data set - is returned.- Specified by:
getArithmeticMeanValue
in interfaceIProbabilityFunction
- Returns:
- The arithmetic mean.
- Throws:
DomainNotNumbersException
FunctionNotInTimeDomainException
-
getMedian
public Object getMedian() throws UnorderedDomainException
Description copied from interface:IProbabilityFunction
A median is a number dividing the higher half of a sample, a population, or a probability distribution from the lower half. The median of a finite list of numbers can be found by arranging all the observations from lowest value to highest value and picking the middle one.- Specified by:
getMedian
in interfaceIProbabilityFunction
- Returns:
- Object that is the border for the median.
- Throws:
UnorderedDomainException
-
getPercentile
public Object getPercentile(int p) throws IndexOutOfBoundsException, UnorderedDomainException
Description copied from interface:IProbabilityFunction
In descriptive statistics, the 'p'th percentile is a scale value for a data series equal to the p/100 quantile. Thus:
* The 1st percentile cuts off lowest 1% of data
* The 98th percentile cuts off lowest 98% of data
* The 25th percentile is the first quartile
* The 50th percentile is the median.
One definition is that the pth percentile of n ordered values is obtained by first calculating the rank k = p(n+1)/100, rounded to the nearest integer and then taking the value that corresponds to that rank.- Specified by:
getPercentile
in interfaceIProbabilityFunction
- Parameters:
p
- sets the percentile which shall be computed. p must take values between 0 and 100.- Returns:
- Object that is the border for the 'p'th percentile.
- Throws:
IndexOutOfBoundsException
UnorderedDomainException
-
hasOrderedDomain
public boolean hasOrderedDomain()
Description copied from interface:IProbabilityFunction
If the domain of the probability functions is ordered, true is returned; false otherwise.- Specified by:
hasOrderedDomain
in interfaceIProbabilityFunction
- Returns:
- True, if the domain is ordered.
-
getLowerDomainBorder
public double getLowerDomainBorder()
Description copied from interface:IProbabilityDensityFunction
Returns the smallest values of the domain. At the moment this will be zero. However, future implementations might allow arbitrary values here.- Specified by:
getLowerDomainBorder
in interfaceIProbabilityDensityFunction
- Returns:
- Smallest value of the domain.
-
getMean
public double getMean()
- Specified by:
getMean
in interfaceIDiscretePDF
-
getProbability
public double getProbability()
Description copied from interface:IBinomialDistribution
Access the probability of success for this distribution.- Specified by:
getProbability
in interfaceIBinomialDistribution
- Returns:
- the probability of success.
-
getTrials
public int getTrials()
Description copied from interface:IBinomialDistribution
Access the number of trials for this distribution.- Specified by:
getTrials
in interfaceIBinomialDistribution
- Returns:
- the number of trials.
-
-