org.jscience.mathematics.statistics
Class FisherDistribution

java.lang.Object
  extended by org.jscience.mathematics.statistics.Distribution
      extended by org.jscience.mathematics.statistics.FisherDistribution
All Implemented Interfaces:
java.io.Serializable

public class FisherDistribution
extends Distribution
implements java.io.Serializable

This class models the Fisher F distribution with a spcified number of degrees of freedom in the numerator and denominator.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.statistics.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
FisherDistribution()
          This default constructor creates a new Fisher distribution with 5 degrees of freedom in numerator and denominator.
FisherDistribution(int n, int d)
          This general constructor creates a new Fisher distribution with a specified number of degrees of freedom in the numerator and denominator.
 
Method Summary
 double getCDF(double x)
          This method computes the cumulative distribution function in terms of the beta CDF.
 double getDenominatorDegrees()
          This method gets the denominator degrees of freedom.
 double getDensity(double x)
          This method computes the probability denisty function.
 double getMaxDensity()
          This method computes the maximum value of the density function.
 double getMean()
          This method returns the mean of the probability distribution.
 double getMoment(double a, int n)
          This method returns the moment of a specified order about a specified point.
 double getMoment(int n)
          This method returns the moment of a specified order.
 double getNumeratorDegrees()
          This method returns the numerator degrees of freedom.
 double getVariance()
          This method returns the variance of the distribution.
 void setDenominatorDegrees(int d)
          This method sets the denominator degrees of freedom.
 void setNumeratorDegrees(int n)
          This method sets the numerator degrees of freedom.
 void setParameters(int n, int d)
          This method sets the parameters, the degrees of freedom in the numerator and denominator.
 double simulate()
          This method simulates a value from the distribution.
 java.lang.String toString()
          This method returns a string that gives the name of the distribution and the values of the parameters.
 
Methods inherited from class org.jscience.mathematics.statistics.Distribution
getDomain, getFailureRate, getMedian, getMGF, getPGF, getQuantile, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FisherDistribution

public FisherDistribution(int n,
                          int d)
This general constructor creates a new Fisher distribution with a specified number of degrees of freedom in the numerator and denominator.

Parameters:
n - the numerator degrees of freedom
d - the denominator degrees of freedom

FisherDistribution

public FisherDistribution()
This default constructor creates a new Fisher distribution with 5 degrees of freedom in numerator and denominator.

Method Detail

setParameters

public void setParameters(int n,
                          int d)
This method sets the parameters, the degrees of freedom in the numerator and denominator. Additionally, the normalizing constant and default domain are computed.

Parameters:
n - the numerator degrees of freedom
d - the denominator degrees of freedom

getDensity

public double getDensity(double x)
This method computes the probability denisty function.

Specified by:
getDensity in class Distribution
Parameters:
x - a real number
Returns:
the probability density at x

getMaxDensity

public double getMaxDensity()
This method computes the maximum value of the density function.

Overrides:
getMaxDensity in class Distribution
Returns:
the maximum of the probability density function

getMean

public double getMean()
This method returns the mean of the probability distribution. The mean is ∞ if d ≤ 2 and the mean is d / (d − 2) if d > 2.

Overrides:
getMean in class Distribution
Returns:
the mean

getVariance

public double getVariance()
This method returns the variance of the distribution. The variance is undefined if d ≤ the variance is ∞ if 2 < d ≤ 4; and the variance is 2 d2(n + d - 2) / [(d - 2)2 n (d - 4)] if d > 4.

Overrides:
getVariance in class Distribution
Returns:
the variance

getMoment

public double getMoment(int n)
This method returns the moment of a specified order.

Overrides:
getMoment in class Distribution
Parameters:
n - the order
Returns:
the moment of order n

getMoment

public double getMoment(double a,
                        int n)
This method returns the moment of a specified order about a specified point.

Overrides:
getMoment in class Distribution
Parameters:
a - the center
n - the order
Returns:
the moment of order n about a

getCDF

public double getCDF(double x)
This method computes the cumulative distribution function in terms of the beta CDF.

Overrides:
getCDF in class Distribution
Parameters:
x - a real number
Returns:
the cumulative probability at x

getNumeratorDegrees

public double getNumeratorDegrees()
This method returns the numerator degrees of freedom.

Returns:
the numerator degrees of freedom

setNumeratorDegrees

public void setNumeratorDegrees(int n)
This method sets the numerator degrees of freedom.

Parameters:
n - the numerator degrees of freedom

getDenominatorDegrees

public double getDenominatorDegrees()
This method gets the denominator degrees of freedom.

Returns:
the denominator degrees of freedom

setDenominatorDegrees

public void setDenominatorDegrees(int d)
This method sets the denominator degrees of freedom.

Parameters:
d - the denominator degrees of freedom

simulate

public double simulate()
This method simulates a value from the distribution. This is done by simulating independent variables U and V, where U is chi-square n and V is chi-squared d, and then computing (U / n) / (V / d).

Overrides:
simulate in class Distribution
Returns:
a simulated value from the distribution

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class Distribution
Returns:
a string giving the name of the distribution and the values of the parameters