]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>Non-Member Properties</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="../dist_ref.html" title="Statistical Distributions Reference"> | |
9 | <link rel="prev" href="../dist_ref.html" title="Statistical Distributions Reference"> | |
10 | <link rel="next" href="dists.html" title="Distributions"> | |
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="../dist_ref.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dist_ref.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="dists.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="math_toolkit.dist_ref.nmp"></a><a class="link" href="nmp.html" title="Non-Member Properties">Non-Member Properties</a> | |
28 | </h3></div></div></div> | |
29 | <p> | |
30 | Properties that are common to all distributions are accessed via non-member | |
31 | getter functions: non-membership allows more of these functions to be added | |
32 | over time, as the need arises. Unfortunately the literature uses many different | |
33 | and confusing names to refer to a rather small number of actual concepts; | |
34 | refer to the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.concept_index">concept | |
35 | index</a> to find the property you want by the name you are most familiar | |
36 | with. Or use the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.function_index">function | |
37 | index</a> to go straight to the function you want if you already know | |
38 | its name. | |
39 | </p> | |
40 | <h5> | |
41 | <a name="math_toolkit.dist_ref.nmp.h0"></a> | |
42 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.function_index"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.function_index">Function | |
43 | Index</a> | |
44 | </h5> | |
45 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | |
46 | <li class="listitem"> | |
47 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution | |
48 | Function</a>. | |
49 | </li> | |
50 | <li class="listitem"> | |
51 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.ccdf">Complement of the Cumulative | |
52 | Distribution Function</a>. | |
53 | </li> | |
54 | <li class="listitem"> | |
55 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative Hazard Function</a>. | |
56 | </li> | |
57 | <li class="listitem"> | |
58 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard Function</a>. | |
59 | </li> | |
60 | <li class="listitem"> | |
61 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.kurtosis">kurtosis</a>. | |
62 | </li> | |
63 | <li class="listitem"> | |
64 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">kurtosis_excess</a> | |
65 | </li> | |
66 | <li class="listitem"> | |
67 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.mean">mean</a>. | |
68 | </li> | |
69 | <li class="listitem"> | |
70 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.median">median</a>. | |
71 | </li> | |
72 | <li class="listitem"> | |
73 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.mode">mode</a>. | |
74 | </li> | |
75 | <li class="listitem"> | |
76 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>. | |
77 | </li> | |
78 | <li class="listitem"> | |
79 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.range">range</a>. | |
80 | </li> | |
81 | <li class="listitem"> | |
82 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>. | |
83 | </li> | |
84 | <li class="listitem"> | |
85 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile_c">Quantile from the | |
86 | complement of the probability</a>. | |
87 | </li> | |
88 | <li class="listitem"> | |
89 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.skewness">skewness</a>. | |
90 | </li> | |
91 | <li class="listitem"> | |
92 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation</a>. | |
93 | </li> | |
94 | <li class="listitem"> | |
95 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.support">support</a>. | |
96 | </li> | |
97 | <li class="listitem"> | |
98 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.variance">variance</a>. | |
99 | </li> | |
100 | </ul></div> | |
101 | <h5> | |
102 | <a name="math_toolkit.dist_ref.nmp.h1"></a> | |
103 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.concept_index"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.concept_index">Conceptual | |
104 | Index</a> | |
105 | </h5> | |
106 | <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> | |
107 | <li class="listitem"> | |
108 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.ccdf">Complement of the Cumulative | |
109 | Distribution Function</a>. | |
110 | </li> | |
111 | <li class="listitem"> | |
112 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution | |
113 | Function</a>. | |
114 | </li> | |
115 | <li class="listitem"> | |
116 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative Hazard Function</a>. | |
117 | </li> | |
118 | <li class="listitem"> | |
119 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf_inv">Inverse Cumulative | |
120 | Distribution Function</a>. | |
121 | </li> | |
122 | <li class="listitem"> | |
123 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.survival_inv">Inverse Survival | |
124 | Function</a>. | |
125 | </li> | |
126 | <li class="listitem"> | |
127 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard Function</a> | |
128 | </li> | |
129 | <li class="listitem"> | |
130 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.lower_critical">Lower Critical | |
131 | Value</a>. | |
132 | </li> | |
133 | <li class="listitem"> | |
134 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.kurtosis">kurtosis</a>. | |
135 | </li> | |
136 | <li class="listitem"> | |
137 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">kurtosis_excess</a> | |
138 | </li> | |
139 | <li class="listitem"> | |
140 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.mean">mean</a>. | |
141 | </li> | |
142 | <li class="listitem"> | |
143 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.median">median</a>. | |
144 | </li> | |
145 | <li class="listitem"> | |
146 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.mode">mode</a>. | |
147 | </li> | |
148 | <li class="listitem"> | |
149 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdfPQ">P</a>. | |
150 | </li> | |
151 | <li class="listitem"> | |
152 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.percent">Percent Point Function</a>. | |
153 | </li> | |
154 | <li class="listitem"> | |
155 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>. | |
156 | </li> | |
157 | <li class="listitem"> | |
158 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pmf">Probability Mass Function</a>. | |
159 | </li> | |
160 | <li class="listitem"> | |
161 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.range">range</a>. | |
162 | </li> | |
163 | <li class="listitem"> | |
164 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdfPQ">Q</a>. | |
165 | </li> | |
166 | <li class="listitem"> | |
167 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>. | |
168 | </li> | |
169 | <li class="listitem"> | |
170 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile_c">Quantile from the | |
171 | complement of the probability</a>. | |
172 | </li> | |
173 | <li class="listitem"> | |
174 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.skewness">skewness</a>. | |
175 | </li> | |
176 | <li class="listitem"> | |
177 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.sd">standard deviation</a> | |
178 | </li> | |
179 | <li class="listitem"> | |
180 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.survival">Survival Function</a>. | |
181 | </li> | |
182 | <li class="listitem"> | |
183 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.support">support</a>. | |
184 | </li> | |
185 | <li class="listitem"> | |
186 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.upper_critical">Upper Critical | |
187 | Value</a>. | |
188 | </li> | |
189 | <li class="listitem"> | |
190 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.variance">variance</a>. | |
191 | </li> | |
192 | </ul></div> | |
193 | <h5> | |
194 | <a name="math_toolkit.dist_ref.nmp.h2"></a> | |
195 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.cdf"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative | |
196 | Distribution Function</a> | |
197 | </h5> | |
198 | <pre class="programlisting"><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> | |
199 | <span class="identifier">RealType</span> <span class="identifier">cdf</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&</span> <span class="identifier">x</span><span class="special">);</span> | |
200 | </pre> | |
201 | <p> | |
202 | The <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative Distribution | |
203 | Function</a> is the probability that the variable takes a value less than | |
204 | or equal to x. It is equivalent to the integral from -infinity to x of the | |
205 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density Function</a>. | |
206 | </p> | |
207 | <p> | |
208 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
209 | if the random variable is outside the defined range for the distribution. | |
210 | </p> | |
211 | <p> | |
212 | For example, the following graph shows the cdf for the normal distribution: | |
213 | </p> | |
214 | <p> | |
215 | <span class="inlinemediaobject"><img src="../../../graphs/cdf.png"></span> | |
216 | </p> | |
217 | <h5> | |
218 | <a name="math_toolkit.dist_ref.nmp.h3"></a> | |
219 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.ccdf"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.ccdf">Complement | |
220 | of the Cumulative Distribution Function</a> | |
221 | </h5> | |
222 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Distribution</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">></span> | |
223 | <span class="identifier">RealType</span> <span class="identifier">cdf</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Unspecified-Complement-Type</em></span><span class="special"><</span><span class="identifier">Distribution</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">>&</span> <span class="identifier">comp</span><span class="special">);</span> | |
224 | </pre> | |
225 | <p> | |
226 | The complement of the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative | |
227 | Distribution Function</a> is the probability that the variable takes a | |
228 | value greater than x. It is equivalent to the integral from x to infinity | |
229 | of the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density | |
230 | Function</a>, or 1 minus the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative | |
231 | Distribution Function</a> of x. | |
232 | </p> | |
233 | <p> | |
234 | This is also known as the survival function. | |
235 | </p> | |
236 | <p> | |
237 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
238 | if the random variable is outside the defined range for the distribution. | |
239 | </p> | |
240 | <p> | |
241 | In this library, it is obtained by wrapping the arguments to the <code class="computeroutput"><span class="identifier">cdf</span></code> function in a call to <code class="computeroutput"><span class="identifier">complement</span></code>, for example: | |
242 | </p> | |
243 | <pre class="programlisting"><span class="comment">// standard normal distribution object:</span> | |
244 | <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">normal</span> <span class="identifier">norm</span><span class="special">;</span> | |
245 | <span class="comment">// print survival function for x=2.0:</span> | |
246 | <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">norm</span><span class="special">,</span> <span class="number">2.0</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> | |
247 | </pre> | |
248 | <p> | |
249 | For example, the following graph shows the __complement of the cdf for the | |
250 | normal distribution: | |
251 | </p> | |
252 | <p> | |
253 | <span class="inlinemediaobject"><img src="../../../graphs/survival.png"></span> | |
254 | </p> | |
255 | <p> | |
256 | See <a class="link" href="../stat_tut/overview/complements.html#why_complements">why complements?</a> for why the complement | |
257 | is useful and when it should be used. | |
258 | </p> | |
259 | <h5> | |
260 | <a name="math_toolkit.dist_ref.nmp.h4"></a> | |
261 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.hazard"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard | |
262 | Function</a> | |
263 | </h5> | |
264 | <pre class="programlisting"><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> | |
265 | <span class="identifier">RealType</span> <span class="identifier">hazard</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&</span> <span class="identifier">x</span><span class="special">);</span> | |
266 | </pre> | |
267 | <p> | |
268 | Returns the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.hazard">Hazard Function</a> | |
269 | of <span class="emphasis"><em>x</em></span> and distibution <span class="emphasis"><em>dist</em></span>. | |
270 | </p> | |
271 | <p> | |
272 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
273 | if the random variable is outside the defined range for the distribution. | |
274 | </p> | |
275 | <p> | |
276 | <span class="inlinemediaobject"><img src="../../../equations/hazard.svg"></span> | |
277 | </p> | |
278 | <div class="caution"><table border="0" summary="Caution"> | |
279 | <tr> | |
280 | <td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../doc/src/images/caution.png"></td> | |
281 | <th align="left">Caution</th> | |
282 | </tr> | |
283 | <tr><td align="left" valign="top"><p> | |
284 | Some authors refer to this as the conditional failure density function | |
285 | rather than the hazard function. | |
286 | </p></td></tr> | |
287 | </table></div> | |
288 | <h5> | |
289 | <a name="math_toolkit.dist_ref.nmp.h5"></a> | |
290 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.chf"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative | |
291 | Hazard Function</a> | |
292 | </h5> | |
293 | <pre class="programlisting"><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> | |
294 | <span class="identifier">RealType</span> <span class="identifier">chf</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&</span> <span class="identifier">x</span><span class="special">);</span> | |
295 | </pre> | |
296 | <p> | |
297 | Returns the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.chf">Cumulative Hazard | |
298 | Function</a> of <span class="emphasis"><em>x</em></span> and distibution <span class="emphasis"><em>dist</em></span>. | |
299 | </p> | |
300 | <p> | |
301 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
302 | if the random variable is outside the defined range for the distribution. | |
303 | </p> | |
304 | <p> | |
305 | <span class="inlinemediaobject"><img src="../../../equations/chf.svg"></span> | |
306 | </p> | |
307 | <div class="caution"><table border="0" summary="Caution"> | |
308 | <tr> | |
309 | <td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../doc/src/images/caution.png"></td> | |
310 | <th align="left">Caution</th> | |
311 | </tr> | |
312 | <tr><td align="left" valign="top"><p> | |
313 | Some authors refer to this as simply the "Hazard Function". | |
314 | </p></td></tr> | |
315 | </table></div> | |
316 | <h5> | |
317 | <a name="math_toolkit.dist_ref.nmp.h6"></a> | |
318 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.mean"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.mean">mean</a> | |
319 | </h5> | |
320 | <pre class="programlisting"><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> | |
321 | <span class="identifier">RealType</span> <span class="identifier">mean</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
322 | </pre> | |
323 | <p> | |
324 | Returns the mean of the distribution <span class="emphasis"><em>dist</em></span>. | |
325 | </p> | |
326 | <p> | |
327 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
328 | if the distribution does not have a defined mean (for example the Cauchy | |
329 | distribution). | |
330 | </p> | |
331 | <h5> | |
332 | <a name="math_toolkit.dist_ref.nmp.h7"></a> | |
333 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.median"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.median">median</a> | |
334 | </h5> | |
335 | <pre class="programlisting"><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> | |
336 | <span class="identifier">RealType</span> <span class="identifier">median</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
337 | </pre> | |
338 | <p> | |
339 | Returns the median of the distribution <span class="emphasis"><em>dist</em></span>. | |
340 | </p> | |
341 | <h5> | |
342 | <a name="math_toolkit.dist_ref.nmp.h8"></a> | |
343 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.mode"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.mode">mode</a> | |
344 | </h5> | |
345 | <pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
346 | <span class="identifier">RealType</span> <span class="identifier">mode</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
347 | </pre> | |
348 | <p> | |
349 | Returns the mode of the distribution <span class="emphasis"><em>dist</em></span>. | |
350 | </p> | |
351 | <p> | |
352 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
353 | if the distribution does not have a defined mode. | |
354 | </p> | |
355 | <h5> | |
356 | <a name="math_toolkit.dist_ref.nmp.h9"></a> | |
357 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.pdf"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability | |
358 | Density Function</a> | |
359 | </h5> | |
360 | <pre class="programlisting"><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> | |
361 | <span class="identifier">RealType</span> <span class="identifier">pdf</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&</span> <span class="identifier">x</span><span class="special">);</span> | |
362 | </pre> | |
363 | <p> | |
364 | For a continuous function, the probability density function (pdf) returns | |
365 | the probability that the variate has the value x. Since for continuous distributions | |
366 | the probability at a single point is actually zero, the probability is better | |
367 | expressed as the integral of the pdf between two points: see the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative | |
368 | Distribution Function</a>. | |
369 | </p> | |
370 | <p> | |
371 | For a discrete distribution, the pdf is the probability that the variate | |
372 | takes the value x. | |
373 | </p> | |
374 | <p> | |
375 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
376 | if the random variable is outside the defined range for the distribution. | |
377 | </p> | |
378 | <p> | |
379 | For example, for a standard normal distribution the pdf looks like this: | |
380 | </p> | |
381 | <p> | |
382 | <span class="inlinemediaobject"><img src="../../../graphs/pdf.png"></span> | |
383 | </p> | |
384 | <h5> | |
385 | <a name="math_toolkit.dist_ref.nmp.h10"></a> | |
386 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.range"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.range">Range</a> | |
387 | </h5> | |
388 | <pre class="programlisting"><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> | |
389 | <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">></span> <span class="identifier">range</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
390 | </pre> | |
391 | <p> | |
392 | Returns the valid range of the random variable over distribution <span class="emphasis"><em>dist</em></span>. | |
393 | </p> | |
394 | <h5> | |
395 | <a name="math_toolkit.dist_ref.nmp.h11"></a> | |
396 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.quantile"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a> | |
397 | </h5> | |
398 | <pre class="programlisting"><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> | |
399 | <span class="identifier">RealType</span> <span class="identifier">quantile</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&</span> <span class="identifier">p</span><span class="special">);</span> | |
400 | </pre> | |
401 | <p> | |
402 | The quantile is best viewed as the inverse of the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative | |
403 | Distribution Function</a>, it returns a value <span class="emphasis"><em>x</em></span> such | |
404 | that <code class="computeroutput"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">dist</span><span class="special">,</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">==</span> | |
405 | <span class="identifier">p</span></code>. | |
406 | </p> | |
407 | <p> | |
408 | This is also known as the <span class="emphasis"><em>percent point function</em></span>, or | |
409 | <span class="emphasis"><em>percentile</em></span>, or <span class="emphasis"><em>fractile</em></span>, it is | |
410 | also the same as calculating the <span class="emphasis"><em>lower critical value</em></span> | |
411 | of a distribution. | |
412 | </p> | |
413 | <p> | |
414 | This function returns a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
415 | if the probability lies outside [0,1]. The function may return an <a class="link" href="../error_handling.html#math_toolkit.error_handling.overflow_error">overflow_error</a> | |
416 | if there is no finite value that has the specified probability. | |
417 | </p> | |
418 | <p> | |
419 | The following graph shows the quantile function for a standard normal distribution: | |
420 | </p> | |
421 | <p> | |
422 | <span class="inlinemediaobject"><img src="../../../graphs/quantile.png"></span> | |
423 | </p> | |
424 | <h5> | |
425 | <a name="math_toolkit.dist_ref.nmp.h12"></a> | |
426 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.quantile_c"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile_c">Quantile | |
427 | from the complement of the probability.</a> | |
428 | </h5> | |
429 | <p> | |
430 | See also <a class="link" href="../stat_tut/overview/complements.html" title="Complements are supported too - and when to use them">complements</a>. | |
431 | </p> | |
432 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Distribution</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">></span> | |
433 | <span class="identifier">RealType</span> <span class="identifier">quantile</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Unspecified-Complement-Type</em></span><span class="special"><</span><span class="identifier">Distribution</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">>&</span> <span class="identifier">comp</span><span class="special">);</span> | |
434 | </pre> | |
435 | <p> | |
436 | This is the inverse of the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.ccdf">Complement | |
437 | of the Cumulative Distribution Function</a>. It is calculated by wrapping | |
438 | the arguments in a call to the quantile function in a call to <span class="emphasis"><em>complement</em></span>. | |
439 | For example: | |
440 | </p> | |
441 | <pre class="programlisting"><span class="comment">// define a standard normal distribution:</span> | |
442 | <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">normal</span> <span class="identifier">norm</span><span class="special">;</span> | |
443 | <span class="comment">// print the value of x for which the complement</span> | |
444 | <span class="comment">// of the probability is 0.05:</span> | |
445 | <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">norm</span><span class="special">,</span> <span class="number">0.05</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> | |
446 | </pre> | |
447 | <p> | |
448 | The function computes a value <span class="emphasis"><em>x</em></span> such that <code class="computeroutput"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist</span><span class="special">,</span> | |
449 | <span class="identifier">x</span><span class="special">))</span> <span class="special">==</span> <span class="identifier">q</span></code> where | |
450 | <span class="emphasis"><em>q</em></span> is complement of the probability. | |
451 | </p> | |
452 | <p> | |
453 | <a class="link" href="../stat_tut/overview/complements.html#why_complements">Why complements?</a> | |
454 | </p> | |
455 | <p> | |
456 | This function is also called the inverse survival function, and is the same | |
457 | as calculating the <span class="emphasis"><em>upper critical value</em></span> of a distribution. | |
458 | </p> | |
459 | <p> | |
460 | This function returns a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
461 | if the probablity lies outside [0,1]. The function may return an <a class="link" href="../error_handling.html#math_toolkit.error_handling.overflow_error">overflow_error</a> | |
462 | if there is no finite value that has the specified probability. | |
463 | </p> | |
464 | <p> | |
465 | The following graph show the inverse survival function for the normal distribution: | |
466 | </p> | |
467 | <p> | |
468 | <span class="inlinemediaobject"><img src="../../../graphs/survival_inv.png"></span> | |
469 | </p> | |
470 | <h5> | |
471 | <a name="math_toolkit.dist_ref.nmp.h13"></a> | |
472 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.sd"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.sd">Standard | |
473 | Deviation</a> | |
474 | </h5> | |
475 | <pre class="programlisting"><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> | |
476 | <span class="identifier">RealType</span> <span class="identifier">standard_deviation</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
477 | </pre> | |
478 | <p> | |
479 | Returns the standard deviation of distribution <span class="emphasis"><em>dist</em></span>. | |
480 | </p> | |
481 | <p> | |
482 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
483 | if the distribution does not have a defined standard deviation. | |
484 | </p> | |
485 | <h5> | |
486 | <a name="math_toolkit.dist_ref.nmp.h14"></a> | |
487 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.support"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.support">support</a> | |
488 | </h5> | |
489 | <pre class="programlisting"><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> | |
490 | <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">></span> <span class="identifier">support</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
491 | </pre> | |
492 | <p> | |
493 | Returns the supported range of random variable over the distribution <span class="emphasis"><em>dist</em></span>. | |
494 | </p> | |
495 | <p> | |
496 | The distribution is said to be 'supported' over a range that is <a href="http://en.wikipedia.org/wiki/Probability_distribution" target="_top">"the | |
497 | smallest closed set whose complement has probability zero"</a>. | |
498 | Non-mathematicians might say it means the 'interesting' smallest range of | |
499 | random variate x that has the cdf going from zero to unity. Outside are uninteresting | |
500 | zones where the pdf is zero, and the cdf zero or unity. | |
501 | </p> | |
502 | <h5> | |
503 | <a name="math_toolkit.dist_ref.nmp.h15"></a> | |
504 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.variance"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.variance">Variance</a> | |
505 | </h5> | |
506 | <pre class="programlisting"><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> | |
507 | <span class="identifier">RealType</span> <span class="identifier">variance</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
508 | </pre> | |
509 | <p> | |
510 | Returns the variance of the distribution <span class="emphasis"><em>dist</em></span>. | |
511 | </p> | |
512 | <p> | |
513 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
514 | if the distribution does not have a defined variance. | |
515 | </p> | |
516 | <h5> | |
517 | <a name="math_toolkit.dist_ref.nmp.h16"></a> | |
518 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.skewness"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.skewness">Skewness</a> | |
519 | </h5> | |
520 | <pre class="programlisting"><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> | |
521 | <span class="identifier">RealType</span> <span class="identifier">skewness</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
522 | </pre> | |
523 | <p> | |
524 | Returns the skewness of the distribution <span class="emphasis"><em>dist</em></span>. | |
525 | </p> | |
526 | <p> | |
527 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
528 | if the distribution does not have a defined skewness. | |
529 | </p> | |
530 | <h5> | |
531 | <a name="math_toolkit.dist_ref.nmp.h17"></a> | |
532 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.kurtosis"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.kurtosis">Kurtosis</a> | |
533 | </h5> | |
534 | <pre class="programlisting"><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> | |
535 | <span class="identifier">RealType</span> <span class="identifier">kurtosis</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
536 | </pre> | |
537 | <p> | |
538 | Returns the 'proper' kurtosis (normalized fourth moment) of the distribution | |
539 | <span class="emphasis"><em>dist</em></span>. | |
540 | </p> | |
541 | <p> | |
542 | kertosis = β<sub>2</sub>  = μ<sub>4</sub>   / μ<sub>2</sub><sup>2</sup> | |
543 | </p> | |
544 | <p> | |
545 | Where μ<sub>i</sub>   is the i'th central moment of the distribution, and in particular | |
546 | μ<sub>2</sub>   is the variance of the distribution. | |
547 | </p> | |
548 | <p> | |
549 | The kurtosis is a measure of the "peakedness" of a distribution. | |
550 | </p> | |
551 | <p> | |
552 | Note that the literature definition of kurtosis is confusing. The definition | |
553 | used here is that used by for example <a href="http://mathworld.wolfram.com/Kurtosis.html" target="_top">Wolfram | |
554 | MathWorld</a> (that includes a table of formulae for kurtosis excess | |
555 | for various distributions) but NOT the definition of <a href="http://en.wikipedia.org/wiki/Kurtosis" target="_top">kurtosis | |
556 | used by Wikipedia</a> which treats "kurtosis" and "kurtosis | |
557 | excess" as the same quantity. | |
558 | </p> | |
559 | <pre class="programlisting"><span class="identifier">kurtosis_excess</span> <span class="special">=</span> <span class="char">'proper'</span> <span class="identifier">kurtosis</span> <span class="special">-</span> <span class="number">3</span> | |
560 | </pre> | |
561 | <p> | |
562 | This subtraction of 3 is convenient so that the <span class="emphasis"><em>kurtosis excess</em></span> | |
563 | of a normal distribution is zero. | |
564 | </p> | |
565 | <p> | |
566 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
567 | if the distribution does not have a defined kurtosis. | |
568 | </p> | |
569 | <p> | |
570 | 'Proper' kurtosis can have a value from zero to + infinity. | |
571 | </p> | |
572 | <h5> | |
573 | <a name="math_toolkit.dist_ref.nmp.h18"></a> | |
574 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.kurtosis_excess"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.kurtosis_excess">Kurtosis | |
575 | excess</a> | |
576 | </h5> | |
577 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
578 | <span class="identifier">RealType</span> <span class="identifier">kurtosis_excess</span><span class="special">(</span><span class="keyword">const</span> <span class="emphasis"><em>Distribution-Type</em></span><span class="special"><</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">>&</span> <span class="identifier">dist</span><span class="special">);</span> | |
579 | </pre> | |
580 | <p> | |
581 | Returns the kurtosis excess of the distribution <span class="emphasis"><em>dist</em></span>. | |
582 | </p> | |
583 | <p> | |
584 | kurtosis excess = γ<sub>2</sub>  = μ<sub>4</sub>   / μ<sub>2</sub><sup>2</sup>  - 3 = kurtosis - 3 | |
585 | </p> | |
586 | <p> | |
587 | Where μ<sub>i</sub>   is the i'th central moment of the distribution, and in particular | |
588 | μ<sub>2</sub>   is the variance of the distribution. | |
589 | </p> | |
590 | <p> | |
591 | The kurtosis excess is a measure of the "peakedness" of a distribution, | |
592 | and is more widely used than the "kurtosis proper". It is defined | |
593 | so that the kurtosis excess of a normal distribution is zero. | |
594 | </p> | |
595 | <p> | |
596 | This function may return a <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
597 | if the distribution does not have a defined kurtosis excess. | |
598 | </p> | |
599 | <p> | |
600 | Kurtosis excess can have a value from -2 to + infinity. | |
601 | </p> | |
602 | <pre class="programlisting"><span class="identifier">kurtosis</span> <span class="special">=</span> <span class="identifier">kurtosis_excess</span> <span class="special">+</span><span class="number">3</span><span class="special">;</span> | |
603 | </pre> | |
604 | <p> | |
605 | The kurtosis excess of a normal distribution is zero. | |
606 | </p> | |
607 | <h5> | |
608 | <a name="math_toolkit.dist_ref.nmp.h19"></a> | |
609 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.cdfPQ"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdfPQ">P | |
610 | and Q</a> | |
611 | </h5> | |
612 | <p> | |
613 | The terms P and Q are sometimes used to refer to the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf">Cumulative | |
614 | Distribution Function</a> and its <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.ccdf">complement</a> | |
615 | respectively. Lowercase p and q are sometimes used to refer to the values | |
616 | returned by these functions. | |
617 | </p> | |
618 | <h5> | |
619 | <a name="math_toolkit.dist_ref.nmp.h20"></a> | |
620 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.percent"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.percent">Percent | |
621 | Point Function or Percentile</a> | |
622 | </h5> | |
623 | <p> | |
624 | The percent point function, also known as the percentile, is the same as | |
625 | the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>. | |
626 | </p> | |
627 | <h5> | |
628 | <a name="math_toolkit.dist_ref.nmp.h21"></a> | |
629 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.cdf_inv"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.cdf_inv">Inverse | |
630 | CDF Function.</a> | |
631 | </h5> | |
632 | <p> | |
633 | The inverse of the cumulative distribution function, is the same as the | |
634 | <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>. | |
635 | </p> | |
636 | <h5> | |
637 | <a name="math_toolkit.dist_ref.nmp.h22"></a> | |
638 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.survival_inv"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.survival_inv">Inverse | |
639 | Survival Function.</a> | |
640 | </h5> | |
641 | <p> | |
642 | The inverse of the survival function, is the same as computing the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile_c">quantile from the complement | |
643 | of the probability</a>. | |
644 | </p> | |
645 | <h5> | |
646 | <a name="math_toolkit.dist_ref.nmp.h23"></a> | |
647 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.pmf"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pmf">Probability | |
648 | Mass Function</a> | |
649 | </h5> | |
650 | <p> | |
651 | The Probability Mass Function is the same as the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability | |
652 | Density Function</a>. | |
653 | </p> | |
654 | <p> | |
655 | The term Mass Function is usually applied to discrete distributions, while | |
656 | the term <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.pdf">Probability Density | |
657 | Function</a> applies to continuous distributions. | |
658 | </p> | |
659 | <h5> | |
660 | <a name="math_toolkit.dist_ref.nmp.h24"></a> | |
661 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.lower_critical"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.lower_critical">Lower | |
662 | Critical Value.</a> | |
663 | </h5> | |
664 | <p> | |
665 | The lower critical value calculates the value of the random variable given | |
666 | the area under the left tail of the distribution. It is equivalent to calculating | |
667 | the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile">Quantile</a>. | |
668 | </p> | |
669 | <h5> | |
670 | <a name="math_toolkit.dist_ref.nmp.h25"></a> | |
671 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.upper_critical"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.upper_critical">Upper | |
672 | Critical Value.</a> | |
673 | </h5> | |
674 | <p> | |
675 | The upper critical value calculates the value of the random variable given | |
676 | the area under the right tail of the distribution. It is equivalent to calculating | |
677 | the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.quantile_c">quantile from the | |
678 | complement of the probability</a>. | |
679 | </p> | |
680 | <h5> | |
681 | <a name="math_toolkit.dist_ref.nmp.h26"></a> | |
682 | <span class="phrase"><a name="math_toolkit.dist_ref.nmp.survival"></a></span><a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.survival">Survival | |
683 | Function</a> | |
684 | </h5> | |
685 | <p> | |
686 | Refer to the <a class="link" href="nmp.html#math_toolkit.dist_ref.nmp.ccdf">Complement of | |
687 | the Cumulative Distribution Function</a>. | |
688 | </p> | |
689 | </div> | |
690 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
691 | <td align="left"></td> | |
692 | <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal, | |
693 | Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert | |
694 | Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani, | |
695 | Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p> | |
696 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
697 | 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>) | |
698 | </p> | |
699 | </div></td> | |
700 | </tr></table> | |
701 | <hr> | |
702 | <div class="spirit-nav"> | |
703 | <a accesskey="p" href="../dist_ref.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dist_ref.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="dists.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
704 | </div> | |
705 | </body> | |
706 | </html> |