3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Noncentral F Distribution
</title>
5 <link rel=
"stylesheet" href=
"../../../math.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.77.1">
7 <link rel=
"home" href=
"../../../index.html" title=
"Math Toolkit 2.5.1">
8 <link rel=
"up" href=
"../dists.html" title=
"Distributions">
9 <link rel=
"prev" href=
"nc_chi_squared_dist.html" title=
"Noncentral Chi-Squared Distribution">
10 <link rel=
"next" href=
"nc_t_dist.html" title=
"Noncentral T Distribution">
12 <body bgcolor=
"white" text=
"black" link=
"#0000FF" vlink=
"#840084" alink=
"#0000FF">
13 <table cellpadding=
"2" width=
"100%"><tr>
14 <td valign=
"top"><img alt=
"Boost C++ Libraries" width=
"277" height=
"86" src=
"../../../../../../../boost.png"></td>
15 <td align=
"center"><a href=
"../../../../../../../index.html">Home
</a></td>
16 <td align=
"center"><a href=
"../../../../../../../libs/libraries.htm">Libraries
</a></td>
17 <td align=
"center"><a href=
"http://www.boost.org/users/people.html">People
</a></td>
18 <td align=
"center"><a href=
"http://www.boost.org/users/faq.html">FAQ
</a></td>
19 <td align=
"center"><a href=
"../../../../../../../more/index.htm">More
</a></td>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"nc_chi_squared_dist.html"><img src=
"../../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../dists.html"><img src=
"../../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../../index.html"><img src=
"../../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"nc_t_dist.html"><img src=
"../../../../../../../doc/src/images/next.png" alt=
"Next"></a>
26 <div class=
"titlepage"><div><div><h4 class=
"title">
27 <a name=
"math_toolkit.dist_ref.dists.nc_f_dist"></a><a class=
"link" href=
"nc_f_dist.html" title=
"Noncentral F Distribution">Noncentral F
29 </h4></div></div></div>
30 <pre class=
"programlisting"><span class=
"preprocessor">#include
</span> <span class=
"special"><</span><span class=
"identifier">boost
</span><span class=
"special">/
</span><span class=
"identifier">math
</span><span class=
"special">/
</span><span class=
"identifier">distributions
</span><span class=
"special">/
</span><span class=
"identifier">non_central_f
</span><span class=
"special">.
</span><span class=
"identifier">hpp
</span><span class=
"special">></span></pre>
31 <pre class=
"programlisting"><span class=
"keyword">namespace
</span> <span class=
"identifier">boost
</span><span class=
"special">{
</span> <span class=
"keyword">namespace
</span> <span class=
"identifier">math
</span><span class=
"special">{
</span>
33 <span class=
"keyword">template
</span> <span class=
"special"><</span><span class=
"keyword">class
</span> <span class=
"identifier">RealType
</span> <span class=
"special">=
</span> <span class=
"keyword">double
</span><span class=
"special">,
</span>
34 <span class=
"keyword">class
</span> <a class=
"link" href=
"../../../policy.html" title=
"Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy
</a> <span class=
"special">=
</span> <a class=
"link" href=
"../../pol_ref/pol_ref_ref.html" title=
"Policy Class Reference">policies::policy
<></a> <span class=
"special">></span>
35 <span class=
"keyword">class
</span> <span class=
"identifier">non_central_f_distribution
</span><span class=
"special">;
</span>
37 <span class=
"keyword">typedef
</span> <span class=
"identifier">non_central_f_distribution
</span><span class=
"special"><></span> <span class=
"identifier">non_central_f
</span><span class=
"special">;
</span>
39 <span class=
"keyword">template
</span> <span class=
"special"><</span><span class=
"keyword">class
</span> <span class=
"identifier">RealType
</span><span class=
"special">,
</span> <span class=
"keyword">class
</span> <a class=
"link" href=
"../../../policy.html" title=
"Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy
</a><span class=
"special">></span>
40 <span class=
"keyword">class
</span> <span class=
"identifier">non_central_f_distribution
</span>
41 <span class=
"special">{
</span>
42 <span class=
"keyword">public
</span><span class=
"special">:
</span>
43 <span class=
"keyword">typedef
</span> <span class=
"identifier">RealType
</span> <span class=
"identifier">value_type
</span><span class=
"special">;
</span>
44 <span class=
"keyword">typedef
</span> <span class=
"identifier">Policy
</span> <span class=
"identifier">policy_type
</span><span class=
"special">;
</span>
46 <span class=
"comment">// Constructor:
</span>
47 <span class=
"identifier">non_central_f_distribution
</span><span class=
"special">(
</span><span class=
"identifier">RealType
</span> <span class=
"identifier">v1
</span><span class=
"special">,
</span> <span class=
"identifier">RealType
</span> <span class=
"identifier">v2
</span><span class=
"special">,
</span> <span class=
"identifier">RealType
</span> <span class=
"identifier">lambda
</span><span class=
"special">);
</span>
49 <span class=
"comment">// Accessor to degrees_of_freedom parameters v1
& v2:
</span>
50 <span class=
"identifier">RealType
</span> <span class=
"identifier">degrees_of_freedom1
</span><span class=
"special">()
</span><span class=
"keyword">const
</span><span class=
"special">;
</span>
51 <span class=
"identifier">RealType
</span> <span class=
"identifier">degrees_of_freedom2
</span><span class=
"special">()
</span><span class=
"keyword">const
</span><span class=
"special">;
</span>
53 <span class=
"comment">// Accessor to non-centrality parameter lambda:
</span>
54 <span class=
"identifier">RealType
</span> <span class=
"identifier">non_centrality
</span><span class=
"special">()
</span><span class=
"keyword">const
</span><span class=
"special">;
</span>
55 <span class=
"special">};
</span>
57 <span class=
"special">}}
</span> <span class=
"comment">// namespaces
</span>
60 The noncentral F distribution is a generalization of the
<a class=
"link" href=
"f_dist.html" title=
"F Distribution">Fisher
61 F Distribution
</a>. It is defined as the ratio
63 <pre class=
"programlisting"><span class=
"identifier">F
</span> <span class=
"special">=
</span> <span class=
"special">(
</span><span class=
"identifier">X
</span><span class=
"special">/
</span><span class=
"identifier">v1
</span><span class=
"special">)
</span> <span class=
"special">/
</span> <span class=
"special">(
</span><span class=
"identifier">Y
</span><span class=
"special">/
</span><span class=
"identifier">v2
</span><span class=
"special">)
</span>
66 where X is a noncentral
χ<sup>2</sup>
67 random variable with
<span class=
"emphasis"><em>v1
</em></span> degrees
68 of freedom and non-centrality parameter
λ, and Y is a central
χ<sup>2</sup> random variable
69 with
<span class=
"emphasis"><em>v2
</em></span> degrees of freedom.
72 This gives the following PDF:
75 <span class=
"inlinemediaobject"><img src=
"../../../../equations/nc_f_ref1.svg"></span>
78 where L
<sub>a
</sub><sup>b
</sup>(c) is a generalised Laguerre polynomial and B(a,b) is the
<a class=
"link" href=
"../../sf_beta/beta_function.html" title=
"Beta">beta
</a> function, or
81 <span class=
"inlinemediaobject"><img src=
"../../../../equations/nc_f_ref2.svg"></span>
84 The following graph illustrates how the distribution changes for different
88 <span class=
"inlinemediaobject"><img src=
"../../../../graphs/nc_f_pdf.svg" align=
"middle"></span>
91 <a name=
"math_toolkit.dist_ref.dists.nc_f_dist.h0"></a>
92 <span class=
"phrase"><a name=
"math_toolkit.dist_ref.dists.nc_f_dist.member_functions"></a></span><a class=
"link" href=
"nc_f_dist.html#math_toolkit.dist_ref.dists.nc_f_dist.member_functions">Member
95 <pre class=
"programlisting"><span class=
"identifier">non_central_f_distribution
</span><span class=
"special">(
</span><span class=
"identifier">RealType
</span> <span class=
"identifier">v1
</span><span class=
"special">,
</span> <span class=
"identifier">RealType
</span> <span class=
"identifier">v2
</span><span class=
"special">,
</span> <span class=
"identifier">RealType
</span> <span class=
"identifier">lambda
</span><span class=
"special">);
</span>
98 Constructs a non-central beta distribution with parameters
<span class=
"emphasis"><em>v1
</em></span>
99 and
<span class=
"emphasis"><em>v2
</em></span> and non-centrality parameter
<span class=
"emphasis"><em>lambda
</em></span>.
102 Requires v1
> 0, v2
> 0 and lambda
>=
0, otherwise calls
<a class=
"link" href=
"../../error_handling.html#math_toolkit.error_handling.domain_error">domain_error
</a>.
104 <pre class=
"programlisting"><span class=
"identifier">RealType
</span> <span class=
"identifier">degrees_of_freedom1
</span><span class=
"special">()
</span><span class=
"keyword">const
</span><span class=
"special">;
</span>
107 Returns the parameter
<span class=
"emphasis"><em>v1
</em></span> from which this object was
110 <pre class=
"programlisting"><span class=
"identifier">RealType
</span> <span class=
"identifier">degrees_of_freedom2
</span><span class=
"special">()
</span><span class=
"keyword">const
</span><span class=
"special">;
</span>
113 Returns the parameter
<span class=
"emphasis"><em>v2
</em></span> from which this object was
116 <pre class=
"programlisting"><span class=
"identifier">RealType
</span> <span class=
"identifier">non_centrality
</span><span class=
"special">()
</span><span class=
"keyword">const
</span><span class=
"special">;
</span>
119 Returns the non-centrality parameter
<span class=
"emphasis"><em>lambda
</em></span> from which
120 this object was constructed.
123 <a name=
"math_toolkit.dist_ref.dists.nc_f_dist.h1"></a>
124 <span class=
"phrase"><a name=
"math_toolkit.dist_ref.dists.nc_f_dist.non_member_accessors"></a></span><a class=
"link" href=
"nc_f_dist.html#math_toolkit.dist_ref.dists.nc_f_dist.non_member_accessors">Non-member
128 All the
<a class=
"link" href=
"../nmp.html" title=
"Non-Member Properties">usual non-member accessor
129 functions
</a> that are generic to all distributions are supported:
130 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution Function
</a>,
131 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function
</a>,
132 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile
</a>,
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard Function
</a>,
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative Hazard Function
</a>,
133 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.mean">mean
</a>,
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.median">median
</a>,
134 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.mode">mode
</a>,
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.variance">variance
</a>,
135 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation
</a>,
136 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.skewness">skewness
</a>,
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.kurtosis">kurtosis
</a>,
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">kurtosis_excess
</a>,
137 <a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.range">range
</a> and
<a class=
"link" href=
"../nmp.html#math_toolkit.dist_ref.nmp.support">support
</a>.
140 The domain of the random variable is [
0, +
∞].
143 <a name=
"math_toolkit.dist_ref.dists.nc_f_dist.h2"></a>
144 <span class=
"phrase"><a name=
"math_toolkit.dist_ref.dists.nc_f_dist.accuracy"></a></span><a class=
"link" href=
"nc_f_dist.html#math_toolkit.dist_ref.dists.nc_f_dist.accuracy">Accuracy
</a>
147 This distribution is implemented in terms of the
<a class=
"link" href=
"nc_beta_dist.html" title=
"Noncentral Beta Distribution">Noncentral
148 Beta Distribution
</a>: refer to that distribution for accuracy data.
151 <a name=
"math_toolkit.dist_ref.dists.nc_f_dist.h3"></a>
152 <span class=
"phrase"><a name=
"math_toolkit.dist_ref.dists.nc_f_dist.tests"></a></span><a class=
"link" href=
"nc_f_dist.html#math_toolkit.dist_ref.dists.nc_f_dist.tests">Tests
</a>
155 Since this distribution is implemented by adapting another distribution,
156 the tests consist of basic sanity checks computed by the
<a href=
"http://www.r-project.org/" target=
"_top">R-
2.5.1
157 Math library statistical package
</a> and its pbeta and dbeta functions.
160 <a name=
"math_toolkit.dist_ref.dists.nc_f_dist.h4"></a>
161 <span class=
"phrase"><a name=
"math_toolkit.dist_ref.dists.nc_f_dist.implementation"></a></span><a class=
"link" href=
"nc_f_dist.html#math_toolkit.dist_ref.dists.nc_f_dist.implementation">Implementation
</a>
164 In the following table
<span class=
"emphasis"><em>v1
</em></span> and
<span class=
"emphasis"><em>v2
</em></span>
165 are the first and second degrees of freedom parameters of the distribution,
167 is the non-centrality parameter,
<span class=
"emphasis"><em>x
</em></span> is the random variate,
168 <span class=
"emphasis"><em>p
</em></span> is the probability, and
<span class=
"emphasis"><em>q =
1-p
</em></span>.
170 <div class=
"informaltable"><table class=
"table">
196 Implemented in terms of the non-central beta PDF using the relation:
199 f(x;v1,v2;
λ) = (v1/v2) / ((
1+y)*(
1+y)) * g(y/(
1+y);v1/
2,v2/
2;
λ)
202 where g(x; a, b;
λ) is the non central beta PDF, and:
220 p = B
<sub>y
</sub>(v1/
2, v2/
2;
λ)
223 where B
<sub>x
</sub>(a, b;
λ) is the noncentral beta distribution CDF and
241 q =
1 - B
<sub>y
</sub>(v1/
2, v2/
2;
λ)
244 where
1 - B
<sub>x
</sub>(a, b;
λ) is the complement of the noncentral beta
263 x = (bx / (
1-bx)) * (v1 / v2)
269 bx = Q
<sub>p
</sub><sup>-
1</sup>(v1/
2, v2/
2;
λ)
275 Q
<sub>p
</sub><sup>-
1</sup>(v1/
2, v2/
2;
λ)
278 is the noncentral beta quantile.
296 x = (bx / (
1-bx)) * (v1 / v2)
302 bx = QC
<sub>q
</sub><sup>-
1</sup>(v1/
2, v2/
2;
λ)
308 QC
<sub>q
</sub><sup>-
1</sup>(v1/
2, v2/
2;
λ)
311 is the noncentral beta quantile from the complement.
323 v2 * (v1 + l) / (v1 * (v2 -
2))
335 By numeric maximalisation of the PDF.
347 Refer to,
<a href=
"http://mathworld.wolfram.com/NoncentralF-Distribution.html" target=
"_top">Weisstein,
348 Eric W.
"Noncentral F-Distribution." From MathWorld--A
349 Wolfram Web Resource.
</a>
361 Refer to,
<a href=
"http://mathworld.wolfram.com/NoncentralF-Distribution.html" target=
"_top">Weisstein,
362 Eric W.
"Noncentral F-Distribution." From MathWorld--A
363 Wolfram Web Resource.
</a>, and to the
<a href=
"http://reference.wolfram.com/mathematica/ref/NoncentralFRatioDistribution.html" target=
"_top">Mathematica
371 kurtosis and kurtosis excess
376 Refer to,
<a href=
"http://mathworld.wolfram.com/NoncentralF-Distribution.html" target=
"_top">Weisstein,
377 Eric W.
"Noncentral F-Distribution." From MathWorld--A
378 Wolfram Web Resource.
</a>, and to the
<a href=
"http://reference.wolfram.com/mathematica/ref/NoncentralFRatioDistribution.html" target=
"_top">Mathematica
386 Some analytic properties of noncentral distributions (particularly unimodality,
387 and monotonicity of their modes) are surveyed and summarized by:
390 Andrea van Aubel
& Wolfgang Gawronski, Applied Mathematics and Computation,
394 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
395 <td align=
"left"></td>
396 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2006-
2010,
2012-
2014 Nikhar Agrawal,
397 Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert
398 Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R
åde, Gautam Sewani,
399 Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang
<p>
400 Distributed under the Boost Software License, Version
1.0. (See accompanying
401 file LICENSE_1_0.txt or copy at
<a href=
"http://www.boost.org/LICENSE_1_0.txt" target=
"_top">http://www.boost.org/LICENSE_1_0.txt
</a>)
406 <div class=
"spirit-nav">
407 <a accesskey=
"p" href=
"nc_chi_squared_dist.html"><img src=
"../../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../dists.html"><img src=
"../../../../../../../doc/src/images/up.png" alt=
"Up"></a><a accesskey=
"h" href=
"../../../index.html"><img src=
"../../../../../../../doc/src/images/home.png" alt=
"Home"></a><a accesskey=
"n" href=
"nc_t_dist.html"><img src=
"../../../../../../../doc/src/images/next.png" alt=
"Next"></a>