]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
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"> | |
11 | </head> | |
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> | |
20 | </tr></table> | |
21 | <hr> | |
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> | |
24 | </div> | |
25 | <div class="section"> | |
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 | |
28 | Distribution</a> | |
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> | |
32 | ||
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> | |
36 | ||
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> | |
38 | ||
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> | |
45 | ||
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> | |
48 | ||
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> | |
52 | ||
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> | |
56 | ||
57 | <span class="special">}}</span> <span class="comment">// namespaces</span> | |
58 | </pre> | |
59 | <p> | |
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 | |
62 | </p> | |
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> | |
64 | </pre> | |
65 | <p> | |
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. | |
70 | </p> | |
71 | <p> | |
72 | This gives the following PDF: | |
73 | </p> | |
74 | <p> | |
75 | <span class="inlinemediaobject"><img src="../../../../equations/nc_f_ref1.svg"></span> | |
76 | </p> | |
77 | <p> | |
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 | |
79 | </p> | |
80 | <p> | |
81 | <span class="inlinemediaobject"><img src="../../../../equations/nc_f_ref2.svg"></span> | |
82 | </p> | |
83 | <p> | |
84 | The following graph illustrates how the distribution changes for different | |
85 | values of λ: | |
86 | </p> | |
87 | <p> | |
88 | <span class="inlinemediaobject"><img src="../../../../graphs/nc_f_pdf.svg" align="middle"></span> | |
89 | </p> | |
90 | <h5> | |
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 | |
93 | Functions</a> | |
94 | </h5> | |
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> | |
96 | </pre> | |
97 | <p> | |
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>. | |
100 | </p> | |
101 | <p> | |
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>. | |
103 | </p> | |
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> | |
105 | </pre> | |
106 | <p> | |
107 | Returns the parameter <span class="emphasis"><em>v1</em></span> from which this object was | |
108 | constructed. | |
109 | </p> | |
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> | |
111 | </pre> | |
112 | <p> | |
113 | Returns the parameter <span class="emphasis"><em>v2</em></span> from which this object was | |
114 | constructed. | |
115 | </p> | |
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> | |
117 | </pre> | |
118 | <p> | |
119 | Returns the non-centrality parameter <span class="emphasis"><em>lambda</em></span> from which | |
120 | this object was constructed. | |
121 | </p> | |
122 | <h5> | |
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 | |
125 | Accessors</a> | |
126 | </h5> | |
127 | <p> | |
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>. | |
138 | </p> | |
139 | <p> | |
140 | The domain of the random variable is [0, +∞]. | |
141 | </p> | |
142 | <h5> | |
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> | |
145 | </h5> | |
146 | <p> | |
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. | |
149 | </p> | |
150 | <h5> | |
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> | |
153 | </h5> | |
154 | <p> | |
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. | |
158 | </p> | |
159 | <h5> | |
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> | |
162 | </h5> | |
163 | <p> | |
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, | |
166 | λ | |
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>. | |
169 | </p> | |
170 | <div class="informaltable"><table class="table"> | |
171 | <colgroup> | |
172 | <col> | |
173 | <col> | |
174 | </colgroup> | |
175 | <thead><tr> | |
176 | <th> | |
177 | <p> | |
178 | Function | |
179 | </p> | |
180 | </th> | |
181 | <th> | |
182 | <p> | |
183 | Implementation Notes | |
184 | </p> | |
185 | </th> | |
186 | </tr></thead> | |
187 | <tbody> | |
188 | <tr> | |
189 | <td> | |
190 | <p> | |
191 | ||
192 | </p> | |
193 | </td> | |
194 | <td> | |
195 | <p> | |
196 | Implemented in terms of the non-central beta PDF using the relation: | |
197 | </p> | |
198 | <p> | |
199 | f(x;v1,v2;λ) = (v1/v2) / ((1+y)*(1+y)) * g(y/(1+y);v1/2,v2/2;λ) | |
200 | </p> | |
201 | <p> | |
202 | where g(x; a, b; λ) is the non central beta PDF, and: | |
203 | </p> | |
204 | <p> | |
205 | y = x * v1 / v2 | |
206 | </p> | |
207 | </td> | |
208 | </tr> | |
209 | <tr> | |
210 | <td> | |
211 | <p> | |
212 | cdf | |
213 | </p> | |
214 | </td> | |
215 | <td> | |
216 | <p> | |
217 | Using the relation: | |
218 | </p> | |
219 | <p> | |
220 | p = B<sub>y</sub>(v1/2, v2/2; λ) | |
221 | </p> | |
222 | <p> | |
223 | where B<sub>x</sub>(a, b; λ) is the noncentral beta distribution CDF and | |
224 | </p> | |
225 | <p> | |
226 | y = x * v1 / v2 | |
227 | </p> | |
228 | </td> | |
229 | </tr> | |
230 | <tr> | |
231 | <td> | |
232 | <p> | |
233 | cdf complement | |
234 | </p> | |
235 | </td> | |
236 | <td> | |
237 | <p> | |
238 | Using the relation: | |
239 | </p> | |
240 | <p> | |
241 | q = 1 - B<sub>y</sub>(v1/2, v2/2; λ) | |
242 | </p> | |
243 | <p> | |
244 | where 1 - B<sub>x</sub>(a, b; λ) is the complement of the noncentral beta | |
245 | distribution CDF and | |
246 | </p> | |
247 | <p> | |
248 | y = x * v1 / v2 | |
249 | </p> | |
250 | </td> | |
251 | </tr> | |
252 | <tr> | |
253 | <td> | |
254 | <p> | |
255 | quantile | |
256 | </p> | |
257 | </td> | |
258 | <td> | |
259 | <p> | |
260 | Using the relation: | |
261 | </p> | |
262 | <p> | |
263 | x = (bx / (1-bx)) * (v1 / v2) | |
264 | </p> | |
265 | <p> | |
266 | where | |
267 | </p> | |
268 | <p> | |
269 | bx = Q<sub>p</sub><sup>-1</sup>(v1/2, v2/2; λ) | |
270 | </p> | |
271 | <p> | |
272 | and | |
273 | </p> | |
274 | <p> | |
275 | Q<sub>p</sub><sup>-1</sup>(v1/2, v2/2; λ) | |
276 | </p> | |
277 | <p> | |
278 | is the noncentral beta quantile. | |
279 | </p> | |
280 | </td> | |
281 | </tr> | |
282 | <tr> | |
283 | <td> | |
284 | <p> | |
285 | quantile | |
286 | </p> | |
287 | <p> | |
288 | from the complement | |
289 | </p> | |
290 | </td> | |
291 | <td> | |
292 | <p> | |
293 | Using the relation: | |
294 | </p> | |
295 | <p> | |
296 | x = (bx / (1-bx)) * (v1 / v2) | |
297 | </p> | |
298 | <p> | |
299 | where | |
300 | </p> | |
301 | <p> | |
302 | bx = QC<sub>q</sub><sup>-1</sup>(v1/2, v2/2; λ) | |
303 | </p> | |
304 | <p> | |
305 | and | |
306 | </p> | |
307 | <p> | |
308 | QC<sub>q</sub><sup>-1</sup>(v1/2, v2/2; λ) | |
309 | </p> | |
310 | <p> | |
311 | is the noncentral beta quantile from the complement. | |
312 | </p> | |
313 | </td> | |
314 | </tr> | |
315 | <tr> | |
316 | <td> | |
317 | <p> | |
318 | mean | |
319 | </p> | |
320 | </td> | |
321 | <td> | |
322 | <p> | |
323 | v2 * (v1 + l) / (v1 * (v2 - 2)) | |
324 | </p> | |
325 | </td> | |
326 | </tr> | |
327 | <tr> | |
328 | <td> | |
329 | <p> | |
330 | mode | |
331 | </p> | |
332 | </td> | |
333 | <td> | |
334 | <p> | |
335 | By numeric maximalisation of the PDF. | |
336 | </p> | |
337 | </td> | |
338 | </tr> | |
339 | <tr> | |
340 | <td> | |
341 | <p> | |
342 | variance | |
343 | </p> | |
344 | </td> | |
345 | <td> | |
346 | <p> | |
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> | |
350 | </p> | |
351 | </td> | |
352 | </tr> | |
353 | <tr> | |
354 | <td> | |
355 | <p> | |
356 | skewness | |
357 | </p> | |
358 | </td> | |
359 | <td> | |
360 | <p> | |
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 | |
364 | documentation</a> | |
365 | </p> | |
366 | </td> | |
367 | </tr> | |
368 | <tr> | |
369 | <td> | |
370 | <p> | |
371 | kurtosis and kurtosis excess | |
372 | </p> | |
373 | </td> | |
374 | <td> | |
375 | <p> | |
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 | |
379 | documentation</a> | |
380 | </p> | |
381 | </td> | |
382 | </tr> | |
383 | </tbody> | |
384 | </table></div> | |
385 | <p> | |
386 | Some analytic properties of noncentral distributions (particularly unimodality, | |
387 | and monotonicity of their modes) are surveyed and summarized by: | |
388 | </p> | |
389 | <p> | |
390 | Andrea van Aubel & Wolfgang Gawronski, Applied Mathematics and Computation, | |
391 | 141 (2003) 3-12. | |
392 | </p> | |
393 | </div> | |
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>) | |
402 | </p> | |
403 | </div></td> | |
404 | </tr></table> | |
405 | <hr> | |
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> | |
408 | </div> | |
409 | </body> | |
410 | </html> |