java.lang.Object
org.bzdev.math.stats.ProbDistribution
- All Implemented Interfaces:
RealValuedDomainOps
- Direct Known Subclasses:
ChiSquareDistr,FDistr,GaussianDistr,KDistr,StudentsTDistr
Class representing probability distributions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleA(double x) Get the probability that a value is within the range [-x, x].cdf()Get the cumulative distribution function.cdfc()Get the complement of the cumulative distribution function.booleanDetermine if the domain maximum is in the domain.booleanDetermine if the domain minimum is in the domain.doubleGet the maximum value in the domain of the function.doubleGet the minimum value in the domain of the function.doubleinverseA(double x) Get the inverse for the methodA(double).doubleinverseP(double x) Get the inverse for the methodP(double).doubleinverseQ(double x) Get the inverse for the methodQ(double).booleanisInDomain(double x) Determine if an argument is within the domain of the functions providing a probability density or cumulative probability.abstract booleanisSymmetric(double x) Determine if this distribution is symmetric about x.abstract doubleP(double x) Get the probability that a value is no larger than the argumentdoublepd(double x) Get the probability densitydoubleQ(double x) Get the probability that a value is no smaller than the argument
-
Constructor Details
-
ProbDistribution
public ProbDistribution()
-
-
Method Details
-
isSymmetric
public abstract boolean isSymmetric(double x) Determine if this distribution is symmetric about x. A distribution is symmetric if its probability density f satisfies f(x+y) = f(x-y) and that if x+y is in f's domain, so is x-y. Equivalently, it must satisfy Q(x+y) = P(x-y).- Parameters:
x- the point about which to test if this distribution is symmaetric- Returns:
- true if it is symmetric; false otherwise.
-
cdf
Get the cumulative distribution function.- Returns:
- the cumulative distribution function
-
cdfc
Get the complement of the cumulative distribution function.- Returns:
- the complement of the cumulative distribution function
-
pd
Get the probability density- Parameters:
x- the value for which the density is to be computed- Returns:
- the probability density
- Throws:
UnsupportedOperationException- this instance does not support this operationIllegalArgumentException- the argument was out of range
-
P
Get the probability that a value is no larger than the argument- Parameters:
x- the argument- Returns:
- the probability
- Throws:
IllegalArgumentException- the argument was out of range
-
Q
Get the probability that a value is no smaller than the argument- Parameters:
x- the argument- Returns:
- the probability
- Throws:
IllegalArgumentException
-
A
Get the probability that a value is within the range [-x, x]. This method is meaningful for distributions that are symmetric about 0. When this is not the case, an UnsupportedOperationException should be thrown.- Parameters:
x- the argument- Returns:
- the probability that a value is in the range [-x, x]
- Throws:
UnsupportedOperationException- this operation is not supportedIllegalArgumentException- the argument was out of range
-
inverseP
Get the inverse for the methodP(double).- Parameters:
x- an argument in the range [0.0, 1.0]- Returns:
- a value y such that x = P(y)
- Throws:
MathException- an error occurred while computing the inverseIllegalArgumentException- the argument was out of range
-
inverseQ
public double inverseQ(double x) Get the inverse for the methodQ(double).- Parameters:
x- an argument in the range [0.0, 1.0]- Returns:
- a value y such that x = Q(y)
- Throws:
MathException- an error occurred while computing the inverseIllegalArgumentException- the argument was out of range
-
inverseA
public double inverseA(double x) Get the inverse for the methodA(double).- Parameters:
x- the argument- Returns:
- a value y such that x = A(y)
- Throws:
MathException- an error occurred while computing the inverseIllegalArgumentException- the argument was out of rangeUnsupportedOperationException- the operation was not supported
-
getDomainMax
public double getDomainMax()Description copied from interface:RealValuedDomainOpsGet the maximum value in the domain of the function.- Specified by:
getDomainMaxin interfaceRealValuedDomainOps- Returns:
- the maximum value
-
domainMaxClosed
public boolean domainMaxClosed()Description copied from interface:RealValuedDomainOpsDetermine if the domain maximum is in the domain.- Specified by:
domainMaxClosedin interfaceRealValuedDomainOps- Returns:
- true if the domain maximum is in the domain; false if it is the least upper bound for the domain
-
getDomainMin
public double getDomainMin()Description copied from interface:RealValuedDomainOpsGet the minimum value in the domain of the function.- Specified by:
getDomainMinin interfaceRealValuedDomainOps- Returns:
- the minimum value
-
domainMinClosed
public boolean domainMinClosed()Description copied from interface:RealValuedDomainOpsDetermine if the domain minimum is in the domain.- Specified by:
domainMinClosedin interfaceRealValuedDomainOps- Returns:
- true if the domain minimum is in the domain; false if it is the greatest lower bound for the domain
-
isInDomain
Determine if an argument is within the domain of the functions providing a probability density or cumulative probability.The default behavior of this method assumes the domain is an interval and uses the methods
getDomainMin(),getDomainMin(),domainMinClosed(), anddomainMinClosed()to determine if the argument represents a point in the functions domain. If the domain is not an interval with each end either open or closed, then this method must be overridden. If it is not possible with a reasonable amount of computation to determine that the argument is in the domain, an UnsupportedOperationException may be thrown. If this exception is thrown, it should be thrown regardless of the argument.- Specified by:
isInDomainin interfaceRealValuedDomainOps- Parameters:
x- a value to test- Returns:
- true if x is in this function's domain; false otherwise
- Throws:
UnsupportedOperationException- domain membership could not be determined.
-