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