de.uka.ipd.sdq.probfunction.math
Interface IProbabilityDensityFunction

All Superinterfaces:
IProbabilityFunction
All Known Subinterfaces:
IBoxedPDF, ISamplePDF
All Known Implementing Classes:
BoxedPDFImpl, ProbabilityDensityFunctionImpl, SamplePDFImpl

public interface IProbabilityDensityFunction
extends IProbabilityFunction

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

Author:
ihssane, jens

Method Summary
 IProbabilityDensityFunction add(IProbabilityDensityFunction pdf)
          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).
 IProbabilityDensityFunction div(IProbabilityDensityFunction pdf)
          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 drawSample()
          Generates a random number of the probability function's domain, whose distribution is defined by the probability function.
 IProbabilityDensityFunction getCumulativeFunction()
          returns the cumulative probability function associated with this probability function.
 IProbabilityDensityFunction getFourierTransform()
          Computes the fourier transform of the probability density function.
 IProbabilityDensityFunction getInverseFourierTransform()
          Computes the inverse fourier transform of the probability density function.
 double getLowerDomainBorder()
          Returns the smallest values of the domain.
 double greaterThan(IProbabilityDensityFunction pdf)
          Computes the probability that the random variable specified by this PDF is greater than the random variable specified by pdf.
 double lessThan(IProbabilityDensityFunction pdf)
          Computes the probability that the random variable specified by this PDF is less than the random variable specified by pdf.
 IProbabilityDensityFunction mult(IProbabilityDensityFunction 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 probabilisticEquals(IProbabilityDensityFunction pdf)
          Computes the probability that two random variables characterised by the given PDFs are equal.
 IProbabilityDensityFunction scale(double scalar)
          Scales a ProbabilityDensityFunctions on a "per value" basis:
h(x) = a * f(x)
 IProbabilityDensityFunction shiftDomain(double scalar)
          Shifts the domain values of the PDF by the given scalar
 IProbabilityDensityFunction stretchDomain(double scalar)
          Stretches the domain values of the PDF.
 IProbabilityDensityFunction sub(IProbabilityDensityFunction 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 Detail

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

IProbabilityDensityFunction scale(double scalar)
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

IProbabilityDensityFunction getFourierTransform()
                                                throws FunctionNotInTimeDomainException
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 FunctionNotInFrequencyDomainException
Computes 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

IProbabilityDensityFunction getCumulativeFunction()
                                                  throws FunctionNotInTimeDomainException
returns the cumulative probability function associated with this probability function.

Returns:
the computed cumulative probability function.
Throws:
FunctionNotInTimeDomainException

probabilisticEquals

double probabilisticEquals(IProbabilityDensityFunction pdf)
                           throws ProbabilityFunctionException
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

double greaterThan(IProbabilityDensityFunction pdf)
                   throws ProbabilityFunctionException
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

double lessThan(IProbabilityDensityFunction pdf)
                throws ProbabilityFunctionException
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

IProbabilityDensityFunction stretchDomain(double scalar)
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

IProbabilityDensityFunction shiftDomain(double scalar)
                                        throws DomainNotNumbersException
Shifts the domain values of the PDF by the given scalar

Parameters:
scalar -
Returns:
Throws:
DomainNotNumbersException