java.lang.Object
org.bzdev.math.stats.ProbDistribution
org.bzdev.math.stats.FDistr
- All Implemented Interfaces:
RealValuedDomainOps
Class providing methods for the F-distribution.
An F-distribution is the distribution of the random variable
(X1/ν1) / (X2/ν2),
where X1 and X2 are independent random variables
with a χ2 distribution with ν1 and
ν2 degrees of freedom respectively.
For noncentral F-distributions, the random variable X1 defined above has a noncentral χ2 distribution with a noncentrality parameter λ.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine if the domain minimum is in the domain.longGet the number of degrees of freedom (parameter 1).longGet the number of degrees of freedom (parameter 2).doubleGet the minimum value in the domain of the function.doubleGet the noncentrality parameter.booleanDetermine if this object is a noncentral χ2 distribution.booleanisSymmetric(double x) Determine if this distribution is symmetric about x.doubleP(double x) Get the probability that a value is no larger than the argumentstatic doubleP(double f, long nu1, long nu2) Get the cumulative probability for an F-distribution.static doubleP(double f, long nu1, long nu2, double lambda) Get the cumulative probability distribution for a noncentral F-distribution.doublepd(double x) Get the probability densitystatic doublepd(double f, long nu1, long nu2) Get the probability density for an F-distribution.static doublepd(double f, long nu1, long nu2, double lambda) Get the probability density for a noncentral F-distribution.doubleQ(double x) Get the probability that a value is no smaller than the argumentstatic doubleQ(double f, long nu1, long nu2) Get the complement of the cumulative probability for an F-distribution.static doubleQ(double f, long nu1, long nu2, double lambda) Get the complement of the cumulative probability distribution for a noncentral f distribution.Methods inherited from class org.bzdev.math.stats.ProbDistribution
A, cdf, cdfc, domainMaxClosed, getDomainMax, inverseA, inverseP, inverseQ, isInDomain
-
Constructor Details
-
FDistr
public FDistr(long nu1, long nu2) Constructor. The distribution constructed is that for the random variable defined by (X1/ν1) / (X2/ν2) where X1 and X2 are independent random variables, each with a χ2 distribution and where X1 has ν1 degrees of freedom and X2 has ν2 degrees of freedom.- Parameters:
nu1- the number of degrees of freedom for the first random variable X1nu2- the number of degrees of freedom for the second random variable X2
-
FDistr
public FDistr(long nu1, long nu2, double lambda) Constructor for a noncentral F-distribution. The distribution constructed is that for the random variable defined by (X1/ν1) / (X2/ν2) where X1 and X2 are independent random variables, with X1 having a noncentral χ2 distribution with ν1 degrees of freedom and with X2 having a χ2 distribution with ν2 degrees of freedom.- Parameters:
nu1- the number of degrees of freedom for the first random variable X1nu2- the number of degrees of freedom for the second random variable X2lambda- the noncentrality parameter for the distribution for the first random variable
-
-
Method Details
-
getDegreesOfFreedom1
public long getDegreesOfFreedom1()Get the number of degrees of freedom (parameter 1).- Returns:
- the number of degrees of freedom
-
getDegreesOfFreedom2
public long getDegreesOfFreedom2()Get the number of degrees of freedom (parameter 2).- Returns:
- the number of degrees of freedom
-
isNonCentral
public boolean isNonCentral()Determine if this object is a noncentral χ2 distribution.- Returns:
- true if this object is a noncentral χ2 distribution; false otherwise.
-
getLambda
public double getLambda()Get the noncentrality parameter.- Returns:
- the noncentrality parameter
- Throws:
IllegalStateException- this object is not a noncentral χ2 distribution
-
isSymmetric
public boolean isSymmetric(double x) Description copied from class:ProbDistributionDetermine 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).- Specified by:
isSymmetricin classProbDistribution- Parameters:
x- the point about which to test if this distribution is symmaetric- Returns:
- true if it is symmetric; false otherwise.
-
pd
public double pd(double x) Description copied from class:ProbDistributionGet the probability density- Overrides:
pdin classProbDistribution- Parameters:
x- the value for which the density is to be computed- Returns:
- the probability density
-
P
public double P(double x) Description copied from class:ProbDistributionGet the probability that a value is no larger than the argument- Specified by:
Pin classProbDistribution- Parameters:
x- the argument- Returns:
- the probability
-
Q
public double Q(double x) Description copied from class:ProbDistributionGet the probability that a value is no smaller than the argument- Overrides:
Qin classProbDistribution- Parameters:
x- the argument- Returns:
- the probability
-
getDomainMin
public double getDomainMin()Description copied from interface:RealValuedDomainOpsGet the minimum value in the domain of the function.- Specified by:
getDomainMinin interfaceRealValuedDomainOps- Overrides:
getDomainMinin classProbDistribution- 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- Overrides:
domainMinClosedin classProbDistribution- Returns:
- true if the domain minimum is in the domain; false if it is the greatest lower bound for the domain
-
pd
public static double pd(double f, long nu1, long nu2) Get the probability density for an F-distribution. As mentioned in the class description, an F-distribution is the distribution of the random variable F = (X1/ν1) / (X2/ν2), where X1 and X2 are independent random variables with a χ2 distribution with ν1 and ν2 degrees of freedom respectively.- Parameters:
f- a value of the random variable Fnu1- the number of degrees of freedom ν1 for the first random variable X1nu2- the number of degrees of freedom ν2 for the first random variable X2- Returns:
- the f-distribution probability density
-
P
public static double P(double f, long nu1, long nu2) Get the cumulative probability for an F-distribution. As mentioned in the class description, an F-distribution is the distribution of the random variable F = (X1/ν1) / (X2/ν2), where X1 and X2 are independent random variables with a χ2 distribution with ν1 and ν2 degrees of freedom respectively.- Parameters:
f- a value of the random variable Fnu1- the number of degrees of freedom ν1 for the first random variable X1nu2- the number of degrees of freedom ν2 for the first random variable X2- Returns:
- the corresponding value of the cumulative probability distribution
-
Q
public static double Q(double f, long nu1, long nu2) Get the complement of the cumulative probability for an F-distribution. As mentioned in the class description, an F-distribution is the distribution of the random variable F = (X1/ν1) / (X2/ν2), where X1 and X2 are independent random variables with a χ2 distribution with ν1 and ν2 degrees of freedom respectively.- Parameters:
f- a value of the random variable Fnu1- the number of degrees of freedom ν1 for the first random variable X1nu2- the number of degrees of freedom ν2 for the first random variable X2- Returns:
- a value mathematically equal to 1 - P(f, nu)
-
pd
public static double pd(double f, long nu1, long nu2, double lambda) Get the probability density for a noncentral F-distribution. As mentioned in the class description, a noncentral F-distribution is the distribution of the random variable F = (X1/ν1) / (X2/ν2), where X1 and X2 are independent random variables where X1 has a noncentral χ2 distribution with ν1 degrees of freedom and a noncentrality parameter λ, and where X2 has a χ2 distribution with ν2 degrees of freedom.- Parameters:
f- a value of the random variable Fnu1- the number of degrees of freedom ν1 for the first random variable X1nu2- the number of degrees of freedom ν2 for the first random variable X2lambda- the noncentrality parameter λ for the distribution X1- Returns:
- the value of the noncentral f-distribution probability density for the specified parameters
-
P
public static double P(double f, long nu1, long nu2, double lambda) Get the cumulative probability distribution for a noncentral F-distribution. As mentioned in the class description, a noncentral F-distribution is the distribution of the random variable F = (X1/ν1) / (X2/ν2), where X1 and X2 are independent random variables where X1 has a noncentral χ2 distribution with ν1 degrees of freedom and a noncentrality parameter λ, and where X2 has a χ2 distribution with ν2 degrees of freedom.- Parameters:
f- a value of the random variable Fnu1- the number of degrees of freedom ν1 for the first random variable X1nu2- the number of degrees of freedom ν2 for the first random variable X2lambda- the noncentrality parameter λ for the distribution X1- Returns:
- the value of the cumulative distribution function for the specified parameters
-
Q
public static double Q(double f, long nu1, long nu2, double lambda) Get the complement of the cumulative probability distribution for a noncentral f distribution. As mentioned in the class description, a noncentral F-distribution is the distribution of the random variable F = (X1/ν1) / (X2/ν2), where X1 and X2 are independent random variables where X1 has a noncentral χ2 distribution with ν1 degrees of freedom and a noncentrality parameter λ, and where X2 has a χ2 distribution with ν2 degrees of freedom.- Parameters:
f- a value of the random variable Fnu1- the number of degrees of freedom ν1 for the first random variable X1nu2- the number of degrees of freedom ν2 for the first random variable X2lambda- the noncentrality parameter λ for the distribution X1- Returns:
- the value of the complement of the cumulative distribution function for the specified parameters
-