gov.sandia.cognition.statistics.distribution
Class SnedecorFDistribution

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.statistics.AbstractDistribution<NumberType>
          extended by gov.sandia.cognition.statistics.AbstractClosedFormUnivariateDistribution<Double>
              extended by gov.sandia.cognition.statistics.distribution.SnedecorFDistribution
All Implemented Interfaces:
Vectorizable, ClosedFormDistribution<Double>, ClosedFormUnivariateDistribution<Double>, Distribution<Double>, DistributionWithMean<Double>, UnivariateDistribution<Double>, CloneableSerializable, Serializable, Cloneable
Direct Known Subclasses:
SnedecorFDistribution.CDF

@PublicationReference(author="Wikipedia",
                      title="F-distribution",
                      type=WebPage,
                      year=2009,
                      url="http://en.wikipedia.org/wiki/F-distribution")
public class SnedecorFDistribution
extends AbstractClosedFormUnivariateDistribution<Double>

CDF of the Snedecor F-distribution (also known as Fisher F-distribution, Fisher-Snedecor F-distribution, or just plain old F-distribution). This is a type of Beta Distribution, where F(x,v1,v2) = 1-Beta(v2/(v2+v1*x),v2,v1)

Since:
2.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
static class SnedecorFDistribution.CDF
          CDF of the F-distribution.
 
Field Summary
static double DEFAULT_V1
          Default value of v1, 3.0.
static double DEFAULT_V2
          Default value of v2, 5.0.
 
Constructor Summary
SnedecorFDistribution()
          Default constructor
SnedecorFDistribution(double v1, double v2)
          Creates a new instance of CumulativeDistribution
SnedecorFDistribution(SnedecorFDistribution other)
          Copy Constructor
 
Method Summary
 SnedecorFDistribution clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 void convertFromVector(Vector parameters)
          Converts the object from a Vector of parameters.
 Vector convertToVector()
          Converts the object to a vector.
 SnedecorFDistribution.CDF getCDF()
          Gets the CDF of a scalar distribution.
 Double getMaxSupport()
          Gets the minimum support (domain or input) of the distribution.
 Double getMean()
          Gets the arithmetic mean, or "first central moment" or "expectation", of the distribution.
 Double getMinSupport()
          Gets the minimum support (domain or input) of the distribution.
 double getV1()
          Getter for v1
 double getV2()
          Getter for v2
 double getVariance()
          Gets the variance of the distribution.
 ArrayList<Double> sample(Random random, int numSamples)
          Draws multiple random samples from the distribution.
 void setV1(double v1)
          Setter for v1
 void setV2(double v2)
          Setter for v2
 
Methods inherited from class gov.sandia.cognition.statistics.AbstractDistribution
sample
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.Distribution
sample
 

Field Detail

DEFAULT_V1

public static final double DEFAULT_V1
Default value of v1, 3.0.

See Also:
Constant Field Values

DEFAULT_V2

public static final double DEFAULT_V2
Default value of v2, 5.0.

See Also:
Constant Field Values
Constructor Detail

SnedecorFDistribution

public SnedecorFDistribution()
Default constructor


SnedecorFDistribution

public SnedecorFDistribution(double v1,
                             double v2)
Creates a new instance of CumulativeDistribution

Parameters:
v1 - First degree of freedom
v2 - Second degree of freedom

SnedecorFDistribution

public SnedecorFDistribution(SnedecorFDistribution other)
Copy Constructor

Parameters:
other - CumulativeDistribution to copy
Method Detail

clone

public SnedecorFDistribution clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface Vectorizable
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractClosedFormUnivariateDistribution<Double>
Returns:
A clone of this object.

getV1

public double getV1()
Getter for v1

Returns:
First degree of freedom

setV1

public void setV1(double v1)
Setter for v1

Parameters:
v1 - First degree of freedom

getV2

public double getV2()
Getter for v2

Returns:
Second degree of freedom

setV2

public void setV2(double v2)
Setter for v2

Parameters:
v2 - Second degree of freedom

getMean

public Double getMean()
Description copied from interface: DistributionWithMean
Gets the arithmetic mean, or "first central moment" or "expectation", of the distribution.

Returns:
Mean of the distribution.

getVariance

public double getVariance()
Description copied from interface: UnivariateDistribution
Gets the variance of the distribution. This is sometimes called the second central moment by more pedantic people, which is equivalent to the square of the standard deviation.

Returns:
Variance of the distribution.

convertToVector

public Vector convertToVector()
Description copied from interface: Vectorizable
Converts the object to a vector.

Returns:
The Vector form of the object.

convertFromVector

public void convertFromVector(Vector parameters)
Description copied from interface: Vectorizable
Converts the object from a Vector of parameters.

Parameters:
parameters - The parameters to incorporate.

sample

public ArrayList<Double> sample(Random random,
                                int numSamples)
Description copied from interface: Distribution
Draws multiple random samples from the distribution. It is generally more efficient to use this multiple-sample method than multiple calls of the single-sample method. (But not always.)

Parameters:
random - Random-number generator to use in order to generate random numbers.
numSamples - Number of samples to draw from the distribution.
Returns:
Samples drawn according to this distribution.

getCDF

public SnedecorFDistribution.CDF getCDF()
Description copied from interface: UnivariateDistribution
Gets the CDF of a scalar distribution.

Returns:
CDF of the scalar distribution.

getMinSupport

public Double getMinSupport()
Description copied from interface: UnivariateDistribution
Gets the minimum support (domain or input) of the distribution.

Returns:
Minimum support.

getMaxSupport

public Double getMaxSupport()
Description copied from interface: UnivariateDistribution
Gets the minimum support (domain or input) of the distribution.

Returns:
Minimum support.