Class FDistr

All Implemented Interfaces:
RealValuedDomainOps

public class FDistr extends ProbDistribution
Class providing methods for the F-distribution. An F-distribution is the distribution of the random variable (X11) / (X22), 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
    Constructor
    Description
    FDistr(long nu1, long nu2)
    Constructor.
    FDistr(long nu1, long nu2, double lambda)
    Constructor for a noncentral F-distribution.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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 argument
    static 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 density
    static 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 argument
    static 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FDistr

      public FDistr(long nu1, long nu2)
      Constructor. The distribution constructed is that for the random variable defined by (X11) / (X22) 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 X1
      nu2 - 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 (X11) / (X22) 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 X1
      nu2 - the number of degrees of freedom for the second random variable X2
      lambda - 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 class ProbDistribution
      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 class ProbDistribution
      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 class ProbDistribution
      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 class ProbDistribution
      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 interface RealValuedDomainOps
      Overrides:
      getDomainMin in class ProbDistribution
      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 interface RealValuedDomainOps
      Overrides:
      domainMinClosed in class ProbDistribution
      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 = (X11) / (X22), 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 F
      nu1 - the number of degrees of freedom ν1 for the first random variable X1
      nu2 - 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 = (X11) / (X22), 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 F
      nu1 - the number of degrees of freedom ν1 for the first random variable X1
      nu2 - 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 = (X11) / (X22), 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 F
      nu1 - the number of degrees of freedom ν1 for the first random variable X1
      nu2 - 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 = (X11) / (X22), 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 F
      nu1 - the number of degrees of freedom ν1 for the first random variable X1
      nu2 - the number of degrees of freedom ν2 for the first random variable X2
      lambda - 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 = (X11) / (X22), 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 F
      nu1 - the number of degrees of freedom ν1 for the first random variable X1
      nu2 - the number of degrees of freedom ν2 for the first random variable X2
      lambda - 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 = (X11) / (X22), 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 F
      nu1 - the number of degrees of freedom ν1 for the first random variable X1
      nu2 - the number of degrees of freedom ν2 for the first random variable X2
      lambda - the noncentrality parameter λ for the distribution X1
      Returns:
      the value of the complement of the cumulative distribution function for the specified parameters