FDistribution
Represents the F-distribution (also known as the Fisher-Snedecor distribution).
The F-distribution arises as the ratio of two independent chi-squared random variables, each divided by its degrees of freedom. It is the workhorse distribution behind F-tests, which appear in analysis of variance (ANOVA), regression significance testing, and comparing the variances of two populations.
The distribution is right-skewed and supported on the interval from zero to positive infinity. As both degrees-of-freedom parameters grow, it converges toward a normal distribution. The mean exists only when the denominator degrees of freedom exceeds 2, and the variance exists only when it exceeds 4.
Internally, the CDF and survival function use the regularized incomplete beta function, and the quantile function uses Newton's method. Random sampling generates two independent chi-squared variates and computes their ratio.
Example:
val f = FDistribution(dfNumerator = 5.0, dfDenominator = 10.0)
f.pdf(1.0) // 0.6092... (density at x = 1)
f.cdf(3.33) // ~0.95 (probability that F <= 3.33)
f.quantile(0.95) // ~3.33 (critical value for a 5% upper-tail test)
f.mean // 1.25 (10 / (10 - 2))
f.sample(Random(42)) // a single random draw from the distributionProperties
the degrees of freedom for the denominator (second) chi-squared variable. Must be positive.
the degrees of freedom for the numerator (first) chi-squared variable. Must be positive.
Returns the excess kurtosis, defined only when the denominator degrees of freedom exceeds 8. Returns Double.NaN otherwise.
Returns the mean, defined only when the denominator degrees of freedom exceeds 2. Returns Double.NaN otherwise.
Returns the skewness, defined only when the denominator degrees of freedom exceeds 6. Returns Double.NaN otherwise.
Returns the variance, defined only when the denominator degrees of freedom exceeds 4. Returns Double.NaN otherwise.