blob: 5179a290bd73348012cda63f5bba60cf15d5b3e3 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Non-Member Properties</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
<link rel="home" href="../../../index.html" title="Math Toolkit">
<link rel="up" href="../dist_ref.html" title="Statistical Distributions Reference">
<link rel="prev" href="../dist_ref.html" title="Statistical Distributions Reference">
<link rel="next" href="dists.html" title="Distributions">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.dist_ref.nmp"></a><a class="link" href="nmp.html" title="Non-Member Properties"> Non-Member Properties</a>
</h4></div></div></div>
<p>
Properties that are common to all distributions are accessed via non-member
getter functions: non-membership allows more of these functions to be added
over time, as the need arises. Unfortunately the literature uses many different
and confusing names to refer to a rather small number of actual concepts;
refer to the <a class="link" href="nmp.html#concept_index">concept index</a> to find
the property you want by the name you are most familiar with. Or use the
<a class="link" href="nmp.html#function_index">function index</a> to go straight to
the function you want if you already know its name.
</p>
<a name="function_index"></a><a name="math_toolkit.dist.dist_ref.nmp.function_index"></a><h5>
<a name="id1001827"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.function_index">Function
Index</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
<a class="link" href="nmp.html#math.dist.cdf">cdf</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.ccdf">cdf complement</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.chf">chf</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.hazard">hazard</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.kurtosis">kurtosis</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.kurtosis_excess">kurtosis_excess</a>
</li>
<li>
<a class="link" href="nmp.html#math.dist.mean">mean</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.median">median</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.mode">mode</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.pdf">pdf</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.range">range</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.quantile">quantile</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.quantile_c">quantile from the complement</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.skewness">skewness</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.sd">standard_deviation</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.support">support</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.variance">variance</a>.
</li>
</ul></div>
<a name="concept_index"></a><a name="math_toolkit.dist.dist_ref.nmp.conceptual_index"></a><h5>
<a name="id1002051"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.conceptual_index">Conceptual
Index</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
<a class="link" href="nmp.html#math.dist.ccdf">Complement of the Cumulative Distribution
Function</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.cdf">Cumulative Distribution Function</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.chf">Cumulative Hazard Function</a>.
</li>
<li>
<a class="link" href="nmp.html#cdf_inv">Inverse Cumulative Distribution Function</a>.
</li>
<li>
<a class="link" href="nmp.html#survival_inv">Inverse Survival Function</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.hazard">Hazard Function</a>
</li>
<li>
<a class="link" href="nmp.html#lower_critical">Lower Critical Value</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.kurtosis">kurtosis</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.kurtosis_excess">kurtosis_excess</a>
</li>
<li>
<a class="link" href="nmp.html#math.dist.mean">mean</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.median">median</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.mode">mode</a>.
</li>
<li>
<a class="link" href="nmp.html#cdfPQ">P</a>.
</li>
<li>
<a class="link" href="nmp.html#percent">Percent Point Function</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.pdf">Probability Density Function</a>.
</li>
<li>
<a class="link" href="nmp.html#pmf">Probability Mass Function</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.range">range</a>.
</li>
<li>
<a class="link" href="nmp.html#cdfPQ">Q</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.quantile">Quantile</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.quantile_c">Quantile from the complement of
the probability</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.skewness">skewness</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.sd">standard deviation</a>
</li>
<li>
<a class="link" href="nmp.html#survival">Survival Function</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.support">support</a>.
</li>
<li>
<a class="link" href="nmp.html#upper_critical">Upper Critical Value</a>.
</li>
<li>
<a class="link" href="nmp.html#math.dist.variance">variance</a>.
</li>
</ul></div>
<a name="math.dist.cdf"></a><a name="math_toolkit.dist.dist_ref.nmp.cumulative_distribution_function"></a><h5>
<a name="id1002387"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.cumulative_distribution_function">Cumulative
Distribution Function</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<p>
The <a class="link" href="nmp.html#math.dist.cdf">Cumulative Distribution Function</a>
is the probability that the variable takes a value less than or equal to
x. It is equivalent to the integral from -infinity to x of the <a class="link" href="nmp.html#math.dist.pdf">Probability
Density Function</a>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the random variable is outside the defined range for the distribution.
</p>
<p>
For example, the following graph shows the cdf for the normal distribution:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/cdf.png" alt="cdf"></span>
</p>
<a name="math.dist.ccdf"></a><a name="math_toolkit.dist.dist_ref.nmp.complement_of_the_cumulative_distribution_function"></a><h5>
<a name="id1002558"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.complement_of_the_cumulative_distribution_function">Complement
of the Cumulative Distribution Function</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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">&gt;</span>
<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">&lt;</span><span class="identifier">Distribution</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">&gt;&amp;</span> <span class="identifier">comp</span><span class="special">);</span>
</pre>
<p>
The complement of the <a class="link" href="nmp.html#math.dist.cdf">Cumulative Distribution
Function</a> is the probability that the variable takes a value greater
than x. It is equivalent to the integral from x to infinity of the <a class="link" href="nmp.html#math.dist.pdf">Probability Density Function</a>, or 1 minus
the <a class="link" href="nmp.html#math.dist.cdf">Cumulative Distribution Function</a>
of x.
</p>
<p>
This is also known as the survival function.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the random variable is outside the defined range for the distribution.
</p>
<p>
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:
</p>
<pre class="programlisting"><span class="comment">// standard normal distribution object:
</span><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>
<span class="comment">// print survival function for x=2.0:
</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
For example, the following graph shows the __complement of the cdf for
the normal distribution:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/survival.png" alt="survival"></span>
</p>
<p>
See <a class="link" href="../stat_tut/overview/complements.html#why_complements">why complements?</a> for why the
complement is useful and when it should be used.
</p>
<a name="math.dist.hazard"></a><a name="math_toolkit.dist.dist_ref.nmp.hazard_function"></a><h5>
<a name="id1002847"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.hazard_function">Hazard Function</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<p>
Returns the <a class="link" href="nmp.html#math.dist.hazard">Hazard Function</a> of
<span class="emphasis"><em>x</em></span> and distibution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the random variable is outside the defined range for the distribution.
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../equations/hazard.png"></span>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../../../doc/src/images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>
Some authors refer to this as the conditional failure density function
rather than the hazard function.
</p></td></tr>
</table></div>
<a name="math.dist.chf"></a><a name="math_toolkit.dist.dist_ref.nmp.cumulative_hazard_function"></a><h5>
<a name="id1003029"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.cumulative_hazard_function">Cumulative
Hazard Function</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<p>
Returns the <a class="link" href="nmp.html#math.dist.chf">Cumulative Hazard Function</a>
of <span class="emphasis"><em>x</em></span> and distibution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the random variable is outside the defined range for the distribution.
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../equations/chf.png"></span>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../../../doc/src/images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>
Some authors refer to this as simply the "Hazard Function".
</p></td></tr>
</table></div>
<a name="math.dist.mean"></a><a name="math_toolkit.dist.dist_ref.nmp.mean"></a><h5>
<a name="id1003212"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.mean">mean</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the mean of the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined mean (for example the Cauchy
distribution).
</p>
<a name="math.dist.median"></a><a name="math_toolkit.dist.dist_ref.nmp.median"></a><h5>
<a name="id1003329"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.median">median</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the median of the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<a name="math.dist.mode"></a><a name="math_toolkit.dist.dist_ref.nmp.mode"></a><h5>
<a name="id1003439"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.mode">mode</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the mode of the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined mode.
</p>
<a name="math.dist.pdf"></a><a name="math_toolkit.dist.dist_ref.nmp.probability_density_function"></a><h5>
<a name="id1003554"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.probability_density_function">Probability
Density Function</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<p>
For a continuous function, the probability density function (pdf) returns
the probability that the variate has the value x. Since for continuous
distributions the probability at a single point is actually zero, the probability
is better expressed as the integral of the pdf between two points: see
the <a class="link" href="nmp.html#math.dist.cdf">Cumulative Distribution Function</a>.
</p>
<p>
For a discrete distribution, the pdf is the probability that the variate
takes the value x.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the random variable is outside the defined range for the distribution.
</p>
<p>
For example, for a standard normal distribution the pdf looks like this:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/pdf.png" alt="pdf"></span>
</p>
<a name="math.dist.range"></a><a name="math_toolkit.dist.dist_ref.nmp.range"></a><h5>
<a name="id1003755"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.range">Range</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">&gt;</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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the valid range of the random variable over distribution <span class="emphasis"><em>dist</em></span>.
</p>
<a name="math.dist.quantile"></a><a name="math_toolkit.dist.dist_ref.nmp.quantile"></a><h5>
<a name="id1003891"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.quantile">Quantile</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RealType</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">);</span>
</pre>
<p>
The quantile is best viewed as the inverse of the <a class="link" href="nmp.html#math.dist.cdf">Cumulative
Distribution Function</a>, it returns 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">dist</span><span class="special">,</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">==</span>
<span class="identifier">p</span></code>.
</p>
<p>
This is also known as the <span class="emphasis"><em>percent point function</em></span>,
or a <span class="emphasis"><em>percentile</em></span>, it is also the same as calculating
the <span class="emphasis"><em>lower critical value</em></span> of a distribution.
</p>
<p>
This function returns a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the probability lies outside [0,1]. The function may return an <a class="link" href="../../main_overview/error_handling.html#overflow_error">overflow_error</a> if there is no finite value
that has the specified probability.
</p>
<p>
The following graph shows the quantile function for a standard normal distribution:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/quantile.png" alt="quantile"></span>
</p>
<a name="math.dist.quantile_c"></a><a name="math_toolkit.dist.dist_ref.nmp.quantile_from_the_complement_of_the_probability_"></a><h5>
<a name="id1004114"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.quantile_from_the_complement_of_the_probability_">Quantile
from the complement of the probability.</a>
</h5>
<p>
<a class="link" href="../stat_tut/overview.html#complements">complements</a>
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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">&gt;</span>
<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">&lt;</span><span class="identifier">Distribution</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">&gt;&amp;</span> <span class="identifier">comp</span><span class="special">);</span>
</pre>
<p>
This is the inverse of the <a class="link" href="nmp.html#math.dist.ccdf">Complement of
the Cumulative Distribution Function</a>. It is calculated by wrapping
the arguments in a call to the quantile function in a call to <span class="emphasis"><em>complement</em></span>.
For example:
</p>
<pre class="programlisting"><span class="comment">// define a standard normal distribution:
</span><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>
<span class="comment">// print the value of x for which the complement
</span><span class="comment">// of the probability is 0.05:
</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
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> <span class="identifier">x</span><span class="special">))</span> <span class="special">==</span> <span class="identifier">q</span></code>
where <span class="emphasis"><em>q</em></span> is complement of the probability.
</p>
<p>
<a class="link" href="../stat_tut/overview/complements.html#why_complements">Why complements?</a>
</p>
<p>
This function is also called the inverse survival function, and is the
same as calculating the <span class="emphasis"><em>upper critical value</em></span> of a
distribution.
</p>
<p>
This function returns a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the probablity lies outside [0,1]. The function may return an <a class="link" href="../../main_overview/error_handling.html#overflow_error">overflow_error</a> if there is no finite value
that has the specified probability.
</p>
<p>
The following graph show the inverse survival function for the normal distribution:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/survival_inv.png" alt="survival_inv"></span>
</p>
<a name="math.dist.sd"></a><a name="math_toolkit.dist.dist_ref.nmp.standard_deviation"></a><h5>
<a name="id1004455"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.standard_deviation">Standard
Deviation</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the standard deviation of distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined standard deviation.
</p>
<a name="math.dist.support"></a><a name="math_toolkit.dist.dist_ref.nmp.support"></a><h5>
<a name="id1004575"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.support">support</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <span class="identifier">RealType</span><span class="special">&gt;</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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the supported range of random variable over the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
The distribution is said to be 'supported' over a range that is <a href="http://en.wikipedia.org/wiki/Probability_distribution" target="_top">"the smallest
closed set whose complement has probability zero"</a>. Non-mathematicians
might say it means the 'interesting' smallest range of random variate x
that has the cdf going from zero to unity. Outside are uninteresting zones
where the pdf is zero, and the cdf zero or unity.
</p>
<a name="math.dist.variance"></a><a name="math_toolkit.dist.dist_ref.nmp.variance"></a><h5>
<a name="id1004719"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.variance">Variance</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the variance of the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined variance.
</p>
<a name="math.dist.skewness"></a><a name="math_toolkit.dist.dist_ref.nmp.skewness"></a><h5>
<a name="id1004838"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.skewness">Skewness</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the skewness of the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined skewness.
</p>
<a name="math.dist.kurtosis"></a><a name="math_toolkit.dist.dist_ref.nmp.kurtosis"></a><h5>
<a name="id1004956"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.kurtosis">Kurtosis</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</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="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the 'proper' kurtosis (normalized fourth moment) of the distribution
<span class="emphasis"><em>dist</em></span>.
</p>
<p>
kertosis = &#946;<sub>2</sub> &#8203;= &#956;<sub>4</sub> &#8203; / &#956;<sub>2</sub><sup>2</sup>
</p>
<p>
Where &#956;<sub>i</sub> &#8203; is the i'th central moment of the distribution, and in particular
&#956;<sub>2</sub> &#8203; is the variance of the distribution.
</p>
<p>
The kurtosis is a measure of the "peakedness" of a distribution.
</p>
<p>
Note that the literature definition of kurtosis is confusing. The definition
used here is that used by for example <a href="http://mathworld.wolfram.com/Kurtosis.html" target="_top">Wolfram
MathWorld</a> (that includes a table of formulae for kurtosis excess
for various distributions) but NOT the definition of <a href="http://en.wikipedia.org/wiki/Kurtosis" target="_top">kurtosis
used by Wikipedia</a> which treats "kurtosis" and "kurtosis
excess" as the same quantity.
</p>
<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>
</pre>
<p>
This subtraction of 3 is convenient so that the <span class="emphasis"><em>kurtosis excess</em></span>
of a normal distribution is zero.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined kurtosis.
</p>
<p>
'Proper' kurtosis can have a value from zero to + infinity.
</p>
<a name="math.dist.kurtosis_excess"></a><a name="math_toolkit.dist.dist_ref.nmp.kurtosis_excess"></a><h5>
<a name="id1005164"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.kurtosis_excess">Kurtosis
excess</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;</span>
<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">&lt;</span><span class="identifier">RealType</span><span class="special">,</span> <a class="link" href="../../policy.html" title="Policies">Policy</a><span class="special">&gt;&amp;</span> <span class="identifier">dist</span><span class="special">);</span>
</pre>
<p>
Returns the kurtosis excess of the distribution <span class="emphasis"><em>dist</em></span>.
</p>
<p>
kurtosis excess = &#947;<sub>2</sub> &#8203;= &#956;<sub>4</sub> &#8203; / &#956;<sub>2</sub><sup>2</sup> &#8203;- 3 = kurtosis - 3
</p>
<p>
Where &#956;<sub>i</sub> &#8203; is the i'th central moment of the distribution, and in particular
&#956;<sub>2</sub> &#8203; is the variance of the distribution.
</p>
<p>
The kurtosis excess is a measure of the "peakedness" of a distribution,
and is more widely used than the "kurtosis proper". It is defined
so that the kurtosis excess of a normal distribution is zero.
</p>
<p>
This function may return a <a class="link" href="../../main_overview/error_handling.html#domain_error">domain_error</a>
if the distribution does not have a defined kurtosis excess.
</p>
<p>
Kurtosis excess can have a value from -2 to + infinity.
</p>
<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>
</pre>
<p>
The kurtosis excess of a normal distribution is zero.
</p>
<a name="cdfPQ"></a><a name="math_toolkit.dist.dist_ref.nmp.p_and_q"></a><h5>
<a name="id1005350"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.p_and_q">P and Q</a>
</h5>
<p>
The terms P and Q are sometimes used to refer to the <a class="link" href="nmp.html#math.dist.cdf">Cumulative
Distribution Function</a> and its <a class="link" href="nmp.html#math.dist.ccdf">complement</a>
respectively. Lowercase p and q are sometimes used to refer to the values
returned by these functions.
</p>
<a name="percent"></a><a name="math_toolkit.dist.dist_ref.nmp.percent_point_function"></a><h5>
<a name="id1005380"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.percent_point_function">Percent
Point Function</a>
</h5>
<p>
The percent point function, also known as the percentile, is the same as
the <a class="link" href="nmp.html#math.dist.quantile">Quantile</a>.
</p>
<a name="cdf_inv"></a><a name="math_toolkit.dist.dist_ref.nmp.inverse_cdf_function_"></a><h5>
<a name="id1005405"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.inverse_cdf_function_">Inverse
CDF Function.</a>
</h5>
<p>
The inverse of the cumulative distribution function, is the same as the
<a class="link" href="nmp.html#math.dist.quantile">Quantile</a>.
</p>
<a name="survival_inv"></a><a name="math_toolkit.dist.dist_ref.nmp.inverse_survival_function_"></a><h5>
<a name="id1005433"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.inverse_survival_function_">Inverse
Survival Function.</a>
</h5>
<p>
The inverse of the survival function, is the same as computing the <a class="link" href="nmp.html#math.dist.quantile_c">quantile from the complement of the probability</a>.
</p>
<a name="pmf"></a><a name="math_toolkit.dist.dist_ref.nmp.probability_mass_function"></a><h5>
<a name="id1005463"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.probability_mass_function">Probability
Mass Function</a>
</h5>
<p>
The Probability Mass Function is the same as the <a class="link" href="nmp.html#math.dist.pdf">Probability
Density Function</a>.
</p>
<p>
The term Mass Function is usually applied to discrete distributions, while
the term <a class="link" href="nmp.html#math.dist.pdf">Probability Density Function</a>
applies to continuous distributions.
</p>
<a name="lower_critical"></a><a name="math_toolkit.dist.dist_ref.nmp.lower_critical_value_"></a><h5>
<a name="id1005501"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.lower_critical_value_">Lower
Critical Value.</a>
</h5>
<p>
The lower critical value calculates the value of the random variable given
the area under the left tail of the distribution. It is equivalent to calculating
the <a class="link" href="nmp.html#math.dist.quantile">Quantile</a>.
</p>
<a name="upper_critical"></a><a name="math_toolkit.dist.dist_ref.nmp.upper_critical_value_"></a><h5>
<a name="id1005526"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.upper_critical_value_">Upper
Critical Value.</a>
</h5>
<p>
The upper critical value calculates the value of the random variable given
the area under the right tail of the distribution. It is equivalent to
calculating the <a class="link" href="nmp.html#math.dist.quantile_c">quantile from the
complement of the probability</a>.
</p>
<a name="survival"></a><a name="math_toolkit.dist.dist_ref.nmp.survival_function"></a><h5>
<a name="id1005553"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.survival_function">Survival
Function</a>
</h5>
<p>
Refer to the <a class="link" href="nmp.html#math.dist.ccdf">Complement of the Cumulative
Distribution Function</a>.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006 , 2007, 2008, 2009, 2010 John Maddock, Paul A. Bristow,
Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan R&#229;de, Gautam Sewani and
Thijs van den Berg<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
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>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<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>
</div>
</body>
</html>