File: nc_f.qbk

package info (click to toggle)
boost1.49 1.49.0-3.2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 427,096 kB
  • sloc: cpp: 1,806,930; xml: 101,307; ansic: 43,491; python: 28,668; sh: 11,922; cs: 2,118; perl: 714; makefile: 671; yacc: 456; asm: 353; php: 116; lisp: 60; sql: 13; csh: 6
file content (193 lines) | stat: -rw-r--r-- 5,552 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[section:nc_f_dist Noncentral F Distribution]

``#include <boost/math/distributions/non_central_f.hpp>``

   namespace boost{ namespace math{ 

   template <class RealType = double, 
             class ``__Policy``   = ``__policy_class`` >
   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 non-centrality parameter lambda:
      RealType non_centrality()const;
   };
   
   }} // namespaces
   
The noncentral F distribution is a generalization of the __F_distrib.
It is defined as the ratio 

   F = (X/v1) / (Y/v2)
   
where X is a noncentral [chi][super 2]
random variable with /v1/ degrees of freedom and non-centrality parameter [lambda], 
and Y is a central [chi][super 2] random variable with /v2/ degrees of freedom.

This gives the following PDF:

[equation nc_f_ref1]

where L[sub a][super b](c) is a generalised Laguerre polynomial and B(a,b) is the 
__beta function, or

[equation nc_f_ref2]

The following graph illustrates how the distribution changes
for different values of [lambda]:

[graph nc_f_pdf]

[h4 Member Functions]

      non_central_f_distribution(RealType v1, RealType v2, RealType lambda);
      
Constructs a non-central beta distribution with parameters /v1/ and /v2/
and non-centrality 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 non-centrality parameter /lambda/ from which this object was constructed.

[h4 Non-member Accessors]

All the [link math_toolkit.dist.dist_ref.nmp usual non-member accessor functions]
that are generic to all distributions are supported: __usual_accessors.

The domain of the random variable is \[0, +[infin]\].

[h4 Accuracy]

This distribution is implemented in terms of the
__non_central_beta_distrib: refer to that distribution for accuracy data.

[h4 Tests]

Since this distribution is implemented by adapting another distribution, 
the tests consist of basic sanity checks computed by the
[@http://www.r-project.org/ R-2.5.1 Math library statistical
package] and its pbeta and dbeta functions.

[h4 Implementation]

In the following table /v1/ and /v2/ are the first and second
degrees of freedom parameters of the distribution, [lambda]
is the non-centrality parameter,
/x/ is the random variate, /p/ is the probability, and /q = 1-p/.

[table
[[Function][Implementation Notes]]
[[pdf][Implemented in terms of the non-central beta PDF using the relation:

f(x;v1,v2;[lambda]) = (v1\/v2) / ((1+y)*(1+y)) * g(y\/(1+y);v1\/2,v2\/2;[lambda])

where g(x; a, b; [lambda]) is the non central beta PDF, and:

y = x * v1 \/ v2
]]
[[cdf][Using the relation:

p = B[sub y](v1\/2, v2\/2; [lambda])

where B[sub x](a, b; [lambda]) is the noncentral beta distribution CDF and

y = x * v1 \/ v2

]]

[[cdf complement][Using the relation:

q = 1 - B[sub y](v1\/2, v2\/2; [lambda])

where 1 - B[sub x](a, b; [lambda]) is the complement of the 
noncentral beta distribution CDF and

y = x * v1 \/ v2

]]
[[quantile][Using the relation:

x = (bx \/ (1-bx)) * (v1 \/ v2)

where

bx = Q[sub p][super -1](v1\/2, v2\/2; [lambda])

and 

Q[sub p][super -1](v1\/2, v2\/2; [lambda])

is the noncentral beta quantile.

]]
[[quantile

from the complement][
Using the relation:

x = (bx \/ (1-bx)) * (v1 \/ v2)

where

bx = QC[sub q][super -1](v1\/2, v2\/2; [lambda])

and 

QC[sub q][super -1](v1\/2, v2\/2; [lambda])

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, [@http://mathworld.wolfram.com/NoncentralF-Distribution.html
    Weisstein, Eric W. "Noncentral F-Distribution." From MathWorld--A Wolfram Web Resource.]  ]]
[[skewness][Refer to, [@http://mathworld.wolfram.com/NoncentralF-Distribution.html
    Weisstein, Eric W. "Noncentral F-Distribution." From MathWorld--A Wolfram Web Resource.],
    and to the [@http://reference.wolfram.com/mathematica/ref/NoncentralFRatioDistribution.html
    Mathematica documentation]  ]]
[[kurtosis and kurtosis excess]
    [Refer to, [@http://mathworld.wolfram.com/NoncentralF-Distribution.html
    Weisstein, Eric W. "Noncentral F-Distribution." From MathWorld--A Wolfram Web Resource.],
    and to the [@http://reference.wolfram.com/mathematica/ref/NoncentralFRatioDistribution.html
    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) 3-12.

[endsect] [/section:nc_f_dist]

[/ nc_f.qbk
  Copyright 2008 John Maddock and Paul A. Bristow.
  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt).
]