...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
#include <boost/math/distributions/non_central_f.hpp>
namespace boost{ namespace math{ template <class RealType = double, class Policy = policies::policy<> > class non_central_f_distribution; typedef non_central_f_distribution<> non_central_f; template <class RealType, class Policy> class non_central_f_distribution { public: typedef RealType value_type; typedef Policy policy_type; // Constructor: non_central_f_distribution(RealType v1, RealType v2, RealType lambda); // Accessor to degrees_of_freedom parameters v1 & v2: RealType degrees_of_freedom1()const; RealType degrees_of_freedom2()const; // Accessor to noncentrality parameter lambda: RealType non_centrality()const; }; }} // namespaces
The noncentral F distribution is a generalization of the Fisher F Distribution. It is defined as the ratio
F = (X/v1) / (Y/v2)
where X is a noncentral χ^{2} random variable with v1 degrees of freedom and noncentrality parameter λ, and Y is a central χ^{2} random variable with v2 degrees of freedom.
This gives the following PDF:
where L_{a}^{b}(c) is a generalised Laguerre polynomial and B(a,b) is the beta function, or
The following graph illustrates how the distribution changes for different values of λ:
non_central_f_distribution(RealType v1, RealType v2, RealType lambda);
Constructs a noncentral beta distribution with parameters v1 and v2 and noncentrality parameter lambda.
Requires v1 > 0, v2 > 0 and lambda >= 0, otherwise calls domain_error.
RealType degrees_of_freedom1()const;
Returns the parameter v1 from which this object was constructed.
RealType degrees_of_freedom2()const;
Returns the parameter v2 from which this object was constructed.
RealType non_centrality()const;
Returns the noncentrality parameter lambda from which this object was constructed.
All the usual nonmember accessor functions that are generic to all distributions are supported: Cumulative Distribution Function, Probability Density Function, Quantile, Hazard Function, Cumulative Hazard Function, mean, median, mode, variance, standard deviation, skewness, kurtosis, kurtosis_excess, range and support.
The domain of the random variable is [0, +∞].
This distribution is implemented in terms of the Noncentral Beta Distribution: refer to that distribution for accuracy data.
Since this distribution is implemented by adapting another distribution, the tests consist of basic sanity checks computed by the R2.5.1 Math library statistical package and its pbeta and dbeta functions.
In the following table v1 and v2 are the first and second degrees of freedom parameters of the distribution, λ is the noncentrality parameter, x is the random variate, p is the probability, and q = 1p.
Function 
Implementation Notes 


Implemented in terms of the noncentral beta PDF using the relation: f(x;v1,v2;λ) = (v1/v2) / ((1+y)*(1+y)) * g(y/(1+y);v1/2,v2/2;λ) where g(x; a, b; λ) is the non central beta PDF, and: y = x * v1 / v2 
cdf 
Using the relation: p = B_{y}(v1/2, v2/2; λ) where B_{x}(a, b; λ) is the noncentral beta distribution CDF and y = x * v1 / v2 
cdf complement 
Using the relation: q = 1  B_{y}(v1/2, v2/2; λ) where 1  B_{x}(a, b; λ) is the complement of the noncentral beta distribution CDF and y = x * v1 / v2 
quantile 
Using the relation: x = (bx / (1bx)) * (v1 / v2) where bx = Q_{p}^{1}(v1/2, v2/2; λ) and Q_{p}^{1}(v1/2, v2/2; λ) is the noncentral beta quantile. 
quantile from the complement 
Using the relation: x = (bx / (1bx)) * (v1 / v2) where bx = QC_{q}^{1}(v1/2, v2/2; λ) and QC_{q}^{1}(v1/2, v2/2; λ) is the noncentral beta quantile from the complement. 
mean 
v2 * (v1 + l) / (v1 * (v2  2)) 
mode 
By numeric maximalisation of the PDF. 
variance 
Refer to, Weisstein, Eric W. "Noncentral FDistribution." From MathWorldA Wolfram Web Resource. 
skewness 
Refer to, Weisstein, Eric W. "Noncentral FDistribution." From MathWorldA Wolfram Web Resource., and to the Mathematica documentation 
kurtosis and kurtosis excess 
Refer to, Weisstein, Eric W. "Noncentral FDistribution." From MathWorldA Wolfram Web Resource., and to the Mathematica documentation 
Some analytic properties of noncentral distributions (particularly unimodality, and monotonicity of their modes) are surveyed and summarized by:
Andrea van Aubel & Wolfgang Gawronski, Applied Mathematics and Computation, 141 (2003) 312.