Class UniformIntDistribution
- java.lang.Object
-
- de.uka.ipd.sdq.probfunction.math.apache.impl.AbstractDiscretePDF
-
- de.uka.ipd.sdq.probfunction.math.apache.impl.UniformIntDistribution
-
- All Implemented Interfaces:
IDiscretePDF,IProbabilityDensityFunction,IProbabilityFunction,IUniformIntDistribution
public class UniformIntDistribution extends AbstractDiscretePDF implements IUniformIntDistribution
-
-
Field Summary
-
Fields inherited from class de.uka.ipd.sdq.probfunction.math.apache.impl.AbstractDiscretePDF
internalFunction, sampleDrawer
-
-
Constructor Summary
Constructors Constructor Description UniformIntDistribution(int a, int b)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetA()doublegetArithmeticMeanValue()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.intgetB()doublegetLowerDomainBorder()Returns the smallest values of the domain.doublegetMean()ObjectgetMedian()A median is a number dividing the higher half of a sample, a population, or a probability distribution from the lower half.ObjectgetPercentile(int p)In descriptive statistics, the 'p'th percentile is a scale value for a data series equal to the p/100 quantile.doublegetStandardDeviation()doublegetXinf()Returns xb such that the probability density is 0 everywhere outside the interval [xa, xb],doublegetXsup()Returns xa such that the probability density is 0 everywhere outside the interval [xa, xb]booleanhasOrderedDomain()If the domain of the probability functions is ordered, true is returned; false otherwise.intinverseF(double u)Computes and returns the inverse distribution function x = F^{-1}(u).-
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, 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, 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
-
inverseF
public int inverseF(double u)
Description copied from class:AbstractDiscretePDFComputes and returns the inverse distribution function x = F^{-1}(u). This can be used to get the quantiles of the distribution. Pass 0.9 to get the x value of this function for which this.cdf(x) = 0.9 holds. Uses the implementation of the concrete function in theumontreal.iro.lecuyer.probdistpackage.- Specified by:
inverseFin interfaceIDiscretePDF- Overrides:
inverseFin classAbstractDiscretePDF- Parameters:
u- - value in the interval [0, 1] for which the inverse distribution function is evaluated- Returns:
- the inverse distribution function evaluated at u
-
getStandardDeviation
public double getStandardDeviation()
- Specified by:
getStandardDeviationin interfaceIDiscretePDF
-
getXinf
public double getXinf()
Description copied from interface:IDiscretePDFReturns xb such that the probability density is 0 everywhere outside the interval [xa, xb],- Specified by:
getXinfin interfaceIDiscretePDF- Returns:
- lower limit of support
-
getXsup
public double getXsup()
Description copied from interface:IDiscretePDFReturns xa such that the probability density is 0 everywhere outside the interval [xa, xb]- Specified by:
getXsupin interfaceIDiscretePDF- Returns:
- upper limit of support
-
getArithmeticMeanValue
public double getArithmeticMeanValue() throws DomainNotNumbersException, FunctionNotInTimeDomainExceptionDescription copied from interface:IProbabilityFunctionFor 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:
getArithmeticMeanValuein interfaceIProbabilityFunction- Returns:
- The arithmetic mean.
- Throws:
DomainNotNumbersExceptionFunctionNotInTimeDomainException
-
getMedian
public Object getMedian() throws UnorderedDomainException
Description copied from interface:IProbabilityFunctionA 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:
getMedianin 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:IProbabilityFunctionIn 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:
getPercentilein 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:
IndexOutOfBoundsExceptionUnorderedDomainException
-
hasOrderedDomain
public boolean hasOrderedDomain()
Description copied from interface:IProbabilityFunctionIf the domain of the probability functions is ordered, true is returned; false otherwise.- Specified by:
hasOrderedDomainin interfaceIProbabilityFunction- Returns:
- True, if the domain is ordered.
-
getLowerDomainBorder
public double getLowerDomainBorder()
Description copied from interface:IProbabilityDensityFunctionReturns the smallest values of the domain. At the moment this will be zero. However, future implementations might allow arbitrary values here.- Specified by:
getLowerDomainBorderin interfaceIProbabilityDensityFunction- Returns:
- Smallest value of the domain.
-
getMean
public double getMean()
- Specified by:
getMeanin interfaceIDiscretePDF
-
getA
public int getA()
- Specified by:
getAin interfaceIUniformIntDistribution
-
getB
public int getB()
- Specified by:
getBin interfaceIUniformIntDistribution
-
-