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 TypeMethodDescriptionboolean
Determine if the domain minimum is in the domain.long
Get the number of degrees of freedom (parameter 1).long
Get the number of degrees of freedom (parameter 2).double
Get the minimum value in the domain of the function.double
Get the noncentrality parameter.boolean
Determine if this object is a noncentral χ2 distribution.boolean
isSymmetric
(double x) Determine if this distribution is symmetric about x.double
P
(double x) Get the probability that a value is no larger than the argumentstatic double
P
(double f, long nu1, long nu2) Get the cumulative probability for an F-distribution.static double
P
(double f, long nu1, long nu2, double lambda) Get the cumulative probability distribution for a noncentral F-distribution.double
pd
(double x) Get the probability densitystatic double
pd
(double f, long nu1, long nu2) Get the probability density for an F-distribution.static double
pd
(double f, long nu1, long nu2, double lambda) Get the probability density for a noncentral F-distribution.double
Q
(double x) Get the probability that a value is no smaller than the argumentstatic double
Q
(double f, long nu1, long nu2) Get the complement of the cumulative probability for an F-distribution.static double
Q
(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:ProbDistribution
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).- Specified by:
isSymmetric
in 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:ProbDistribution
Get the probability density- Overrides:
pd
in 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:ProbDistribution
Get the probability that a value is no larger than the argument- Specified by:
P
in classProbDistribution
- Parameters:
x
- the argument- Returns:
- the probability
-
Q
public double Q(double x) Description copied from class:ProbDistribution
Get the probability that a value is no smaller than the argument- Overrides:
Q
in classProbDistribution
- Parameters:
x
- the argument- Returns:
- the probability
-
getDomainMin
public double getDomainMin()Description copied from interface:RealValuedDomainOps
Get the minimum value in the domain of the function.- Specified by:
getDomainMin
in interfaceRealValuedDomainOps
- Overrides:
getDomainMin
in classProbDistribution
- Returns:
- the minimum value
-
domainMinClosed
public boolean domainMinClosed()Description copied from interface:RealValuedDomainOps
Determine if the domain minimum is in the domain.- Specified by:
domainMinClosed
in interfaceRealValuedDomainOps
- Overrides:
domainMinClosed
in 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
-