umontreal.iro.lecuyer.probdist
Class FisherFDist
- java.lang.Object
-
- umontreal.iro.lecuyer.probdist.ContinuousDistribution
-
- umontreal.iro.lecuyer.probdist.FisherFDist
-
- All Implemented Interfaces:
- Distribution
public class FisherFDist extends ContinuousDistribution
Extends the classContinuousDistributionfor the Fisher F distribution with n and m degrees of freedom, where n and m are positive integers. Its density isf (x) = Γ((n + m)/2)nn/2mm/2/[Γ(n/2)Γ(m/2)]x(n-2)/2/(m + nx)(n+m)/2, for x > 0.where Γ(x) is the gamma function defined inGammaDist.
-
-
Field Summary
-
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
decPrec
-
-
Constructor Summary
Constructors Constructor and Description FisherFDist(int n, int m)Constructs a Fisher F distribution with n and m degrees of freedom.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebarF(double x)Returns the complementary distribution function.static doublebarF(int n, int m, int d, double x)Computes the complementary distribution function of the Fisher F distribution with parameters n and m, evaluated at x, with roughly d decimal digits of precision.doublecdf(double x)Returns the distribution function F(x).static doublecdf(int n, int m, int d, double x)Computes the distribution function of the Fisher F distribution with parameters n and m, evaluated at x, with roughly d decimal digits of precision.doubledensity(double x)Returns f (x), the density evaluated at x.static doubledensity(int n, int m, double x)Computes the density function for a Fisher F distribution with n and m degrees of freedom.intgetM()Returns the parameter m of this object.doublegetMean()Returns the mean.static doublegetMean(int n, int m)Computes and returns the mean E[X] = m/(m - 2) of the Fisher F distribution with parameters n and m.intgetN()Returns the parameter n of this object.double[]getParams()Return a table containing the parameters of the current distribution.doublegetStandardDeviation()Returns the standard deviation.static doublegetStandardDeviation(int n, int m)Computes and returns the standard deviation of the Fisher F distribution with parameters n and m.doublegetVariance()Returns the variance.static doublegetVariance(int n, int m)Computes and returns the variance of the Fisher F distribution with parameters n and m.doubleinverseF(double u)Returns the inverse distribution function x = F-1(u).static doubleinverseF(int n, int m, int d, double u)Computes the inverse of the Fisher F distribution with parameters n and m, evaluated at x, with roughly d decimal digits of precision.voidsetParams(int n, int m)Sets the parameters n and m of this object.java.lang.StringtoString()-
Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup
-
-
-
-
Constructor Detail
-
FisherFDist
public FisherFDist(int n, int m)Constructs a Fisher F distribution with n and m degrees of freedom.
-
-
Method Detail
-
density
public double density(double x)
Description copied from class:ContinuousDistributionReturns f (x), the density evaluated at x.- Specified by:
densityin classContinuousDistribution- Parameters:
x- value at which the density is evaluated- Returns:
- density function evaluated at x
-
cdf
public double cdf(double x)
Description copied from interface:DistributionReturns the distribution function F(x).- Parameters:
x- value at which the distribution function is evaluated- Returns:
- distribution function evaluated at x
-
barF
public double barF(double x)
Description copied from class:ContinuousDistributionReturns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).- Specified by:
barFin interfaceDistribution- Overrides:
barFin classContinuousDistribution- Parameters:
x- value at which the complementary distribution function is evaluated- Returns:
- complementary distribution function evaluated at x
-
inverseF
public double inverseF(double u)
Description copied from class:ContinuousDistributionReturns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].- Specified by:
inverseFin interfaceDistribution- Overrides:
inverseFin classContinuousDistribution- Parameters:
u- value at which the inverse distribution function is evaluated- Returns:
- the inverse distribution function evaluated at u
-
getMean
public double getMean()
Description copied from class:ContinuousDistributionReturns the mean.- Specified by:
getMeanin interfaceDistribution- Overrides:
getMeanin classContinuousDistribution- Returns:
- the mean
-
getVariance
public double getVariance()
Description copied from class:ContinuousDistributionReturns the variance.- Specified by:
getVariancein interfaceDistribution- Overrides:
getVariancein classContinuousDistribution- Returns:
- the variance
-
getStandardDeviation
public double getStandardDeviation()
Description copied from class:ContinuousDistributionReturns the standard deviation.- Specified by:
getStandardDeviationin interfaceDistribution- Overrides:
getStandardDeviationin classContinuousDistribution- Returns:
- the standard deviation
-
density
public static double density(int n, int m, double x)Computes the density function for a Fisher F distribution with n and m degrees of freedom.
-
cdf
public static double cdf(int n, int m, int d, double x)Computes the distribution function of the Fisher F distribution with parameters n and m, evaluated at x, with roughly d decimal digits of precision.
-
barF
public static double barF(int n, int m, int d, double x)Computes the complementary distribution function of the Fisher F distribution with parameters n and m, evaluated at x, with roughly d decimal digits of precision.
-
inverseF
public static double inverseF(int n, int m, int d, double u)Computes the inverse of the Fisher F distribution with parameters n and m, evaluated at x, with roughly d decimal digits of precision.
-
getMean
public static double getMean(int n, int m)Computes and returns the mean E[X] = m/(m - 2) of the Fisher F distribution with parameters n and m.- Returns:
- the mean of the Fisher F distribution
-
getVariance
public static double getVariance(int n, int m)Computes and returns the variance of the Fisher F distribution with parameters n and m.- Returns:
- the variance of the Fisher F distribution Var[X] = (2m2(m + n - 2))/(n(m - 2)2(m - 4))
-
getStandardDeviation
public static double getStandardDeviation(int n, int m)Computes and returns the standard deviation of the Fisher F distribution with parameters n and m.- Returns:
- the standard deviation of the Fisher F distribution
-
getN
public int getN()
Returns the parameter n of this object.
-
getM
public int getM()
Returns the parameter m of this object.
-
setParams
public void setParams(int n, int m)Sets the parameters n and m of this object.
-
getParams
public double[] getParams()
Return a table containing the parameters of the current distribution. This table is put in regular order: [n, m].
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG