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.79.1">
7 <link rel="home" href="../../../index.html" title="Math Toolkit 2.11.0">
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 20. 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 20. 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 <div class="blockquote"><blockquote class="blockquote"><p>
64 <span class="serif_italic">F = (X/v1) / (Y/v2)</span>
65 </p></blockquote></div>
67 where X is a noncentral χ<sup>2</sup>
68 random variable with <span class="emphasis"><em>v1</em></span> degrees
69 of freedom and non-centrality parameter λ, and Y is a central χ<sup>2</sup> random variable
70 with <span class="emphasis"><em>v2</em></span> degrees of freedom.
73 This gives the following PDF:
75 <div class="blockquote"><blockquote class="blockquote"><p>
76 <span class="inlinemediaobject"><img src="../../../../equations/nc_f_ref1.svg"></span>
78 </p></blockquote></div>
80 where <span class="emphasis"><em>L<sub>a</sub><sup>b</sup>(c)</em></span> is a generalised Laguerre polynomial
81 and <span class="emphasis"><em>B(a,b)</em></span> is the <a class="link" href="../../sf_beta/beta_function.html" title="Beta">beta</a>
84 <div class="blockquote"><blockquote class="blockquote"><p>
85 <span class="inlinemediaobject"><img src="../../../../equations/nc_f_ref2.svg"></span>
87 </p></blockquote></div>
89 The following graph illustrates how the distribution changes for different
92 <div class="blockquote"><blockquote class="blockquote"><p>
93 <span class="inlinemediaobject"><img src="../../../../graphs/nc_f_pdf.svg" align="middle"></span>
95 </p></blockquote></div>
97 <a name="math_toolkit.dist_ref.dists.nc_f_dist.h0"></a>
98 <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
101 <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>
104 Constructs a non-central beta distribution with parameters <span class="emphasis"><em>v1</em></span>
105 and <span class="emphasis"><em>v2</em></span> and non-centrality parameter <span class="emphasis"><em>lambda</em></span>.
108 Requires <span class="emphasis"><em>v1</em></span> > 0, <span class="emphasis"><em>v2</em></span> > 0
109 and lambda >= 0, otherwise calls <a class="link" href="../../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a>.
111 <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>
114 Returns the parameter <span class="emphasis"><em>v1</em></span> from which this object was
117 <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>
120 Returns the parameter <span class="emphasis"><em>v2</em></span> from which this object was
123 <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>
126 Returns the non-centrality parameter <span class="emphasis"><em>lambda</em></span> from which
127 this object was constructed.
130 <a name="math_toolkit.dist_ref.dists.nc_f_dist.h1"></a>
131 <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
135 All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member accessor
136 functions</a> that are generic to all distributions are supported:
137 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution Function</a>,
138 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>,
139 <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>,
140 <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>,
141 <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>,
142 <a class="link" href="../nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation</a>,
143 <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>,
144 <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>.
147 The domain of the random variable is [0, +∞].
150 <a name="math_toolkit.dist_ref.dists.nc_f_dist.h2"></a>
151 <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>
154 This distribution is implemented in terms of the <a class="link" href="nc_beta_dist.html" title="Noncentral Beta Distribution">Noncentral
155 Beta Distribution</a>: refer to that distribution for accuracy data.
158 <a name="math_toolkit.dist_ref.dists.nc_f_dist.h3"></a>
159 <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>
162 Since this distribution is implemented by adapting another distribution,
163 the tests consist of basic sanity checks computed by the <a href="http://www.r-project.org/" target="_top">R-2.5.1
164 Math library statistical package</a> and its pbeta and dbeta functions.
167 <a name="math_toolkit.dist_ref.dists.nc_f_dist.h4"></a>
168 <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>
171 In the following table <span class="emphasis"><em>v1</em></span> and <span class="emphasis"><em>v2</em></span>
172 are the first and second degrees of freedom parameters of the distribution,
174 is the non-centrality parameter, <span class="emphasis"><em>x</em></span> is the random variate,
175 <span class="emphasis"><em>p</em></span> is the probability, and <span class="emphasis"><em>q = 1-p</em></span>.
177 <div class="informaltable"><table class="table">
203 Implemented in terms of the non-central beta PDF using the relation:
206 <span class="serif_italic">f(x;v1,v2;λ) = (v1/v2) / ((1+y)*(1+y))
207 * g(y/(1+y);v1/2,v2/2;λ)</span>
210 where <span class="serif_italic">g(x; a, b; λ)</span> is the
211 non central beta PDF, and:
214 <span class="serif_italic">y = x * v1 / v2</span>
229 <span class="serif_italic">p = B<sub>y</sub>(v1/2, v2/2; λ)</span>
232 where <span class="serif_italic">B<sub>x</sub>(a, b; λ)</span> is the
233 noncentral beta distribution CDF and
236 <span class="serif_italic">y = x * v1 / v2</span>
251 <span class="serif_italic">q = 1 - B<sub>y</sub>(v1/2, v2/2; λ)</span>
254 where <span class="serif_italic">1 - B<sub>x</sub>(a, b; λ)</span> is
255 the complement of the noncentral beta distribution CDF and
258 <span class="serif_italic">y = x * v1 / v2</span>
273 <span class="serif_italic">x = (bx / (1-bx)) * (v1 / v2)</span>
279 <span class="serif_italic">bx = Q<sub>p</sub><sup>-1</sup>(v1/2, v2/2; λ)</span>
285 <span class="serif_italic">Q<sub>p</sub><sup>-1</sup>(v1/2, v2/2; λ)</span>
288 is the noncentral beta quantile.
306 <span class="serif_italic">x = (bx / (1-bx)) * (v1 / v2)</span>
312 <span class="serif_italic">bx = QC<sub>q</sub><sup>-1</sup>(v1/2, v2/2; λ)</span>
318 <span class="serif_italic">QC<sub>q</sub><sup>-1</sup>(v1/2, v2/2; λ)</span>
321 is the noncentral beta quantile from the complement.
333 <span class="serif_italic">v2 * (v1 + l) / (v1 * (v2 - 2))</span>
345 By numeric maximalisation of the PDF.
357 Refer to, <a href="http://mathworld.wolfram.com/NoncentralF-Distribution.html" target="_top">Weisstein,
358 Eric W. "Noncentral F-Distribution." From MathWorld--A
359 Wolfram Web Resource.</a>
371 Refer to, <a href="http://mathworld.wolfram.com/NoncentralF-Distribution.html" target="_top">Weisstein,
372 Eric W. "Noncentral F-Distribution." From MathWorld--A
373 Wolfram Web Resource.</a>, and to the <a href="http://reference.wolfram.com/mathematica/ref/NoncentralFRatioDistribution.html" target="_top">Mathematica
381 kurtosis and kurtosis excess
386 Refer to, <a href="http://mathworld.wolfram.com/NoncentralF-Distribution.html" target="_top">Weisstein,
387 Eric W. "Noncentral F-Distribution." From MathWorld--A
388 Wolfram Web Resource.</a>, and to the <a href="http://reference.wolfram.com/mathematica/ref/NoncentralFRatioDistribution.html" target="_top">Mathematica
396 Some analytic properties of noncentral distributions (particularly unimodality,
397 and monotonicity of their modes) are surveyed and summarized by:
400 Andrea van Aubel & Wolfgang Gawronski, Applied Mathematics and Computation,
404 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
405 <td align="left"></td>
406 <td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar
407 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
408 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
409 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
410 Daryle Walker and Xiaogang Zhang<p>
411 Distributed under the Boost Software License, Version 1.0. (See accompanying
412 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>)
417 <div class="spirit-nav">
418 <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>