Package de.uka.ipd.sdq.probfunction.math
Interface IProbabilityDensityFunction
- All Superinterfaces:
IProbabilityFunction
- All Known Subinterfaces:
IBinomialDistribution
,IBoxedPDF
,IChiSquareDistribution
,IContinousPDF
,IDiscretePDF
,IExponentialDistribution
,IGammaDistribution
,ILognormalDistribution
,INormalDistribution
,IPoissonDistribution
,ISamplePDF
,IStudentTDistribution
,IUniformDistribution
,IUniformIntDistribution
- All Known Implementing Classes:
AbstractContinousPDF
,AbstractDiscretePDF
,BinomialDistribution
,BoxedPDFImpl
,ChiSquareDistribution
,ExponentialDistribution
,GammaDistribution
,GammaDistributionFromMoments
,LognormalDistribution
,LognormalDistributionFromMoments
,NormalDistribution
,PoissonDistribution
,ProbabilityDensityFunctionImpl
,SamplePDFImpl
,StudentTDistribution
,UniformDistribution
,UniformIntDistribution
In mathematics, a probability density function (pdf) serves to represent a probability
distribution in terms of integrals. A probability density function is non-negative everywhere and
its integral from -inf to +inf is equal to 1. If a probability distribution has density f(x),
then intuitively the infinitesimal interval [x, x + dx] has probability f(x) dx. Informally, a
probability density function can be seen as a "smoothed out" version of a histogram: if one
empirically measures values of a continuous random variable repeatedly and produces a histogram
depicting relative frequencies of output ranges, then this histogram will resemble the random
variable's probability density (assuming that the variable is sampled sufficiently often and the
output ranges are sufficiently narrow).
For more information see http://en.wikipedia.org/wiki/Probability_Density_Function
For more information see http://en.wikipedia.org/wiki/Probability_Density_Function
-
Method Summary
Modifier and TypeMethodDescriptionAdds two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) + g(x)
An addition can only be performed if both functions are in the same domain (frequency or time).Divides two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) / g(x)
A division can only be performed if both functions are in the same domain (frequency or time).double
Generates a random number of the probability function's domain, whose distribution is defined by the probability function.returns the cumulative probability function associated with this probability function.Computes the fourier transform of the probability density function.Computes the inverse fourier transform of the probability density function.double
Returns the smallest values of the domain.double
Computes the probability that the random variable specified by this PDF is greater than the random variable specified by pdf.double
Computes the probability that the random variable specified by this PDF is less than the random variable specified by pdf.Multiplies two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) * g(x)
A multiplication can only be performed if both functions are in the same domain (frequency or time).double
Computes the probability that two random variables characterised by the given PDFs are equal.scale
(double scalar) Scales a ProbabilityDensityFunctions on a "per value" basis:
h(x) = a * f(x)shiftDomain
(double scalar) Shifts the domain values of the PDF by the given scalarstretchDomain
(double scalar) Stretches the domain values of the PDF.Subtracts two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) - g(x)
A substraction can only be performed if both functions are in the same domain (frequency or time).Methods inherited from interface de.uka.ipd.sdq.probfunction.math.IProbabilityFunction
checkConstrains, getArithmeticMeanValue, getMedian, getPercentile, getProbabilitySum, getUnit, hasOrderedDomain, isInFrequencyDomain, isInTimeDomain
-
Method Details
-
drawSample
double drawSample()Generates a random number of the probability function's domain, whose distribution is defined by the probability function.- Returns:
- A sample of the PDF's domain.
-
getLowerDomainBorder
double getLowerDomainBorder()Returns the smallest values of the domain. At the moment this will be zero. However, future implementations might allow arbitrary values here.- Returns:
- Smallest value of the domain.
-
add
IProbabilityDensityFunction add(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException, UnknownPDFTypeException, IncompatibleUnitsException Adds two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) + g(x)
An addition can only be performed if both functions are in the same domain (frequency or time). If not a FunctionsInDifferenDomainsException is thrown.- Parameters:
pdf
- g(x), probability density function to add.- Returns:
- The sum of this function (f(x)) and pdf (g(x))
- Throws:
FunctionsInDifferenDomainsException
- Thrown if both functions are in different domains.UnknownPDFTypeException
- Thrown if one of the function is of an unknown type (not SamplePDf or BoxedPDF).IncompatibleUnitsException
- Thrown if both functions have units that do not match.
-
mult
IProbabilityDensityFunction mult(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException, UnknownPDFTypeException, IncompatibleUnitsException Multiplies two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) * g(x)
A multiplication can only be performed if both functions are in the same domain (frequency or time). If not a FunctionsInDifferenDomainsException is thrown.- Parameters:
pdf
- g(x), probability density function to multiply with.- Returns:
- The product of this function (f(x)) and pdf (g(x))
- Throws:
FunctionsInDifferenDomainsException
- Thrown if both functions are in different domains.UnknownPDFTypeException
- Thrown if one of the function is of an unknown type (not SamplePDf or BoxedPDF).IncompatibleUnitsException
- Thrown if both functions have units that do not match.
-
sub
IProbabilityDensityFunction sub(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException, UnknownPDFTypeException, IncompatibleUnitsException Subtracts two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) - g(x)
A substraction can only be performed if both functions are in the same domain (frequency or time). If not a FunctionsInDifferenDomainsException is thrown.- Parameters:
pdf
- g(x), probability density function to substract.- Returns:
- The difference of this function (f(x)) and pdf (g(x))
- Throws:
FunctionsInDifferenDomainsException
- Thrown if both functions are in different domains.UnknownPDFTypeException
- Thrown if one of the function is of an unknown type (not SamplePDf or BoxedPDF).IncompatibleUnitsException
- Thrown if both functions have units that do not match.
-
div
IProbabilityDensityFunction div(IProbabilityDensityFunction pdf) throws FunctionsInDifferenDomainsException, UnknownPDFTypeException, IncompatibleUnitsException Divides two ProbabilityDensityFunctions on a "per value" basis:
h(x) = f(x) / g(x)
A division can only be performed if both functions are in the same domain (frequency or time). If not a FunctionsInDifferenDomainsException is thrown.- Parameters:
pdf
- g(x), probability density function to divide by.- Returns:
- The fraction of this function (f(x)) and pdf (g(x))
- Throws:
FunctionsInDifferenDomainsException
IncompatibleUnitsException
UnknownPDFTypeException
-
scale
Scales a ProbabilityDensityFunctions on a "per value" basis:
h(x) = a * f(x)- Parameters:
scalar
- a, value to scale with.- Returns:
- The scaled function a*f(x)
-
getFourierTransform
Computes the fourier transform of the probability density function. Can only be applied if 'isInTimeDomain()' is true, otherwise a FunctionNotInTimeDomain exception is thrown.- Returns:
- fourier transform of the PDF (in frequency domain)
- Throws:
FunctionNotInTimeDomainException
-
getInverseFourierTransform
IProbabilityDensityFunction getInverseFourierTransform() throws FunctionNotInFrequencyDomainExceptionComputes the inverse fourier transform of the probability density function. Can only be applied if 'isInFrequencyDomain()' is true, otherwise a FunctionNotInFrequencyDomainException is thrown.- Returns:
- inverse fourier transform of the PDF (in time domain)
- Throws:
FunctionNotInFrequencyDomainException
-
getCumulativeFunction
returns the cumulative probability function associated with this probability function.- Returns:
- the computed cumulative probability function.
- Throws:
FunctionNotInTimeDomainException
-
probabilisticEquals
Computes the probability that two random variables characterised by the given PDFs are equal. Note that the randomvariables have to be independent.- Parameters:
pdf
- PDF to compare to.- Returns:
- Probability that the two random variables characterised by the PDFs are equal.
- Throws:
ProbabilityFunctionException
-
greaterThan
Computes the probability that the random variable specified by this PDF is greater than the random variable specified by pdf. Note that the randomvariables have to be independent.- Parameters:
pdf
- PDF to compare to.- Returns:
- Probability X_this > X_pdf
- Throws:
ProbabilityFunctionException
-
lessThan
Computes the probability that the random variable specified by this PDF is less than the random variable specified by pdf. Note that the randomvariables have to be independent.- Parameters:
pdf
- PDF to compare to.- Returns:
- Probability X_this < X_pdf
- Throws:
ProbabilityFunctionException
-
stretchDomain
Stretches the domain values of the PDF. This is equivalent to the multiplication of the specified random variable by the given scalar.- Parameters:
scalar
-- Returns:
-
shiftDomain
Shifts the domain values of the PDF by the given scalar- Parameters:
scalar
-- Returns:
- Throws:
DomainNotNumbersException
-