Refactor to use generic file scanning mechanism, and regenerated some of the example docs.

[SVN r67390]
This commit is contained in:
John Maddock 2010-12-21 18:42:13 +00:00
parent 5758421e85
commit 07bbb7b3eb
327 changed files with 6868 additions and 9222 deletions

View File

@ -514,7 +514,7 @@ will be found by the scanner and indexed. The default regular expression prefix
[table
[[Type][Prefix][Suffix]]
[[class]["class[^;{]+\\<"]["\\>[^;{]+\\{"]]
[[class]["class\[\^;{\]+\\<"]["\\>\[\^;{\]+\\{"]]
[[function]["\\<\\w+\\>\\s+\\<"]["\\>\\s\*\\(\[^;{\]\*\\)\\s\*\[;{\]"]]
[[typedef]["typedef\[^;\]+\\<"]["\\>\\s\*;"]]
[[macro]["\\<"]["\\>"]]

View File

@ -23,7 +23,7 @@
The following elements can occur in a script:
</p>
<a name="autoindex.script_ref.comments_and_blank_lines"></a><h5>
<a name="id1003329"></a>
<a name="id978207"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.comments_and_blank_lines">Comments and
blank lines</a>
</h5>
@ -32,7 +32,7 @@
with a '#'.
</p>
<a name="autoindex.script_ref.simple_inclusions"></a><h5>
<a name="id1003346"></a>
<a name="id978224"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.simple_inclusions">Simple Inclusions</a>
</h5>
<pre class="programlisting"><span class="identifier">term</span> <span class="special">[</span><span class="identifier">regular</span><span class="special">-</span><span class="identifier">expression1</span> <span class="special">[</span><span class="identifier">regular</span><span class="special">-</span><span class="identifier">expression2</span> <span class="special">[</span><span class="identifier">category</span><span class="special">]]]</span>
@ -99,7 +99,7 @@
</dl>
</div>
<a name="autoindex.script_ref.source_file_scanning"></a><h5>
<a name="id1003555"></a>
<a name="id978433"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.source_file_scanning">Source File Scanning</a>
</h5>
<pre class="programlisting"><span class="special">!</span><span class="identifier">scan</span> <span class="identifier">source</span><span class="special">-</span><span class="identifier">file</span><span class="special">-</span><span class="identifier">name</span>
@ -128,7 +128,7 @@
</p></td></tr>
</table></div>
<a name="autoindex.script_ref.directory_and_source_file_scanning"></a><h5>
<a name="id1003633"></a>
<a name="id978511"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.directory_and_source_file_scanning">Directory
and Source File Scanning</a>
</h5>
@ -157,7 +157,7 @@
</dl>
</div>
<a name="autoindex.script_ref.excluding_terms"></a><h5>
<a name="id1003758"></a>
<a name="id978636"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.excluding_terms">Excluding Terms</a>
</h5>
<pre class="programlisting"><span class="special">!</span><span class="identifier">exclude</span> <span class="identifier">term</span><span class="special">-</span><span class="identifier">list</span>
@ -170,7 +170,7 @@
of things to index.
</p>
<a name="autoindex.script_ref.rewriting_section_names"></a><h5>
<a name="id1003813"></a>
<a name="id978691"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.rewriting_section_names">Rewriting Section
Names</a>
</h5>
@ -208,7 +208,7 @@
</dl>
</div>
<a name="autoindex.script_ref.changing_the_regular_expressions_used_when_scanning"></a><h5>
<a name="id1003951"></a>
<a name="id978829"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.changing_the_regular_expressions_used_when_scanning">Changing
the regular expressions used when scanning</a>
</h5>
@ -265,12 +265,12 @@
</td>
<td>
<p>
"class<code class="literal">;{</code>+\&lt;"
"class[^;{]+\&lt;"
</p>
</td>
<td>
<p>
"\&gt;<code class="literal">;{</code>+\{"
"\&gt;[^;{]+\{"
</p>
</td>
</tr>
@ -349,7 +349,7 @@
</dl>
</div>
<a name="autoindex.script_ref.debugging"></a><h5>
<a name="id1004239"></a>
<a name="id979108"></a>
<a class="link" href="script_ref.html#autoindex.script_ref.debugging">Debugging</a>
</h5>
<p>

View File

@ -20,7 +20,7 @@
<a name="autoindex.tut"></a><a class="link" href="tut.html" title="Getting Started and Tutorial">Getting Started and Tutorial</a>
</h2></div></div></div>
<a name="autoindex.tut.step_1__build_the_tool"></a><h5>
<a name="id994380"></a>
<a name="id969258"></a>
<a class="link" href="tut.html#autoindex.tut.step_1__build_the_tool">Step 1: Build the tool</a>
</h5>
<p>
@ -62,7 +62,7 @@
is accepted into Boost.
</p>
<a name="autoindex.tut.step_2__configure_boost_build"></a><h5>
<a name="id994545"></a>
<a name="id969423"></a>
<a class="link" href="tut.html#autoindex.tut.step_2__configure_boost_build">Step 2: Configure
Boost.Build</a>
</h5>
@ -155,7 +155,7 @@
</dl>
</div>
<a name="autoindex.tut.step_3__add_indexes_to_your_documentation"></a><h5>
<a name="id994708"></a>
<a name="id969586"></a>
<a class="link" href="tut.html#autoindex.tut.step_3__add_indexes_to_your_documentation">Step
3: Add indexes to your documentation</a>
</h5>
@ -249,7 +249,7 @@ boostbook standalone
&lt;xsl:param&gt;index.on.type=1
</pre>
<a name="autoindex.tut.step_4__create_the_script_file"></a><h5>
<a name="id1002762"></a>
<a name="id977640"></a>
<a class="link" href="tut.html#autoindex.tut.step_4__create_the_script_file">Step 4: Create
the script file</a>
</h5>
@ -322,7 +322,7 @@ boostbook standalone
<pre class="programlisting"><span class="special">!</span><span class="identifier">rewrite</span><span class="special">-</span><span class="identifier">name</span> <span class="string">"(?i)(?:A|The)\s+(.*)"</span> <span class="string">"\1"</span>
</pre>
<a name="autoindex.tut.step_5__add_manual_index_entries___optional"></a><h5>
<a name="id1003020"></a>
<a name="id977898"></a>
<a class="link" href="tut.html#autoindex.tut.step_5__add_manual_index_entries___optional">Step
5: Add Manual Index Entries - Optional</a>
</h5>
@ -338,7 +338,7 @@ boostbook standalone
index itself, with the exception of the "type" attribute.
</p>
<a name="autoindex.tut.step_6__build_the_your_docs"></a><h5>
<a name="id1003140"></a>
<a name="id978018"></a>
<a class="link" href="tut.html#autoindex.tut.step_6__build_the_your_docs">Step 6: Build the
Your Docs</a>
</h5>
@ -365,7 +365,7 @@ boostbook standalone
If you don't see that, or if it's indexing 0 terms then something is wrong!
</p>
<a name="autoindex.tut.step_7__iterate"></a><h5>
<a name="id1003250"></a>
<a name="id978128"></a>
<a class="link" href="tut.html#autoindex.tut.step_7__iterate">Step 7: Iterate</a>
</h5>
<p>

View File

@ -21,7 +21,7 @@
</h3></div></div></div>
<div><p class="copyright">Copyright &#169; 2008 John Maddock</p></div>
<div><div class="legalnotice">
<a name="id994092"></a><p>
<a name="id968970"></a><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>
@ -40,7 +40,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: December 20, 2010 at 13:16:00 GMT</small></p></td>
<td align="left"><p><small>Last revised: December 20, 2010 at 18:55:27 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -39,7 +39,7 @@
<div><p class="copyright">Copyright &#169; 2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
Holin, Xiaogang Zhang, Bruno Lalande and Gautam Sewani</p></div>
<div><div class="legalnotice">
<a name="id968942"></a><p>
<a name="id970148"></a><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>
@ -50,394 +50,391 @@
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="section"><a href="math_toolkit/main_overview.html"> Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview.html">Overview</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/main_overview/intro.html"> About the Math Toolkit</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/navigation.html"> Navigation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/directories.html"> Directory and
<dt><span class="section"><a href="math_toolkit/main_overview/intro.html">About the Math Toolkit</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/navigation.html">Navigation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/directories.html">Directory and
File Structure</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/namespaces.html"> Namespaces</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/result_type.html"> Calculation
of the Type of the Result</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/error_handling.html"> Error Handling</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/compilers_overview.html"> Compilers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/pol_overview.html"> Configuration
<dt><span class="section"><a href="math_toolkit/main_overview/namespaces.html">Namespaces</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/result_type.html">Calculation of
the Type of the Result</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/error_handling.html">Error Handling</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/compilers_overview.html">Compilers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/pol_overview.html">Configuration
and Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/threads.html"> Thread Safety</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/perf_over.html"> Performance</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/building.html"> If and How to Build
<dt><span class="section"><a href="math_toolkit/main_overview/threads.html">Thread Safety</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/perf_over.html">Performance</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/building.html">If and How to Build
the Library and its Examples and Tests</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/history1.html"> History and What's
<dt><span class="section"><a href="math_toolkit/main_overview/history1.html">History and What's
New</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/tr1.html"> C99 and TR1 C Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/contact.html"> Contact Info and
<dt><span class="section"><a href="math_toolkit/main_overview/tr1.html">C99 and TR1 C Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/main_overview/contact.html">Contact Info and
Support</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/dist.html"> Statistical Distributions and Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist.html">Statistical Distributions and Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut.html"> Statistical Distributions
<dt><span class="section"><a href="math_toolkit/dist/stat_tut.html">Statistical Distributions
Tutorial</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/overview.html"> Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg.html"> Worked Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/overview.html">Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg.html">Worked Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/dist_construct_eg.html">
Distribution Construction Example</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/st_eg.html"> Student's
t Distribution Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/cs_eg.html"> Chi Squared
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/dist_construct_eg.html">Distribution
Construction Example</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/st_eg.html">Student's t
Distribution Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/f_eg.html"> F Distribution
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/cs_eg.html">Chi Squared
Distribution Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/f_eg.html">F Distribution
Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/binom_eg.html"> Binomial
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/binom_eg.html">Binomial
Distribution Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/neg_binom_eg.html"> Negative
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/neg_binom_eg.html">Negative
Binomial Distribution Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/normal_example.html"> Normal
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/normal_example.html">Normal
Distribution Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/nccs_eg.html"> Non Central
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/nccs_eg.html">Non Central
Chi Squared Example</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/error_eg.html"> Error Handling
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/error_eg.html">Error Handling
Example</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/find_eg.html"> Find Location
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/find_eg.html">Find Location
and Scale Examples</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/nag_library.html"> Comparison
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/weg/nag_library.html">Comparison
with C, R, FORTRAN-style Free Functions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/variates.html"> Random Variates
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/variates.html">Random Variates
and Distribution Parameters</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/dist_params.html"> Discrete Probability
<dt><span class="section"><a href="math_toolkit/dist/stat_tut/dist_params.html">Discrete Probability
Distributions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref.html"> Statistical Distributions
<dt><span class="section"><a href="math_toolkit/dist/dist_ref.html">Statistical Distributions
Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/nmp.html"> Non-Member Properties</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists.html"> Distributions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/nmp.html">Non-Member Properties</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists.html">Distributions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/bernoulli_dist.html">
Bernoulli Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/beta_dist.html"> Beta
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/bernoulli_dist.html">Bernoulli
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/binomial_dist.html">
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/cauchy_dist.html"> Cauchy-Lorentz
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/beta_dist.html">Beta
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/chi_squared_dist.html">
Chi Squared Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/exp_dist.html"> Exponential
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/binomial_dist.html">Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/extreme_dist.html"> Extreme
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/cauchy_dist.html">Cauchy-Lorentz
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/chi_squared_dist.html">Chi
Squared Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/exp_dist.html">Exponential
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/extreme_dist.html">Extreme
Value Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/f_dist.html"> F Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/gamma_dist.html"> Gamma
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/f_dist.html">F Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/gamma_dist.html">Gamma
(and Erlang) Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/logistic_dist.html">
Logistic Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/lognormal_dist.html">
Log Normal Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html">
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_beta_dist.html"> Noncentral
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/logistic_dist.html">Logistic
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/lognormal_dist.html">Log
Normal Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html">Negative
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_beta_dist.html">Noncentral
Beta Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html">
Noncentral Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_f_dist.html"> Noncentral
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html">Noncentral
Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_f_dist.html">Noncentral
F Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_t_dist.html"> Noncentral
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/nc_t_dist.html">Noncentral
T Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/normal_dist.html"> Normal
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/normal_dist.html">Normal
(Gaussian) Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/pareto.html"> Pareto
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/pareto.html">Pareto Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/poisson_dist.html">Poisson
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/poisson_dist.html"> Poisson
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/rayleigh.html">Rayleigh
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/rayleigh.html"> Rayleigh
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/students_t_dist.html">Students
t Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/triangular_dist.html">Triangular
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/students_t_dist.html">
Students t Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/triangular_dist.html">
Triangular Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/weibull.html"> Weibull
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/weibull.html">Weibull
Distribution</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/uniform_dist.html"> Uniform
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dists/uniform_dist.html">Uniform
Distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dist_algorithms.html"> Distribution
<dt><span class="section"><a href="math_toolkit/dist/dist_ref/dist_algorithms.html">Distribution
Algorithms</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/dist/future.html"> Extras/Future Directions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/dist/future.html">Extras/Future Directions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special.html"> Special Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special.html">Special Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma.html"> Gamma Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma.html">Gamma Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/tgamma.html"> Gamma</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/lgamma.html"> Log Gamma</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/digamma.html"> Digamma</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/gamma_ratios.html"> Ratios
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/tgamma.html">Gamma</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/lgamma.html">Log Gamma</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/digamma.html">Digamma</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/gamma_ratios.html">Ratios
of Gamma Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/igamma.html"> Incomplete Gamma
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/igamma.html">Incomplete Gamma
Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/igamma_inv.html"> Incomplete
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/igamma_inv.html">Incomplete
Gamma Function Inverses</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/gamma_derivatives.html"> Derivative
<dt><span class="section"><a href="math_toolkit/special/sf_gamma/gamma_derivatives.html">Derivative
of the Incomplete Gamma Function</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/factorials.html"> Factorials and Binomial
<dt><span class="section"><a href="math_toolkit/special/factorials.html">Factorials and Binomial
Coefficients</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_factorial.html"> Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_double_factorial.html">
Double Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_rising_factorial.html">
Rising Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_falling_factorial.html">
Falling Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_binomial.html"> Binomial
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_factorial.html">Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_double_factorial.html">Double
Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_rising_factorial.html">Rising
Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_falling_factorial.html">Falling
Factorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/factorials/sf_binomial.html">Binomial
Coefficients</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/sf_beta.html"> Beta Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_beta.html">Beta Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/sf_beta/beta_function.html"> Beta</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_beta/ibeta_function.html"> Incomplete
<dt><span class="section"><a href="math_toolkit/special/sf_beta/beta_function.html">Beta</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_beta/ibeta_function.html">Incomplete
Beta Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_beta/ibeta_inv_function.html"> The
<dt><span class="section"><a href="math_toolkit/special/sf_beta/ibeta_inv_function.html">The
Incomplete Beta Function Inverses</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_beta/beta_derivative.html"> Derivative
<dt><span class="section"><a href="math_toolkit/special/sf_beta/beta_derivative.html">Derivative
of the Incomplete Beta Function</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/sf_erf.html"> Error Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_erf.html">Error Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/sf_erf/error_function.html"> Error
Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_erf/error_inv.html"> Error Function
<dt><span class="section"><a href="math_toolkit/special/sf_erf/error_function.html">Error Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_erf/error_inv.html">Error Function
Inverses</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/sf_poly.html"> Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_poly.html">Polynomials</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/sf_poly/legendre.html"> Legendre (and
<dt><span class="section"><a href="math_toolkit/special/sf_poly/legendre.html">Legendre (and
Associated) Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_poly/laguerre.html"> Laguerre (and
<dt><span class="section"><a href="math_toolkit/special/sf_poly/laguerre.html">Laguerre (and
Associated) Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_poly/hermite.html"> Hermite Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_poly/sph_harm.html"> Spherical Harmonics</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_poly/hermite.html">Hermite Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sf_poly/sph_harm.html">Spherical Harmonics</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/bessel.html"> Bessel Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/bessel.html">Bessel Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/bessel/bessel_over.html"> Bessel Function
<dt><span class="section"><a href="math_toolkit/special/bessel/bessel_over.html">Bessel Function
Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/bessel/bessel.html"> Bessel Functions
<dt><span class="section"><a href="math_toolkit/special/bessel/bessel.html">Bessel Functions
of the First and Second Kinds</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/bessel/mbessel.html"> Modified Bessel
<dt><span class="section"><a href="math_toolkit/special/bessel/mbessel.html">Modified Bessel
Functions of the First and Second Kinds</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/bessel/sph_bessel.html">Spherical Bessel
Functions of the First and Second Kinds</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/bessel/sph_bessel.html"> Spherical
Bessel Functions of the First and Second Kinds</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/ellint.html"> Elliptic Integrals</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/ellint.html">Elliptic Integrals</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_intro.html"> Elliptic
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_intro.html">Elliptic
Integral Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_carlson.html"> Elliptic
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_carlson.html">Elliptic
Integrals - Carlson Form</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_1.html"> Elliptic Integrals
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_1.html">Elliptic Integrals
of the First Kind - Legendre Form</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_2.html"> Elliptic Integrals
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_2.html">Elliptic Integrals
of the Second Kind - Legendre Form</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_3.html"> Elliptic Integrals
<dt><span class="section"><a href="math_toolkit/special/ellint/ellint_3.html">Elliptic Integrals
of the Third Kind - Legendre Form</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/zetas.html"> Zeta Functions</a></span></dt>
<dd><dl><dt><span class="section"><a href="math_toolkit/special/zetas/zeta.html"> Riemann Zeta Function</a></span></dt></dl></dd>
<dt><span class="section"><a href="math_toolkit/special/expint.html"> Exponential Integrals</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/zetas.html">Zeta Functions</a></span></dt>
<dd><dl><dt><span class="section"><a href="math_toolkit/special/zetas/zeta.html">Riemann Zeta Function</a></span></dt></dl></dd>
<dt><span class="section"><a href="math_toolkit/special/expint.html">Exponential Integrals</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/expint/expint_n.html"> Exponential
Integral En</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/expint/expint_i.html"> Exponential
Integral Ei</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/expint/expint_n.html">Exponential Integral
En</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/expint/expint_i.html">Exponential Integral
Ei</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/powers.html"> Logs, Powers, Roots and
<dt><span class="section"><a href="math_toolkit/special/powers.html">Logs, Powers, Roots and
Exponentials</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/powers/log1p.html"> log1p</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/expm1.html"> expm1</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/cbrt.html"> cbrt</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/sqrt1pm1.html"> sqrt1pm1</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/powm1.html"> powm1</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/hypot.html"> hypot</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/ct_pow.html"> Compile Time Power
<dt><span class="section"><a href="math_toolkit/special/powers/log1p.html">log1p</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/expm1.html">expm1</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/cbrt.html">cbrt</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/sqrt1pm1.html">sqrt1pm1</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/powm1.html">powm1</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/hypot.html">hypot</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/powers/ct_pow.html">Compile Time Power
of a Runtime Base</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/sinc.html"> Sinus Cardinal and Hyperbolic
<dt><span class="section"><a href="math_toolkit/special/sinc.html">Sinus Cardinal and Hyperbolic
Sinus Cardinal Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/sinc/sinc_overview.html"> Sinus Cardinal
<dt><span class="section"><a href="math_toolkit/special/sinc/sinc_overview.html">Sinus Cardinal
and Hyperbolic Sinus Cardinal Functions Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sinc/sinc_pi.html">sinc_pi</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/sinc/sinhc_pi.html">sinhc_pi</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper.html"> Inverse Hyperbolic Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper.html">Inverse Hyperbolic Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/inv_hyper_over.html"> Inverse
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/inv_hyper_over.html">Inverse
Hyperbolic Functions Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/acosh.html"> acosh</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/asinh.html"> asinh</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/atanh.html"> atanh</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/acosh.html">acosh</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/asinh.html">asinh</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/inv_hyper/atanh.html">atanh</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/rounding.html"> Rounding Truncation and
<dt><span class="section"><a href="math_toolkit/special/rounding.html">Rounding Truncation and
Integer Conversion</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/rounding/round.html"> Rounding Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/rounding/trunc.html"> Truncation Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/rounding/modf.html"> Integer and Fractional
<dt><span class="section"><a href="math_toolkit/special/rounding/round.html">Rounding Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/rounding/trunc.html">Truncation Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/rounding/modf.html">Integer and Fractional
Part Splitting (modf)</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/fpclass.html"> Floating-Point Classification:
<dt><span class="section"><a href="math_toolkit/special/fpclass.html">Floating-Point Classification:
Infinities and NaN's</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/next_float.html"> Floating-Point Representation
<dt><span class="section"><a href="math_toolkit/special/next_float.html">Floating-Point Representation
Distance (ULP), and Finding Adjacent Floating-Point Values</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/next_float/nextafter.html"> Finding
<dt><span class="section"><a href="math_toolkit/special/next_float/nextafter.html">Finding
the Next Representable Value in a Specific Direction (nextafter)</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/next_float/float_next.html"> Finding
<dt><span class="section"><a href="math_toolkit/special/next_float/float_next.html">Finding
the Next Greater Representable Value (float_next)</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/next_float/float_prior.html"> Finding
<dt><span class="section"><a href="math_toolkit/special/next_float/float_prior.html">Finding
the Next Smaller Representable Value (float_prior)</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/next_float/float_distance.html"> Calculating
<dt><span class="section"><a href="math_toolkit/special/next_float/float_distance.html">Calculating
the Representation Distance Between Two Floating Point Values (ULP) float_distance</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/next_float/float_advance.html"> Advancing
<dt><span class="section"><a href="math_toolkit/special/next_float/float_advance.html">Advancing
a Floating Point Value by a Specific Representation Distance (ULP) float_advance</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/special/extern_c.html"> TR1 and C99 external
"C" Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/extern_c.html">TR1 and C99 external "C"
Functions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/special/extern_c/tr1.html"> C99 and TR1 C Functions
<dt><span class="section"><a href="math_toolkit/special/extern_c/tr1.html">C99 and TR1 C Functions
Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/extern_c/c99.html"> C99 C Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/extern_c/tr1_ref.html"> TR1 C Functions
<dt><span class="section"><a href="math_toolkit/special/extern_c/c99.html">C99 C Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/special/extern_c/tr1_ref.html">TR1 C Functions
Quick Reference</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/toolkit.html"> Internal Details and Tools (Experimental)</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit.html">Internal Details and Tools (Experimental)</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/toolkit/internals_overview.html"> Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1.html"> Reused Utilities</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals_overview.html">Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1.html">Reused Utilities</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/constants.html"> Numeric
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/constants.html">Numeric
Constants</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/series_evaluation.html">
Series Evaluation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/cf.html"> Continued Fraction
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/series_evaluation.html">Series
Evaluation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/rational.html"> Polynomial
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/cf.html">Continued Fraction
Evaluation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/rational.html">Polynomial
and Rational Function Evaluation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/roots.html"> Root Finding
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/roots.html">Root Finding
With Derivatives</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/roots2.html"> Root Finding
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/roots2.html">Root Finding
Without Derivatives</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/minima.html"> Locating Function
<dt><span class="section"><a href="math_toolkit/toolkit/internals1/minima.html">Locating Function
Minima</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2.html"> Testing and Development</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2.html">Testing and Development</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/polynomials.html"> Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/minimax.html"> Minimax Approximations
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/polynomials.html">Polynomials</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/minimax.html">Minimax Approximations
and the Remez Algorithm</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/error_test.html"> Relative
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/error_test.html">Relative
Error and Testing</a></span></dt>
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/test_data.html"> Graphing,
<dt><span class="section"><a href="math_toolkit/toolkit/internals2/test_data.html">Graphing,
Profiling, and Generating Test Data for Special Functions</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/using_udt.html"> Use with User-Defined Floating-Point
<dt><span class="section"><a href="math_toolkit/using_udt.html">Use with User-Defined Floating-Point
Types</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/using_udt/use_ntl.html"> Using With NTL - a High-Precision
<dt><span class="section"><a href="math_toolkit/using_udt/use_ntl.html">Using With NTL - a High-Precision
Floating-Point Library</a></span></dt>
<dt><span class="section"><a href="math_toolkit/using_udt/use_mpfr.html"> Using With MPFR / GMP
<dt><span class="section"><a href="math_toolkit/using_udt/use_mpfr.html">Using With MPFR / GMP
- a High-Precision Floating-Point Library</a></span></dt>
<dt><span class="section"><a href="math_toolkit/using_udt/concepts.html"> Conceptual Requirements
<dt><span class="section"><a href="math_toolkit/using_udt/concepts.html">Conceptual Requirements
for Real Number Types</a></span></dt>
<dt><span class="section"><a href="math_toolkit/using_udt/dist_concept.html"> Conceptual Requirements
<dt><span class="section"><a href="math_toolkit/using_udt/dist_concept.html">Conceptual Requirements
for Distribution Types</a></span></dt>
<dt><span class="section"><a href="math_toolkit/using_udt/archetypes.html"> Conceptual Archetypes
<dt><span class="section"><a href="math_toolkit/using_udt/archetypes.html">Conceptual Archetypes
and Testing</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/policy.html"> Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy.html">Policies</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/policy/pol_overview.html"> Policy Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial.html"> Policy Tutorial</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_overview.html">Policy Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial.html">Policy Tutorial</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/what_is_a_policy.html">
So Just What is a Policy Anyway?</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/policy_tut_defaults.html">
Policies Have Sensible Defaults</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/policy_usage.html"> So
How are Policies Used Anyway?</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/changing_policy_defaults.html">
Changing the Policy Defaults</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/ad_hoc_dist_policies.html">
Setting Policies for Distributions on an Ad Hoc Basis</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/ad_hoc_sf_policies.html">
Changing the Policy on an Ad Hoc Basis for the Special Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/namespace_policies.html">
Setting Policies at Namespace or Translation Unit Scope</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/user_def_err_pol.html">
Calling User Defined Error Handlers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/understand_dis_quant.html">
Understanding Quantiles of Discrete Distributions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/what_is_a_policy.html">So
Just What is a Policy Anyway?</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/policy_tut_defaults.html">Policies
Have Sensible Defaults</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/policy_usage.html">So How
are Policies Used Anyway?</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/changing_policy_defaults.html">Changing
the Policy Defaults</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/ad_hoc_dist_policies.html">Setting
Policies for Distributions on an Ad Hoc Basis</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/ad_hoc_sf_policies.html">Changing
the Policy on an Ad Hoc Basis for the Special Functions</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/namespace_policies.html">Setting
Policies at Namespace or Translation Unit Scope</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/user_def_err_pol.html">Calling
User Defined Error Handlers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_tutorial/understand_dis_quant.html">Understanding
Quantiles of Discrete Distributions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref.html"> Policy Reference</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref.html">Policy Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/error_handling_policies.html">
Error Handling Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/internal_promotion.html"> Internal
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/error_handling_policies.html">Error
Handling Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/internal_promotion.html">Internal
Promotion Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/assert_undefined.html"> Mathematically
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/assert_undefined.html">Mathematically
Undefined Function Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/discrete_quant_ref.html"> Discrete
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/discrete_quant_ref.html">Discrete
Quantile Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/precision_pol.html"> Precision
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/precision_pol.html">Precision
Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/iteration_pol.html"> Iteration
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/iteration_pol.html">Iteration
Limits Policies</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/policy_defaults.html"> Using
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/policy_defaults.html">Using
macros to Change the Policy Defaults</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/namespace_pol.html"> Setting
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/namespace_pol.html">Setting
Polices at Namespace Scope</a></span></dt>
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/pol_ref_ref.html"> Policy Class
<dt><span class="section"><a href="math_toolkit/policy/pol_ref/pol_ref_ref.html">Policy Class
Reference</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/perf.html"> Performance</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf.html">Performance</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/perf/perf_over.html"> Performance Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/interp.html"> Interpreting these Results</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/getting_best.html"> Getting the Best Performance
<dt><span class="section"><a href="math_toolkit/perf/perf_over.html">Performance Overview</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/interp.html">Interpreting these Results</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/getting_best.html">Getting the Best Performance
from this Library</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/comp_compilers.html"> Comparing Compilers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/tuning.html"> Performance Tuning Macros</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/comparisons.html"> Comparisons to Other
Open Source Libraries</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/perf_test_app.html"> The Performance Test
<dt><span class="section"><a href="math_toolkit/perf/comp_compilers.html">Comparing Compilers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/tuning.html">Performance Tuning Macros</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/comparisons.html">Comparisons to Other Open
Source Libraries</a></span></dt>
<dt><span class="section"><a href="math_toolkit/perf/perf_test_app.html">The Performance Test
Application</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/backgrounders.html"> Backgrounders</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders.html">Backgrounders</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/backgrounders/implementation.html"> Additional
<dt><span class="section"><a href="math_toolkit/backgrounders/implementation.html">Additional
Implementation Notes</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/relative_error.html"> Relative
Error</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/lanczos.html"> The Lanczos Approximation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/remez.html"> The Remez Method</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/refs.html"> References</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/relative_error.html">Relative Error</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/lanczos.html">The Lanczos Approximation</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/remez.html">The Remez Method</a></span></dt>
<dt><span class="section"><a href="math_toolkit/backgrounders/refs.html">References</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="math_toolkit/status.html"> Library Status</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status.html">Library Status</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="math_toolkit/status/history1.html"> History and What's New</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/compilers.html"> Compilers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/issues.html"> Known Issues, and Todo List</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/credits.html"> Credits and Acknowledgements</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/history1.html">History and What's New</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/compilers.html">Compilers</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/issues.html">Known Issues, and Todo List</a></span></dt>
<dt><span class="section"><a href="math_toolkit/status/credits.html">Credits and Acknowledgements</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="index/s10.html">Class Index</a></span></dt>
<dt><span class="section"><a href="index/s11.html">Typedef Index</a></span></dt>
@ -446,16 +443,13 @@
<dt><span class="section"><a href="index/s14.html">Index</a></span></dt>
</dl>
</div>
<p>
ISBN 0-9504833-2-X 978-0-9504833-2-0, Classification 519.2-dc22
</p>
<p>
This manual is also available in <a href="http://svn.boost.org/svn/boost/sandbox/pdf/math/release/math.pdf" target="_top">printer
friendly PDF format</a>.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: December 19, 2010 at 18:06:46 GMT</small></p></td>
<td align="left"><p><small>Last revised: December 21, 2010 at 18:22:46 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1365234"></a>Class Index</h2></div></div></div>
<a name="id1365162"></a>Class Index</h2></div></div></div>
<p><a class="link" href="s10.html#idx_id_0">B</a> <a class="link" href="s10.html#idx_id_1">C</a> <a class="link" href="s10.html#idx_id_2">E</a> <a class="link" href="s10.html#idx_id_3">F</a> <a class="link" href="s10.html#idx_id_4">G</a> <a class="link" href="s10.html#idx_id_5">L</a> <a class="link" href="s10.html#idx_id_6">N</a> <a class="link" href="s10.html#idx_id_7">P</a> <a class="link" href="s10.html#idx_id_8">R</a> <a class="link" href="s10.html#idx_id_9">S</a> <a class="link" href="s10.html#idx_id_10">T</a> <a class="link" href="s10.html#idx_id_11">U</a> <a class="link" href="s10.html#idx_id_12">W</a> </p>
<div class="variablelist"><dl>
<dt>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1365729"></a>Typedef Index</h2></div></div></div>
<p><a class="link" href="s11.html#idx_id_13">A</a> <a class="link" href="s11.html#idx_id_14">B</a> <a class="link" href="s11.html#idx_id_15">D</a> <a class="link" href="s11.html#idx_id_16">E</a> <a class="link" href="s11.html#idx_id_17">F</a> <a class="link" href="s11.html#idx_id_18">I</a> <a class="link" href="s11.html#idx_id_19">N</a> <a class="link" href="s11.html#idx_id_20">O</a> <a class="link" href="s11.html#idx_id_21">P</a> <a class="link" href="s11.html#idx_id_22">R</a> <a class="link" href="s11.html#idx_id_23">U</a> <a class="link" href="s11.html#idx_id_24">V</a> </p>
<a name="id1365658"></a>Typedef Index</h2></div></div></div>
<p><a class="link" href="s11.html#idx_id_13">A</a> <a class="link" href="s11.html#idx_id_14">D</a> <a class="link" href="s11.html#idx_id_15">E</a> <a class="link" href="s11.html#idx_id_16">F</a> <a class="link" href="s11.html#idx_id_17">I</a> <a class="link" href="s11.html#idx_id_18">O</a> <a class="link" href="s11.html#idx_id_19">P</a> <a class="link" href="s11.html#idx_id_20">R</a> <a class="link" href="s11.html#idx_id_21">U</a> <a class="link" href="s11.html#idx_id_22">V</a> </p>
<div class="variablelist"><dl>
<dt>
<a name="idx_id_13"></a><span class="term">A</span>
@ -28,14 +28,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_14"></a><span class="term">B</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">beta</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/dist_construct_eg.html" title="Distribution Construction Example">Distribution Construction Example</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_15"></a><span class="term">D</span>
<a name="idx_id_14"></a><span class="term">D</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">denorm_error_type</span></dt>
@ -52,14 +45,14 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_16"></a><span class="term">E</span>
<a name="idx_id_15"></a><span class="term">E</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">evaluation_error_type</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_17"></a><span class="term">F</span>
<a name="idx_id_16"></a><span class="term">F</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">float_t</span></dt>
@ -70,28 +63,21 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_18"></a><span class="term">I</span>
<a name="idx_id_17"></a><span class="term">I</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">indeterminate_result_error_type</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_19"></a><span class="term">N</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">negative_binomial</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/dist_construct_eg.html" title="Distribution Construction Example">Distribution Construction Example</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_20"></a><span class="term">O</span>
<a name="idx_id_18"></a><span class="term">O</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">overflow_error_type</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_21"></a><span class="term">P</span>
<a name="idx_id_19"></a><span class="term">P</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">pole_error_type</span></dt>
@ -127,21 +113,21 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_22"></a><span class="term">R</span>
<a name="idx_id_20"></a><span class="term">R</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">rounding_error_type</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_23"></a><span class="term">U</span>
<a name="idx_id_21"></a><span class="term">U</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">underflow_error_type</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_24"></a><span class="term">V</span>
<a name="idx_id_22"></a><span class="term">V</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">value_type</span></dt>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1366416"></a>Function Index</h2></div></div></div>
<p><a class="link" href="s12.html#idx_id_25">A</a> <a class="link" href="s12.html#idx_id_26">B</a> <a class="link" href="s12.html#idx_id_27">C</a> <a class="link" href="s12.html#idx_id_28">D</a> <a class="link" href="s12.html#idx_id_29">E</a> <a class="link" href="s12.html#idx_id_30">F</a> <a class="link" href="s12.html#idx_id_31">G</a> <a class="link" href="s12.html#idx_id_32">H</a> <a class="link" href="s12.html#idx_id_33">I</a> <a class="link" href="s12.html#idx_id_34">L</a> <a class="link" href="s12.html#idx_id_35">M</a> <a class="link" href="s12.html#idx_id_36">N</a> <a class="link" href="s12.html#idx_id_37">P</a> <a class="link" href="s12.html#idx_id_38">Q</a> <a class="link" href="s12.html#idx_id_39">R</a> <a class="link" href="s12.html#idx_id_40">S</a> <a class="link" href="s12.html#idx_id_41">T</a> <a class="link" href="s12.html#idx_id_42">U</a> <a class="link" href="s12.html#idx_id_43">Z</a> </p>
<a name="id1366294"></a>Function Index</h2></div></div></div>
<p><a class="link" href="s12.html#idx_id_23">A</a> <a class="link" href="s12.html#idx_id_24">B</a> <a class="link" href="s12.html#idx_id_25">C</a> <a class="link" href="s12.html#idx_id_26">D</a> <a class="link" href="s12.html#idx_id_27">E</a> <a class="link" href="s12.html#idx_id_28">F</a> <a class="link" href="s12.html#idx_id_29">G</a> <a class="link" href="s12.html#idx_id_30">H</a> <a class="link" href="s12.html#idx_id_31">I</a> <a class="link" href="s12.html#idx_id_32">L</a> <a class="link" href="s12.html#idx_id_33">M</a> <a class="link" href="s12.html#idx_id_34">N</a> <a class="link" href="s12.html#idx_id_35">P</a> <a class="link" href="s12.html#idx_id_36">R</a> <a class="link" href="s12.html#idx_id_37">S</a> <a class="link" href="s12.html#idx_id_38">T</a> <a class="link" href="s12.html#idx_id_39">U</a> <a class="link" href="s12.html#idx_id_40">Z</a> </p>
<div class="variablelist"><dl>
<dt>
<a name="idx_id_25"></a><span class="term">A</span>
<a name="idx_id_23"></a><span class="term">A</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">acosh</span></dt>
@ -47,9 +47,17 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_26"></a><span class="term">B</span>
<a name="idx_id_24"></a><span class="term">B</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">beta</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/beta_function.html" title="Beta">Beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">C99 and TR1 C Functions</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">C99 and TR1 C Functions Overview</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">Incomplete Beta Functions</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1_ref.html" title="TR1 C Functions Quick Reference">TR1 C Functions Quick Reference</a></p></td></tr>
</table></dd>
<dt><span class="term">betac</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">Incomplete Beta Functions</a></p></td></tr></table></dd>
<dt><span class="term">betaf</span></dt>
@ -62,7 +70,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/factorials/sf_binomial.html" title="Binomial Coefficients">Binomial Coefficients</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_27"></a><span class="term">C</span>
<a name="idx_id_25"></a><span class="term">C</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">cbrt</span></dt>
@ -115,7 +123,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_28"></a><span class="term">D</span>
<a name="idx_id_26"></a><span class="term">D</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">digamma</span></dt>
@ -124,7 +132,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/factorials/sf_double_factorial.html" title="Double Factorial">Double Factorial</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_29"></a><span class="term">E</span>
<a name="idx_id_27"></a><span class="term">E</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">e</span></dt>
@ -193,7 +201,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_30"></a><span class="term">F</span>
<a name="idx_id_28"></a><span class="term">F</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">factorial</span></dt>
@ -230,7 +238,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/next_float/float_prior.html" title="Finding the Next Smaller Representable Value (float_prior)">Finding the Next Smaller Representable Value (float_prior)</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_31"></a><span class="term">G</span>
<a name="idx_id_29"></a><span class="term">G</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">gamma_p</span></dt>
@ -249,7 +257,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/sf_gamma/igamma_inv.html" title="Incomplete Gamma Function Inverses">Incomplete Gamma Function Inverses</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_32"></a><span class="term">H</span>
<a name="idx_id_30"></a><span class="term">H</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">halley_iterate</span></dt>
@ -272,7 +280,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_33"></a><span class="term">I</span>
<a name="idx_id_31"></a><span class="term">I</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">ibeta</span></dt>
@ -297,7 +305,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/fpclass.html" title="Floating-Point Classification: Infinities and NaN's">Floating-Point Classification: Infinities and NaN's</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_34"></a><span class="term">L</span>
<a name="idx_id_32"></a><span class="term">L</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">laguerre</span></dt>
@ -345,18 +353,16 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_35"></a><span class="term">M</span>
<a name="idx_id_33"></a><span class="term">M</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">make_policy</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
<dt><span class="term">mean</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html" title="Find Location (Mean) Example">Find Location (Mean) Example</a></p></td></tr></table></dd>
<dt><span class="term">msg</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_tutorial/user_def_err_pol.html" title="Calling User Defined Error Handlers">Calling User Defined Error Handlers</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_36"></a><span class="term">N</span>
<a name="idx_id_34"></a><span class="term">N</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">newton_raphson_iterate</span></dt>
@ -372,21 +378,14 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_tutorial/namespace_policies.html" title="Setting Policies at Namespace or Translation Unit Scope">Setting Policies at Namespace or Translation Unit Scope</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_37"></a><span class="term">P</span>
<a name="idx_id_35"></a><span class="term">P</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">powm1</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/powers/powm1.html" title="powm1">powm1</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_38"></a><span class="term">Q</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">quantile</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">Negative Binomial Sales Quota Example.</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_39"></a><span class="term">R</span>
<a name="idx_id_36"></a><span class="term">R</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">relative_error</span></dt>
@ -401,7 +400,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_40"></a><span class="term">S</span>
<a name="idx_id_37"></a><span class="term">S</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">schroeder_iterate</span></dt>
@ -432,7 +431,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/powers/sqrt1pm1.html" title="sqrt1pm1">sqrt1pm1</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_41"></a><span class="term">T</span>
<a name="idx_id_38"></a><span class="term">T</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">tgamma</span></dt>
@ -463,14 +462,14 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_42"></a><span class="term">U</span>
<a name="idx_id_39"></a><span class="term">U</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">user_domain_error</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_tutorial/user_def_err_pol.html" title="Calling User Defined Error Handlers">Calling User Defined Error Handlers</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_43"></a><span class="term">Z</span>
<a name="idx_id_40"></a><span class="term">Z</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">zeta</span></dt>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1368682"></a>Macro Index</h2></div></div></div>
<p><a class="link" href="s13.html#idx_id_44">B</a> <a class="link" href="s13.html#idx_id_45">F</a> </p>
<a name="id1370351"></a>Macro Index</h2></div></div></div>
<p><a class="link" href="s13.html#idx_id_41">B</a> <a class="link" href="s13.html#idx_id_42">F</a> </p>
<div class="variablelist"><dl>
<dt>
<a name="idx_id_44"></a><span class="term">B</span>
<a name="idx_id_41"></a><span class="term">B</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">BOOST_DEFINE_MATH_CONSTANT</span></dt>
@ -108,7 +108,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/policy_defaults.html" title="Using macros to Change the Policy Defaults">Using macros to Change the Policy Defaults</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_45"></a><span class="term">F</span>
<a name="idx_id_42"></a><span class="term">F</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">FP_INFINITE</span></dt>

View File

@ -16,11 +16,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id1371935"></a>Index</h2></div></div></div>
<p><a class="link" href="s14.html#idx_id_46">A</a> <a class="link" href="s14.html#idx_id_47">B</a> <a class="link" href="s14.html#idx_id_48">C</a> <a class="link" href="s14.html#idx_id_49">D</a> <a class="link" href="s14.html#idx_id_50">E</a> <a class="link" href="s14.html#idx_id_51">F</a> <a class="link" href="s14.html#idx_id_52">G</a> <a class="link" href="s14.html#idx_id_53">H</a> <a class="link" href="s14.html#idx_id_54">I</a> <a class="link" href="s14.html#idx_id_55">K</a> <a class="link" href="s14.html#idx_id_56">L</a> <a class="link" href="s14.html#idx_id_57">M</a> <a class="link" href="s14.html#idx_id_58">N</a> <a class="link" href="s14.html#idx_id_59">O</a> <a class="link" href="s14.html#idx_id_60">P</a> <a class="link" href="s14.html#idx_id_61">Q</a> <a class="link" href="s14.html#idx_id_62">R</a> <a class="link" href="s14.html#idx_id_63">S</a> <a class="link" href="s14.html#idx_id_64">T</a> <a class="link" href="s14.html#idx_id_65">U</a> <a class="link" href="s14.html#idx_id_66">V</a> <a class="link" href="s14.html#idx_id_67">W</a> <a class="link" href="s14.html#idx_id_68">Z</a> </p>
<a name="id1370873"></a>Index</h2></div></div></div>
<p><a class="link" href="s14.html#idx_id_43">A</a> <a class="link" href="s14.html#idx_id_44">B</a> <a class="link" href="s14.html#idx_id_45">C</a> <a class="link" href="s14.html#idx_id_46">D</a> <a class="link" href="s14.html#idx_id_47">E</a> <a class="link" href="s14.html#idx_id_48">F</a> <a class="link" href="s14.html#idx_id_49">G</a> <a class="link" href="s14.html#idx_id_50">H</a> <a class="link" href="s14.html#idx_id_51">I</a> <a class="link" href="s14.html#idx_id_52">K</a> <a class="link" href="s14.html#idx_id_53">L</a> <a class="link" href="s14.html#idx_id_54">M</a> <a class="link" href="s14.html#idx_id_55">N</a> <a class="link" href="s14.html#idx_id_56">O</a> <a class="link" href="s14.html#idx_id_57">P</a> <a class="link" href="s14.html#idx_id_58">R</a> <a class="link" href="s14.html#idx_id_59">S</a> <a class="link" href="s14.html#idx_id_60">T</a> <a class="link" href="s14.html#idx_id_61">U</a> <a class="link" href="s14.html#idx_id_62">V</a> <a class="link" href="s14.html#idx_id_63">W</a> <a class="link" href="s14.html#idx_id_64">Z</a> </p>
<div class="variablelist"><dl>
<dt>
<a name="idx_id_46"></a><span class="term">A</span>
<a name="idx_id_43"></a><span class="term">A</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">acosh</span></dt>
@ -50,7 +50,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_47"></a><span class="term">B</span>
<a name="idx_id_44"></a><span class="term">B</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Bernoulli Distribution</span></dt>
@ -67,9 +67,18 @@
<tr><td><p><a class="link" href="../math_toolkit/special/bessel/bessel.html" title="Bessel Functions of the First and Second Kinds">cyl_neumann</a></p></td></tr>
</table></dd>
<dt><span class="term">Beta</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/beta_function.html" title="Beta">Lanczos approximation</a></p></td></tr></table></dd>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/beta_function.html" title="Beta">beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/beta_function.html" title="Beta">Lanczos approximation</a></p></td></tr>
</table></dd>
<dt><span class="term">beta</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/dist_construct_eg.html" title="Distribution Construction Example">Distribution Construction Example</a></p></td></tr></table></dd>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/beta_function.html" title="Beta">Beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">C99 and TR1 C Functions</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">C99 and TR1 C Functions Overview</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">Incomplete Beta Functions</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1_ref.html" title="TR1 C Functions Quick Reference">TR1 C Functions Quick Reference</a></p></td></tr>
</table></dd>
<dt><span class="term">Beta Distribution</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/beta_dist.html" title="Beta Distribution">beta_distribution</a></p></td></tr>
@ -185,7 +194,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/policy_defaults.html" title="Using macros to Change the Policy Defaults">Using macros to Change the Policy Defaults</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_48"></a><span class="term">C</span>
<a name="idx_id_45"></a><span class="term">C</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">C99 and TR1 C Functions</span></dt>
@ -193,6 +202,7 @@
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">acosh</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">asinh</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">atanh</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">betaf</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">cbrt</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/main_overview/tr1.html" title="C99 and TR1 C Functions">comp_ellint_2</a></p></td></tr>
@ -229,6 +239,7 @@
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">acosh</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">asinh</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">atanh</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">betaf</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">cbrt</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">comp_ellint_2</a></p></td></tr>
@ -369,7 +380,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_49"></a><span class="term">D</span>
<a name="idx_id_46"></a><span class="term">D</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">denorm_error_type</span></dt>
@ -401,7 +412,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_50"></a><span class="term">E</span>
<a name="idx_id_47"></a><span class="term">E</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">e</span></dt>
@ -473,13 +484,9 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
<dt><span class="term">Examples</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/dist_construct_eg.html" title="Distribution Construction Example">beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html" title="Binomial Quiz Example">BOOST_MATH_DISCRETE_QUANTILE_POLICY</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/error_eg.html" title="Error Handling Example">BOOST_MATH_DOMAIN_ERROR_POLICY</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">BOOST_MATH_OVERFLOW_ERROR_POLICY</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html" title="Find Location (Mean) Example">mean</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/dist_construct_eg.html" title="Distribution Construction Example">negative_binomial</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">quantile</a></p></td></tr>
</table></dd>
<dt><span class="term">expint</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
@ -517,7 +524,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/extreme_dist.html" title="Extreme Value Distribution">Extreme Value Distribution</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_51"></a><span class="term">F</span>
<a name="idx_id_48"></a><span class="term">F</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">F Distribution</span></dt>
@ -596,7 +603,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/fpclass.html" title="Floating-Point Classification: Infinities and NaN's">Floating-Point Classification: Infinities and NaN's</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_52"></a><span class="term">G</span>
<a name="idx_id_49"></a><span class="term">G</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Gamma</span></dt>
@ -634,7 +641,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_53"></a><span class="term">H</span>
<a name="idx_id_50"></a><span class="term">H</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">halley_iterate</span></dt>
@ -662,7 +669,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_54"></a><span class="term">I</span>
<a name="idx_id_51"></a><span class="term">I</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">ibeta</span></dt>
@ -699,6 +706,7 @@
</table></dd>
<dt><span class="term">Incomplete Beta Functions</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">betac</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">ibeta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/sf_beta/ibeta_function.html" title="Incomplete Beta Functions">ibetac</a></p></td></tr>
@ -729,14 +737,14 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_55"></a><span class="term">K</span>
<a name="idx_id_52"></a><span class="term">K</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Known Issues, and Todo List</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/status/issues.html" title="Known Issues, and Todo List">Lanczos approximation</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_56"></a><span class="term">L</span>
<a name="idx_id_53"></a><span class="term">L</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">laguerre</span></dt>
@ -834,13 +842,11 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_57"></a><span class="term">M</span>
<a name="idx_id_54"></a><span class="term">M</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">make_policy</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
<dt><span class="term">mean</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html" title="Find Location (Mean) Example">Find Location (Mean) Example</a></p></td></tr></table></dd>
<dt><span class="term">Modified Bessel Functions of the First and Second Kinds</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/special/bessel/mbessel.html" title="Modified Bessel Functions of the First and Second Kinds">cyl_bessel_i</a></p></td></tr>
@ -850,7 +856,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_tutorial/user_def_err_pol.html" title="Calling User Defined Error Handlers">Calling User Defined Error Handlers</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_58"></a><span class="term">N</span>
<a name="idx_id_55"></a><span class="term">N</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Negative Binomial Distribution</span></dt>
@ -862,8 +868,6 @@
<tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html" title="Negative Binomial Distribution">policy_type</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html" title="Negative Binomial Distribution">value_type</a></p></td></tr>
</table></dd>
<dt><span class="term">negative_binomial</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/dist_construct_eg.html" title="Distribution Construction Example">Distribution Construction Example</a></p></td></tr></table></dd>
<dt><span class="term">negative_binomial_distribution</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/negative_binomial_dist.html" title="Negative Binomial Distribution">Negative Binomial Distribution</a></p></td></tr></table></dd>
<dt><span class="term">newton_raphson_iterate</span></dt>
@ -923,14 +927,14 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/toolkit/internals1/constants.html" title="Numeric Constants">e</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_59"></a><span class="term">O</span>
<a name="idx_id_56"></a><span class="term">O</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">overflow_error_type</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_60"></a><span class="term">P</span>
<a name="idx_id_57"></a><span class="term">P</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Pareto Distribution</span></dt>
@ -1016,14 +1020,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_61"></a><span class="term">Q</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">quantile</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">Negative Binomial Sales Quota Example.</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_62"></a><span class="term">R</span>
<a name="idx_id_58"></a><span class="term">R</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Ratios of Gamma Functions</span></dt>
@ -1070,7 +1067,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">Policy Class Reference</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_63"></a><span class="term">S</span>
<a name="idx_id_59"></a><span class="term">S</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">schroeder_iterate</span></dt>
@ -1136,7 +1133,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/students_t_dist.html" title="Students t Distribution">Students t Distribution</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_64"></a><span class="term">T</span>
<a name="idx_id_60"></a><span class="term">T</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">test_data</span></dt>
@ -1163,6 +1160,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/special/sf_gamma/gamma_ratios.html" title="Ratios of Gamma Functions">Ratios of Gamma Functions</a></p></td></tr></table></dd>
<dt><span class="term">TR1 C Functions Quick Reference</span></dt>
<dd><table class="simplelist" border="0" summary="Simple list">
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1_ref.html" title="TR1 C Functions Quick Reference">beta</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1_ref.html" title="TR1 C Functions Quick Reference">betaf</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1_ref.html" title="TR1 C Functions Quick Reference">comp_ellint_2</a></p></td></tr>
<tr><td><p><a class="link" href="../math_toolkit/special/extern_c/tr1_ref.html" title="TR1 C Functions Quick Reference">comp_ellint_3</a></p></td></tr>
@ -1195,7 +1193,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_65"></a><span class="term">U</span>
<a name="idx_id_61"></a><span class="term">U</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">underflow_error_type</span></dt>
@ -1233,7 +1231,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/using_udt/use_ntl.html" title="Using With NTL - a High-Precision Floating-Point Library">Lanczos approximation</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_66"></a><span class="term">V</span>
<a name="idx_id_62"></a><span class="term">V</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">value_type</span></dt>
@ -1266,7 +1264,7 @@
</table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_67"></a><span class="term">W</span>
<a name="idx_id_63"></a><span class="term">W</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">Weibull Distribution</span></dt>
@ -1279,7 +1277,7 @@
<dd><table class="simplelist" border="0" summary="Simple list"><tr><td><p><a class="link" href="../math_toolkit/dist/dist_ref/dists/weibull.html" title="Weibull Distribution">Weibull Distribution</a></p></td></tr></table></dd>
</dl></div></dd>
<dt>
<a name="idx_id_68"></a><span class="term">Z</span>
<a name="idx_id_64"></a><span class="term">Z</span>
</dt>
<dd><div class="variablelist"><dl>
<dt><span class="term">zeta</span></dt>

View File

@ -17,16 +17,15 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="math_toolkit.backgrounders"></a><a class="link" href="backgrounders.html" title="Backgrounders"> Backgrounders</a>
<a name="math_toolkit.backgrounders"></a><a class="link" href="backgrounders.html" title="Backgrounders">Backgrounders</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="backgrounders/implementation.html"> Additional
<dt><span class="section"><a href="backgrounders/implementation.html">Additional
Implementation Notes</a></span></dt>
<dt><span class="section"><a href="backgrounders/relative_error.html"> Relative
Error</a></span></dt>
<dt><span class="section"><a href="backgrounders/lanczos.html"> The Lanczos Approximation</a></span></dt>
<dt><span class="section"><a href="backgrounders/remez.html"> The Remez Method</a></span></dt>
<dt><span class="section"><a href="backgrounders/refs.html"> References</a></span></dt>
<dt><span class="section"><a href="backgrounders/relative_error.html">Relative Error</a></span></dt>
<dt><span class="section"><a href="backgrounders/lanczos.html">The Lanczos Approximation</a></span></dt>
<dt><span class="section"><a href="backgrounders/remez.html">The Remez Method</a></span></dt>
<dt><span class="section"><a href="backgrounders/refs.html">References</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.backgrounders.implementation"></a><a class="link" href="implementation.html" title="Additional Implementation Notes"> Additional
<a name="math_toolkit.backgrounders.implementation"></a><a class="link" href="implementation.html" title="Additional Implementation Notes">Additional
Implementation Notes</a>
</h3></div></div></div>
<p>
@ -26,7 +26,7 @@
and reflect more the general implementation philosophy used.
</p>
<a name="math_toolkit.backgrounders.implementation.implemention_philosophy"></a><h5>
<a name="id1352305"></a>
<a name="id1352034"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.implemention_philosophy">Implemention
philosophy</a>
</h5>
@ -78,7 +78,7 @@
These could still provide sufficient accuracy for some speed-critical applications.
</p>
<a name="math_toolkit.backgrounders.implementation.accuracy_and_representation_of_test_values"></a><h5>
<a name="id1352368"></a>
<a name="id1352098"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.accuracy_and_representation_of_test_values">Accuracy
and Representation of Test Values</a>
</h5>
@ -123,7 +123,7 @@
binary value).
</p>
<a name="math_toolkit.backgrounders.implementation.tolerance_of_tests"></a><h5>
<a name="id1353834"></a>
<a name="id1352242"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.tolerance_of_tests">Tolerance
of Tests</a>
</h5>
@ -149,7 +149,7 @@
first that the suffix L is present, and then that the tolerance is big enough.
</p>
<a name="math_toolkit.backgrounders.implementation.handling_unsuitable_arguments"></a><h5>
<a name="id1353879"></a>
<a name="id1352286"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.handling_unsuitable_arguments">Handling
Unsuitable Arguments</a>
</h5>
@ -217,7 +217,7 @@
</p></td></tr>
</table></div>
<a name="math_toolkit.backgrounders.implementation.handling_of_functions_that_are_not_mathematically_defined"></a><h5>
<a name="id1354011"></a>
<a name="id1352418"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.handling_of_functions_that_are_not_mathematically_defined">Handling
of Functions that are Not Mathematically defined</a>
</h5>
@ -251,7 +251,7 @@
</p></td></tr>
</table></div>
<a name="math_toolkit.backgrounders.implementation.median_of_distributions"></a><h5>
<a name="id1354097"></a>
<a name="id1352505"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.median_of_distributions">Median
of distributions</a>
</h5>
@ -284,7 +284,7 @@
Basic Statistics.</a> give more detail, in particular for discrete distributions.
</p>
<a name="math_toolkit.backgrounders.implementation.handling_of_floating_point_infinity"></a><h5>
<a name="id1354197"></a>
<a name="id1352604"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.handling_of_floating_point_infinity">Handling
of Floating-Point Infinity</a>
</h5>
@ -328,7 +328,7 @@
handling policies</a>.
</p>
<a name="math_toolkit.backgrounders.implementation.scale__shape_and_location"></a><h5>
<a name="id1354285"></a>
<a name="id1352693"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.scale__shape_and_location">Scale,
Shape and Location</a>
</h5>
@ -355,7 +355,7 @@
functions, they can be added if required.
</p>
<a name="math_toolkit.backgrounders.implementation.notes_on_implementation_of_specific_functions__amp__distributions"></a><h5>
<a name="id1354620"></a>
<a name="id1354863"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.notes_on_implementation_of_specific_functions__amp__distributions">Notes
on Implementation of Specific Functions &amp; Distributions</a>
</h5>
@ -367,7 +367,7 @@
lower = -1, mode = 0 and upper = 1 would be more suitable.
</li></ul></div>
<a name="math_toolkit.backgrounders.implementation.rational_approximations_used"></a><h5>
<a name="id1354644"></a>
<a name="id1354887"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.rational_approximations_used">Rational
Approximations Used</a>
</h5>
@ -410,7 +410,7 @@
to the "true" minimax solution.
</p>
<a name="math_toolkit.backgrounders.implementation.representation_of_mathematical_constants"></a><h5>
<a name="id1354689"></a>
<a name="id1354931"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.representation_of_mathematical_constants">Representation
of Mathematical Constants</a>
</h5>
@ -471,7 +471,7 @@
</span><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">constants</span><span class="special">::</span><span class="identifier">pi</span><span class="special">();</span> <span class="comment">// Context does not allow for disambiguation of overloaded function
</span></pre>
<a name="math_toolkit.backgrounders.implementation.thread_safety"></a><h5>
<a name="id1355076"></a>
<a name="id1355319"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.thread_safety">Thread
safety</a>
</h5>
@ -496,7 +496,7 @@
the right thing here at some point.
</p>
<a name="math_toolkit.backgrounders.implementation.sources_of_test_data"></a><h5>
<a name="id1355112"></a>
<a name="id1355355"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.sources_of_test_data">Sources
of Test Data</a>
</h5>
@ -534,7 +534,7 @@
the underlying special function is known to be difficult to implement.
</p>
<a name="math_toolkit.backgrounders.implementation.creating_and_managing_the_equations"></a><h5>
<a name="id1355177"></a>
<a name="id1355420"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.creating_and_managing_the_equations">Creating
and Managing the Equations</a>
</h5>
@ -695,7 +695,7 @@ done</pre>
HTML: this needs further investigation.
</p>
<a name="math_toolkit.backgrounders.implementation.producing_graphs"></a><h5>
<a name="id1355359"></a>
<a name="id1355602"></a>
<a class="link" href="implementation.html#math_toolkit.backgrounders.implementation.producing_graphs">Producing
Graphs</a>
</h5>

View File

@ -17,10 +17,10 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.backgrounders.lanczos"></a><a class="link" href="lanczos.html" title="The Lanczos Approximation"> The Lanczos Approximation</a>
<a name="math_toolkit.backgrounders.lanczos"></a><a class="link" href="lanczos.html" title="The Lanczos Approximation">The Lanczos Approximation</a>
</h3></div></div></div>
<a name="math_toolkit.backgrounders.lanczos.motivation"></a><h5>
<a name="id1355585"></a>
<a name="id1355824"></a>
<a class="link" href="lanczos.html#math_toolkit.backgrounders.lanczos.motivation">Motivation</a>
</h5>
<p>
@ -92,7 +92,7 @@
functions divided by large powers into single (simpler) expressions.
</p>
<a name="math_toolkit.backgrounders.lanczos.the_approximation"></a><h5>
<a name="id1355841"></a>
<a name="id1356080"></a>
<a class="link" href="lanczos.html#math_toolkit.backgrounders.lanczos.the_approximation">The
Approximation</a>
</h5>
@ -154,7 +154,7 @@
</p></td></tr>
</table></div>
<a name="math_toolkit.backgrounders.lanczos.computing_the_coefficients"></a><h5>
<a name="id1356557"></a>
<a name="id1356272"></a>
<a class="link" href="lanczos.html#math_toolkit.backgrounders.lanczos.computing_the_coefficients">Computing
the Coefficients</a>
</h5>
@ -198,7 +198,7 @@
multiplied by <span class="emphasis"><em>F</em></span> as the last step.
</p>
<a name="math_toolkit.backgrounders.lanczos.choosing_the_right_parameters"></a><h5>
<a name="id1356714"></a>
<a name="id1356429"></a>
<a class="link" href="lanczos.html#math_toolkit.backgrounders.lanczos.choosing_the_right_parameters">Choosing
the Right Parameters</a>
</h5>
@ -222,7 +222,7 @@
computing to float precision with double precision arithmetic.
</p>
<div class="table">
<a name="id1356768"></a><p class="title"><b>Table&#160;53.&#160;Optimal choices for N and g when computing with guard digits (source:
<a name="id1356483"></a><p class="title"><b>Table&#160;53.&#160;Optimal choices for N and g when computing with guard digits (source:
Pugh)</b></p>
<div class="table-contents"><table class="table" summary="Optimal choices for N and g when computing with guard digits (source:
Pugh)">
@ -365,7 +365,7 @@
exactly matches the machine epsilon for the type in question.
</p>
<div class="table">
<a name="id1356991"></a><p class="title"><b>Table&#160;54.&#160;Optimum value for N and g when computing at fixed precision</b></p>
<a name="id1356706"></a><p class="title"><b>Table&#160;54.&#160;Optimum value for N and g when computing at fixed precision</b></p>
<div class="table-contents"><table class="table" summary="Optimum value for N and g when computing at fixed precision">
<colgroup>
<col>
@ -528,16 +528,16 @@
is exact, and so isn't used for the gamma function.
</p>
<a name="math_toolkit.backgrounders.lanczos.references"></a><h5>
<a name="id1357249"></a>
<a name="id1358334"></a>
<a class="link" href="lanczos.html#math_toolkit.backgrounders.lanczos.references">References</a>
</h5>
<a name="godfrey"></a><a name="pugh"></a><div class="orderedlist"><ol type="1">
<div class="orderedlist"><ol type="1">
<li>
Paul Godfrey, <a href="http://my.fit.edu/~gabdo/gamma.txt" target="_top">"A
<a name="godfrey"></a> Paul Godfrey, <a href="http://my.fit.edu/~gabdo/gamma.txt" target="_top">"A
note on the computation of the convergent Lanczos complex Gamma approximation"</a>.
</li>
<li>
Glendon Ralph Pugh, <a href="http://bh0.physics.ubc.ca/People/matt/Doc/ThesesOthers/Phd/pugh.pdf" target="_top">"An
<a name="pugh"></a> Glendon Ralph Pugh, <a href="http://bh0.physics.ubc.ca/People/matt/Doc/ThesesOthers/Phd/pugh.pdf" target="_top">"An
Analysis of the Lanczos Gamma Approximation"</a>, PhD Thesis
November 2004.
</li>

View File

@ -17,10 +17,10 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.backgrounders.refs"></a><a class="link" href="refs.html" title="References"> References</a>
<a name="math_toolkit.backgrounders.refs"></a><a class="link" href="refs.html" title="References">References</a>
</h3></div></div></div>
<a name="math_toolkit.backgrounders.refs.general_references"></a><h5>
<a name="id1358172"></a>
<a name="id1359257"></a>
<a class="link" href="refs.html#math_toolkit.backgrounders.refs.general_references">General
references</a>
</h5>
@ -84,7 +84,7 @@
Library (version 2), Walter E. Brown</a>
</p>
<a name="math_toolkit.backgrounders.refs.calculators__that_we_found__and_used_to_cross_check___as_far_as_their_widely_varying_accuracy_allowed__"></a><h5>
<a name="id1358263"></a>
<a name="id1359348"></a>
<a class="link" href="refs.html#math_toolkit.backgrounders.refs.calculators__that_we_found__and_used_to_cross_check___as_far_as_their_widely_varying_accuracy_allowed__">Calculators*
that we found (and used to cross-check - as far as their widely-varying accuracy
allowed).</a>
@ -94,7 +94,7 @@
Binomial Probability Distribution Calculator.
</p>
<a name="math_toolkit.backgrounders.refs.other_libraries"></a><h5>
<a name="id1358287"></a>
<a name="id1359372"></a>
<a class="link" href="refs.html#math_toolkit.backgrounders.refs.other_libraries">Other Libraries</a>
</h5>
<p>

View File

@ -17,8 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.backgrounders.relative_error"></a><a class="link" href="relative_error.html" title="Relative Error"> Relative
Error</a>
<a name="math_toolkit.backgrounders.relative_error"></a><a class="link" href="relative_error.html" title="Relative Error">Relative Error</a>
</h3></div></div></div>
<p>
Given an actual value <span class="emphasis"><em>a</em></span> and a found value <span class="emphasis"><em>v</em></span>
@ -71,10 +70,8 @@
errors differ by a factor of 2, can actually be accurate to the same number
of binary digits. You have been warned!
</p>
<a name="zero_error"></a><p>
</p>
<a name="math_toolkit.backgrounders.relative_error.the_impossibility_of_zero_error"></a><h5>
<a name="id1355542"></a>
<a name="zero_error"></a><a name="math_toolkit.backgrounders.relative_error.the_impossibility_of_zero_error"></a><h5>
<a name="id1355781"></a>
<a class="link" href="relative_error.html#math_toolkit.backgrounders.relative_error.the_impossibility_of_zero_error">The
Impossibility of Zero Error</a>
</h5>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.backgrounders.remez"></a><a class="link" href="remez.html" title="The Remez Method"> The Remez Method</a>
<a name="math_toolkit.backgrounders.remez"></a><a class="link" href="remez.html" title="The Remez Method">The Remez Method</a>
</h3></div></div></div>
<p>
The <a href="http://en.wikipedia.org/wiki/Remez_algorithm" target="_top">Remez algorithm</a>
@ -87,7 +87,7 @@
are located!</em></span>
</p>
<a name="math_toolkit.backgrounders.remez.the_remez_method"></a><h5>
<a name="id1357433"></a>
<a name="id1358518"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.the_remez_method">The Remez
Method</a>
</h5>
@ -167,7 +167,7 @@
</td></tr>
</table></div>
<a name="math_toolkit.backgrounders.remez.remez_step_1"></a><h5>
<a name="id1357585"></a>
<a name="id1358670"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.remez_step_1">Remez Step
1</a>
</h5>
@ -198,7 +198,7 @@
to 5.6x10<sup>-4</sup>.
</p>
<a name="math_toolkit.backgrounders.remez.remez_step_2"></a><h5>
<a name="id1357660"></a>
<a name="id1358745"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.remez_step_2">Remez Step
2</a>
</h5>
@ -227,7 +227,7 @@
In our example we perform multi-point exchange.
</p>
<a name="math_toolkit.backgrounders.remez.iteration"></a><h5>
<a name="id1357691"></a>
<a name="id1358776"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.iteration">Iteration</a>
</h5>
<p>
@ -243,7 +243,7 @@
<span class="inlinemediaobject"><img src="../../../graphs/remez-4.png" alt="remez-4"></span>
</p>
<a name="math_toolkit.backgrounders.remez.rational_approximations"></a><h5>
<a name="id1357735"></a>
<a name="id1358820"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.rational_approximations">Rational
Approximations</a>
</h5>
@ -292,7 +292,7 @@
number of terms overall.
</p>
<a name="math_toolkit.backgrounders.remez.practical_considerations"></a><h5>
<a name="id1357816"></a>
<a name="id1358901"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.practical_considerations">Practical
Considerations</a>
</h5>
@ -400,7 +400,7 @@
desired minimax solution (5x10<sup>-4</sup>).
</p>
<a name="math_toolkit.backgrounders.remez.remez_method_checklist"></a><h5>
<a name="id1357970"></a>
<a name="id1359055"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.remez_method_checklist">Remez
Method Checklist</a>
</h5>
@ -454,7 +454,7 @@
</li>
</ul></div>
<a name="math_toolkit.backgrounders.remez.references"></a><h5>
<a name="id1358053"></a>
<a name="id1359138"></a>
<a class="link" href="remez.html#math_toolkit.backgrounders.remez.references">References</a>
</h5>
<p>

View File

@ -17,157 +17,154 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="math_toolkit.dist"></a><a class="link" href="dist.html" title="Statistical Distributions and Functions"> Statistical Distributions and Functions</a>
<a name="math_toolkit.dist"></a><a class="link" href="dist.html" title="Statistical Distributions and Functions">Statistical Distributions and Functions</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="dist/stat_tut.html"> Statistical Distributions
<dt><span class="section"><a href="dist/stat_tut.html">Statistical Distributions
Tutorial</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/overview.html"> Overview</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg.html"> Worked Examples</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/overview.html">Overview</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg.html">Worked Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/dist_construct_eg.html">
Distribution Construction Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg.html"> Student's
t Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/tut_mean_intervals.html">
Calculating confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/tut_mean_test.html">
Testing a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/tut_mean_size.html">
Estimating how large a sample size would have to become in order to give
a significant Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/two_sample_students_t.html">
Comparing the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/paired_st.html">
Comparing two paired samples with the Student's t distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg.html"> Chi Squared
<dt><span class="section"><a href="dist/stat_tut/weg/dist_construct_eg.html">Distribution
Construction Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg.html">Student's t
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg/chi_sq_intervals.html">
Confidence Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg/chi_sq_test.html">
Chi-Square Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg/chi_sq_size.html">
Estimating the Required Sample Sizes for a Chi-Square Test for the Standard
Deviation</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/tut_mean_intervals.html">Calculating
confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/tut_mean_test.html">Testing
a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/tut_mean_size.html">Estimating
how large a sample size would have to become in order to give a significant
Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/two_sample_students_t.html">Comparing
the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/st_eg/paired_st.html">Comparing
two paired samples with the Student's t distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/f_eg.html"> F Distribution
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg.html">Chi Squared
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg/chi_sq_intervals.html">Confidence
Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg/chi_sq_test.html">Chi-Square
Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/cs_eg/chi_sq_size.html">Estimating
the Required Sample Sizes for a Chi-Square Test for the Standard Deviation</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/f_eg.html">F Distribution
Examples</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg.html"> Binomial
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg.html">Binomial
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binomial_coinflip_example.html">
Binomial Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binomial_quiz_example.html">
Binomial Quiz Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for a Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binom_size_eg.html">
Estimating Sample Sizes for a Binomial Distribution.</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binomial_coinflip_example.html">Binomial
Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binomial_quiz_example.html">Binomial
Quiz Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for a Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/binom_eg/binom_size_eg.html">Estimating
Sample Sizes for a Binomial Distribution.</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg.html"> Negative
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg.html">Negative
Binomial Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/neg_binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for the
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html">
Estimating Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html">
Negative Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/negative_binomial_example2.html">
Negative Binomial Table Printing Example.</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/neg_binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for the Negative Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html">Estimating
Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html">Negative
Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/neg_binom_eg/negative_binomial_example2.html">Negative
Binomial Table Printing Example.</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/normal_example.html"> Normal
<dt><span class="section"><a href="dist/stat_tut/weg/normal_example.html">Normal
Distribution Examples</a></span></dt>
<dd><dl><dt><span class="section"><a href="dist/stat_tut/weg/normal_example/normal_misc.html">
Some Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/nccs_eg.html"> Non Central
<dd><dl><dt><span class="section"><a href="dist/stat_tut/weg/normal_example/normal_misc.html">Some
Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/nccs_eg.html">Non Central
Chi Squared Example</a></span></dt>
<dd><dl><dt><span class="section"><a href="dist/stat_tut/weg/nccs_eg/nccs_power_eg.html">
Tables of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/error_eg.html"> Error Handling
<dd><dl><dt><span class="section"><a href="dist/stat_tut/weg/nccs_eg/nccs_power_eg.html">Tables
of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/error_eg.html">Error Handling
Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg.html"> Find Location
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg.html">Find Location
and Scale Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg/find_location_eg.html">
Find Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg/find_scale_eg.html">
Find Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html">
Find mean and standard deviation example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg/find_location_eg.html">Find
Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg/find_scale_eg.html">Find
Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html">Find
mean and standard deviation example</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/weg/nag_library.html"> Comparison
<dt><span class="section"><a href="dist/stat_tut/weg/nag_library.html">Comparison
with C, R, FORTRAN-style Free Functions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/stat_tut/variates.html"> Random Variates
<dt><span class="section"><a href="dist/stat_tut/variates.html">Random Variates
and Distribution Parameters</a></span></dt>
<dt><span class="section"><a href="dist/stat_tut/dist_params.html"> Discrete Probability
<dt><span class="section"><a href="dist/stat_tut/dist_params.html">Discrete Probability
Distributions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/dist_ref.html"> Statistical Distributions
<dt><span class="section"><a href="dist/dist_ref.html">Statistical Distributions
Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/dist_ref/nmp.html"> Non-Member Properties</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists.html"> Distributions</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/nmp.html">Non-Member Properties</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists.html">Distributions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist/dist_ref/dists/bernoulli_dist.html">
Bernoulli Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/beta_dist.html"> Beta
<dt><span class="section"><a href="dist/dist_ref/dists/bernoulli_dist.html">Bernoulli
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/binomial_dist.html">
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/cauchy_dist.html"> Cauchy-Lorentz
<dt><span class="section"><a href="dist/dist_ref/dists/beta_dist.html">Beta
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/chi_squared_dist.html">
Chi Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/exp_dist.html"> Exponential
<dt><span class="section"><a href="dist/dist_ref/dists/binomial_dist.html">Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/extreme_dist.html"> Extreme
<dt><span class="section"><a href="dist/dist_ref/dists/cauchy_dist.html">Cauchy-Lorentz
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/chi_squared_dist.html">Chi
Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/exp_dist.html">Exponential
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/extreme_dist.html">Extreme
Value Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/f_dist.html"> F Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/gamma_dist.html"> Gamma
<dt><span class="section"><a href="dist/dist_ref/dists/f_dist.html">F Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/gamma_dist.html">Gamma
(and Erlang) Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/logistic_dist.html">
Logistic Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/lognormal_dist.html">
Log Normal Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/negative_binomial_dist.html">
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/nc_beta_dist.html"> Noncentral
<dt><span class="section"><a href="dist/dist_ref/dists/logistic_dist.html">Logistic
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/lognormal_dist.html">Log
Normal Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/negative_binomial_dist.html">Negative
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/nc_beta_dist.html">Noncentral
Beta Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/nc_chi_squared_dist.html">
Noncentral Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/nc_f_dist.html"> Noncentral
<dt><span class="section"><a href="dist/dist_ref/dists/nc_chi_squared_dist.html">Noncentral
Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/nc_f_dist.html">Noncentral
F Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/nc_t_dist.html"> Noncentral
<dt><span class="section"><a href="dist/dist_ref/dists/nc_t_dist.html">Noncentral
T Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/normal_dist.html"> Normal
<dt><span class="section"><a href="dist/dist_ref/dists/normal_dist.html">Normal
(Gaussian) Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/pareto.html"> Pareto
<dt><span class="section"><a href="dist/dist_ref/dists/pareto.html">Pareto Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/poisson_dist.html">Poisson
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/poisson_dist.html"> Poisson
<dt><span class="section"><a href="dist/dist_ref/dists/rayleigh.html">Rayleigh
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/rayleigh.html"> Rayleigh
<dt><span class="section"><a href="dist/dist_ref/dists/students_t_dist.html">Students
t Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/triangular_dist.html">Triangular
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/students_t_dist.html">
Students t Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/triangular_dist.html">
Triangular Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/weibull.html"> Weibull
<dt><span class="section"><a href="dist/dist_ref/dists/weibull.html">Weibull
Distribution</a></span></dt>
<dt><span class="section"><a href="dist/dist_ref/dists/uniform_dist.html"> Uniform
<dt><span class="section"><a href="dist/dist_ref/dists/uniform_dist.html">Uniform
Distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/dist_ref/dist_algorithms.html"> Distribution
<dt><span class="section"><a href="dist/dist_ref/dist_algorithms.html">Distribution
Algorithms</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist/future.html"> Extras/Future Directions</a></span></dt>
<dt><span class="section"><a href="dist/future.html">Extras/Future Directions</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,62 +17,61 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.dist.dist_ref"></a><a class="link" href="dist_ref.html" title="Statistical Distributions Reference"> Statistical Distributions
<a name="math_toolkit.dist.dist_ref"></a><a class="link" href="dist_ref.html" title="Statistical Distributions Reference">Statistical Distributions
Reference</a>
</h3></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="dist_ref/nmp.html"> Non-Member Properties</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists.html"> Distributions</a></span></dt>
<dt><span class="section"><a href="dist_ref/nmp.html">Non-Member Properties</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists.html">Distributions</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="dist_ref/dists/bernoulli_dist.html">
Bernoulli Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/beta_dist.html"> Beta
<dt><span class="section"><a href="dist_ref/dists/bernoulli_dist.html">Bernoulli
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/binomial_dist.html">
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/cauchy_dist.html"> Cauchy-Lorentz
<dt><span class="section"><a href="dist_ref/dists/beta_dist.html">Beta
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/chi_squared_dist.html">
Chi Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/exp_dist.html"> Exponential
<dt><span class="section"><a href="dist_ref/dists/binomial_dist.html">Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/extreme_dist.html"> Extreme
<dt><span class="section"><a href="dist_ref/dists/cauchy_dist.html">Cauchy-Lorentz
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/chi_squared_dist.html">Chi
Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/exp_dist.html">Exponential
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/extreme_dist.html">Extreme
Value Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/f_dist.html"> F Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/gamma_dist.html"> Gamma
<dt><span class="section"><a href="dist_ref/dists/f_dist.html">F Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/gamma_dist.html">Gamma
(and Erlang) Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/logistic_dist.html">
Logistic Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/lognormal_dist.html">
Log Normal Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/negative_binomial_dist.html">
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/nc_beta_dist.html"> Noncentral
<dt><span class="section"><a href="dist_ref/dists/logistic_dist.html">Logistic
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/lognormal_dist.html">Log
Normal Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/negative_binomial_dist.html">Negative
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/nc_beta_dist.html">Noncentral
Beta Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/nc_chi_squared_dist.html">
Noncentral Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/nc_f_dist.html"> Noncentral
<dt><span class="section"><a href="dist_ref/dists/nc_chi_squared_dist.html">Noncentral
Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/nc_f_dist.html">Noncentral
F Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/nc_t_dist.html"> Noncentral
<dt><span class="section"><a href="dist_ref/dists/nc_t_dist.html">Noncentral
T Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/normal_dist.html"> Normal
<dt><span class="section"><a href="dist_ref/dists/normal_dist.html">Normal
(Gaussian) Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/pareto.html"> Pareto
<dt><span class="section"><a href="dist_ref/dists/pareto.html">Pareto Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/poisson_dist.html">Poisson
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/poisson_dist.html"> Poisson
<dt><span class="section"><a href="dist_ref/dists/rayleigh.html">Rayleigh
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/rayleigh.html"> Rayleigh
<dt><span class="section"><a href="dist_ref/dists/students_t_dist.html">Students
t Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/triangular_dist.html">Triangular
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/students_t_dist.html">
Students t Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/triangular_dist.html">
Triangular Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/weibull.html"> Weibull
<dt><span class="section"><a href="dist_ref/dists/weibull.html">Weibull
Distribution</a></span></dt>
<dt><span class="section"><a href="dist_ref/dists/uniform_dist.html"> Uniform
<dt><span class="section"><a href="dist_ref/dists/uniform_dist.html">Uniform
Distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="dist_ref/dist_algorithms.html"> Distribution
<dt><span class="section"><a href="dist_ref/dist_algorithms.html">Distribution
Algorithms</a></span></dt>
</dl></div>
</div>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.dist_ref.dist_algorithms"></a><a class="link" href="dist_algorithms.html" title="Distribution Algorithms"> Distribution
<a name="math_toolkit.dist.dist_ref.dist_algorithms"></a><a class="link" href="dist_algorithms.html" title="Distribution Algorithms">Distribution
Algorithms</a>
</h4></div></div></div>
<a name="math_toolkit.dist.dist_ref.dist_algorithms.finding_the_location_and_scale_for_normal_and_similar_distributions"></a><h5>
<a name="id1133481"></a>
<a name="id1133791"></a>
<a class="link" href="dist_algorithms.html#math_toolkit.dist.dist_ref.dist_algorithms.finding_the_location_and_scale_for_normal_and_similar_distributions">Finding
the Location and Scale for Normal and similar distributions</a>
</h5>
@ -43,7 +43,7 @@
</span><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">complement</span><span class="special">;</span> <span class="comment">// Will be needed by users who want to use complements.
</span></pre>
<a name="math_toolkit.dist.dist_ref.dist_algorithms.find_location_function"></a><h5>
<a name="id1133578"></a>
<a name="id1133888"></a>
<a class="link" href="dist_algorithms.html#math_toolkit.dist.dist_ref.dist_algorithms.find_location_function">find_location
function</a>
</h5>
@ -73,7 +73,7 @@
<span class="special">}}</span> <span class="comment">// namespaces
</span></pre>
<a name="math_toolkit.dist.dist_ref.dist_algorithms.find_scale_function"></a><h5>
<a name="id1134024"></a>
<a name="id1134334"></a>
<a class="link" href="dist_algorithms.html#math_toolkit.dist.dist_ref.dist_algorithms.find_scale_function">find_scale
function</a>
</h5>

View File

@ -17,55 +17,54 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.dist_ref.dists"></a><a class="link" href="dists.html" title="Distributions"> Distributions</a>
<a name="math_toolkit.dist.dist_ref.dists"></a><a class="link" href="dists.html" title="Distributions">Distributions</a>
</h4></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="dists/bernoulli_dist.html">
Bernoulli Distribution</a></span></dt>
<dt><span class="section"><a href="dists/beta_dist.html"> Beta
<dt><span class="section"><a href="dists/bernoulli_dist.html">Bernoulli
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/binomial_dist.html">
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dists/cauchy_dist.html"> Cauchy-Lorentz
<dt><span class="section"><a href="dists/beta_dist.html">Beta
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/chi_squared_dist.html">
Chi Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dists/exp_dist.html"> Exponential
<dt><span class="section"><a href="dists/binomial_dist.html">Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/extreme_dist.html"> Extreme
<dt><span class="section"><a href="dists/cauchy_dist.html">Cauchy-Lorentz
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/chi_squared_dist.html">Chi
Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dists/exp_dist.html">Exponential
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/extreme_dist.html">Extreme
Value Distribution</a></span></dt>
<dt><span class="section"><a href="dists/f_dist.html"> F Distribution</a></span></dt>
<dt><span class="section"><a href="dists/gamma_dist.html"> Gamma
<dt><span class="section"><a href="dists/f_dist.html">F Distribution</a></span></dt>
<dt><span class="section"><a href="dists/gamma_dist.html">Gamma
(and Erlang) Distribution</a></span></dt>
<dt><span class="section"><a href="dists/logistic_dist.html">
Logistic Distribution</a></span></dt>
<dt><span class="section"><a href="dists/lognormal_dist.html">
Log Normal Distribution</a></span></dt>
<dt><span class="section"><a href="dists/negative_binomial_dist.html">
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dists/nc_beta_dist.html"> Noncentral
<dt><span class="section"><a href="dists/logistic_dist.html">Logistic
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/lognormal_dist.html">Log
Normal Distribution</a></span></dt>
<dt><span class="section"><a href="dists/negative_binomial_dist.html">Negative
Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="dists/nc_beta_dist.html">Noncentral
Beta Distribution</a></span></dt>
<dt><span class="section"><a href="dists/nc_chi_squared_dist.html">
Noncentral Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dists/nc_f_dist.html"> Noncentral
<dt><span class="section"><a href="dists/nc_chi_squared_dist.html">Noncentral
Chi-Squared Distribution</a></span></dt>
<dt><span class="section"><a href="dists/nc_f_dist.html">Noncentral
F Distribution</a></span></dt>
<dt><span class="section"><a href="dists/nc_t_dist.html"> Noncentral
<dt><span class="section"><a href="dists/nc_t_dist.html">Noncentral
T Distribution</a></span></dt>
<dt><span class="section"><a href="dists/normal_dist.html"> Normal
<dt><span class="section"><a href="dists/normal_dist.html">Normal
(Gaussian) Distribution</a></span></dt>
<dt><span class="section"><a href="dists/pareto.html"> Pareto
<dt><span class="section"><a href="dists/pareto.html">Pareto Distribution</a></span></dt>
<dt><span class="section"><a href="dists/poisson_dist.html">Poisson
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/poisson_dist.html"> Poisson
<dt><span class="section"><a href="dists/rayleigh.html">Rayleigh
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/rayleigh.html"> Rayleigh
<dt><span class="section"><a href="dists/students_t_dist.html">Students
t Distribution</a></span></dt>
<dt><span class="section"><a href="dists/triangular_dist.html">Triangular
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/students_t_dist.html">
Students t Distribution</a></span></dt>
<dt><span class="section"><a href="dists/triangular_dist.html">
Triangular Distribution</a></span></dt>
<dt><span class="section"><a href="dists/weibull.html"> Weibull
<dt><span class="section"><a href="dists/weibull.html">Weibull
Distribution</a></span></dt>
<dt><span class="section"><a href="dists/uniform_dist.html"> Uniform
<dt><span class="section"><a href="dists/uniform_dist.html">Uniform
Distribution</a></span></dt>
</dl></div>
</div>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist"></a><a class="link" href="bernoulli_dist.html" title="Bernoulli Distribution">
Bernoulli Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist"></a><a class="link" href="bernoulli_dist.html" title="Bernoulli Distribution">Bernoulli
Distribution</a>
</h5></div></div></div>
<p>
@ -80,7 +80,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/bernoulli_cdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist.member_functions"></a><h5>
<a name="id1083458"></a>
<a name="id1083357"></a>
<a class="link" href="bernoulli_dist.html#math_toolkit.dist.dist_ref.dists.bernoulli_dist.member_functions">Member
Functions</a>
</h5>
@ -96,7 +96,7 @@
Returns the <span class="emphasis"><em>success_fraction</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist.non_member_accessors"></a><h5>
<a name="id1083537"></a>
<a name="id1083436"></a>
<a class="link" href="bernoulli_dist.html#math_toolkit.dist.dist_ref.dists.bernoulli_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -121,7 +121,7 @@
exception and make an error message available.
</p>
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist.accuracy"></a><h5>
<a name="id1083640"></a>
<a name="id1083540"></a>
<a class="link" href="bernoulli_dist.html#math_toolkit.dist.dist_ref.dists.bernoulli_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -129,7 +129,7 @@
and so should have errors within an epsilon or two.
</p>
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist.implementation"></a><h5>
<a name="id1083662"></a>
<a name="id1083561"></a>
<a class="link" href="bernoulli_dist.html#math_toolkit.dist.dist_ref.dists.bernoulli_dist.implementation">Implementation</a>
</h5>
<p>
@ -320,7 +320,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.bernoulli_dist.references"></a><h5>
<a name="id1083987"></a>
<a name="id1083886"></a>
<a class="link" href="bernoulli_dist.html#math_toolkit.dist.dist_ref.dists.bernoulli_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.beta_dist"></a><a class="link" href="beta_dist.html" title="Beta Distribution"> Beta
<a name="math_toolkit.dist.dist_ref.dists.beta_dist"></a><a class="link" href="beta_dist.html" title="Beta Distribution">Beta
Distribution</a>
</h5></div></div></div>
<p>
@ -126,12 +126,12 @@
from the centre (where x = half).
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.member_functions"></a><h5>
<a name="id1084813"></a>
<a name="id1084711"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.member_functions">Member
Functions</a>
</h5>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.constructor"></a><h6>
<a name="id1084830"></a>
<a name="id1084728"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.constructor">Constructor</a>
</h6>
<pre class="programlisting"><span class="identifier">beta_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">alpha</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">beta</span><span class="special">);</span>
@ -158,7 +158,7 @@
yellow in the graph above).
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.parameter_accessors"></a><h6>
<a name="id1086263"></a>
<a name="id1084843"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.parameter_accessors">Parameter
Accessors</a>
</h6>
@ -182,7 +182,7 @@
</span><span class="identifier">assert</span><span class="special">(</span><span class="identifier">mybeta</span><span class="special">.</span><span class="identifier">beta</span><span class="special">()</span> <span class="special">==</span> <span class="number">5.</span><span class="special">);</span> <span class="comment">// mybeta.beta() returns 5
</span></pre>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.parameter_estimators"></a><h5>
<a name="id1086468"></a>
<a name="id1085048"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.parameter_estimators">Parameter
Estimators</a>
</h5>
@ -235,7 +235,7 @@ from presumed-known mean and variance.
Returns the value of &#946; that gives: <code class="computeroutput"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">beta_distribution</span><span class="special">&lt;</span><span class="identifier">RealType</span><span class="special">&gt;(</span><span class="identifier">alpha</span><span class="special">,</span> <span class="identifier">beta</span><span class="special">),</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">probability</span></code>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.non_member_accessor_functions"></a><h5>
<a name="id1086920"></a>
<a name="id1087706"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.non_member_accessor_functions">Non-member
Accessor Functions</a>
</h5>
@ -257,7 +257,7 @@ from presumed-known mean and variance.
Mathworld</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.applications"></a><h5>
<a name="id1087024"></a>
<a name="id1087809"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.applications">Applications</a>
</h5>
<p>
@ -270,7 +270,7 @@ from presumed-known mean and variance.
statistical inference</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.related_distributions"></a><h5>
<a name="id1087049"></a>
<a name="id1087834"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.related_distributions">Related
distributions</a>
</h5>
@ -296,7 +296,7 @@ from presumed-known mean and variance.
Distribution</a> with its p parameter set to x.
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.accuracy"></a><h5>
<a name="id1087096"></a>
<a name="id1087881"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -308,7 +308,7 @@ from presumed-known mean and variance.
please refer to these functions for information on accuracy.
</p>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.implementation"></a><h5>
<a name="id1087140"></a>
<a name="id1087925"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.implementation">Implementation</a>
</h5>
<p>
@ -493,8 +493,6 @@ from presumed-known mean and variance.
</p>
</td>
<td>
<p>
</p>
</td>
</tr>
<tr>
@ -589,7 +587,7 @@ from presumed-known mean and variance.
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.beta_dist.references"></a><h5>
<a name="id1088170"></a>
<a name="id1088951"></a>
<a class="link" href="beta_dist.html#math_toolkit.dist.dist_ref.dists.beta_dist.references">References</a>
</h5>
<p>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist"></a><a class="link" href="binomial_dist.html" title="Binomial Distribution">
Binomial Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist"></a><a class="link" href="binomial_dist.html" title="Binomial Distribution">Binomial
Distribution</a>
</h5></div></div></div>
<p>
@ -120,8 +120,6 @@
<p>
<span class="inlinemediaobject"><img src="../../../../../graphs/binomial_pdf_2.png" align="middle"></span>
</p>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../images/caution.png"></td>
@ -129,43 +127,39 @@
</tr>
<tr><td align="left" valign="top">
<p>
The Binomial distribution is a discrete distribution: internally
functions like the <code class="computeroutput"><span class="identifier">cdf</span></code>
and <code class="computeroutput"><span class="identifier">pdf</span></code> are treated
"as if" they are continuous functions, but in reality the
results returned from these functions only have meaning if an integer
value is provided for the random variate argument.
</p>
The Binomial distribution is a discrete distribution: internally functions
like the <code class="computeroutput"><span class="identifier">cdf</span></code> and <code class="computeroutput"><span class="identifier">pdf</span></code> are treated "as if"
they are continuous functions, but in reality the results returned
from these functions only have meaning if an integer value is provided
for the random variate argument.
</p>
<p>
The quantile function will by default return an integer result that
has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower
quantiles (where the probability is less than 0.5) are rounded downward,
and upper quantiles (where the probability is greater than 0.5) are
rounded upwards. This behaviour ensures that if an X% quantile is
requested, then <span class="emphasis"><em>at least</em></span> the requested coverage
will be present in the central region, and <span class="emphasis"><em>no more than</em></span>
the requested coverage will be present in the tails.
</p>
The quantile function will by default return an integer result that
has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower
quantiles (where the probability is less than 0.5) are rounded downward,
and upper quantiles (where the probability is greater than 0.5) are
rounded upwards. This behaviour ensures that if an X% quantile is requested,
then <span class="emphasis"><em>at least</em></span> the requested coverage will be present
in the central region, and <span class="emphasis"><em>no more than</em></span> the requested
coverage will be present in the tails.
</p>
<p>
This behaviour can be changed so that the quantile functions are
rounded differently, or even return a real-valued result using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>. It is
strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Quantiles of Discrete Distributions</a> before using the quantile
function on the Binomial distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference
docs</a> describe how to change the rounding policy for these
distributions.
</p>
This behaviour can be changed so that the quantile functions are rounded
differently, or even return a real-valued result using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>.
It is strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Quantiles of Discrete Distributions</a> before using the quantile
function on the Binomial distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference
docs</a> describe how to change the rounding policy for these distributions.
</p>
</td></tr>
</table></div>
<p>
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.member_functions"></a><h5>
<a name="id1089818"></a>
<a name="id1090546"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.member_functions">Member
Functions</a>
</h5>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.construct"></a><h6>
<a name="id1089837"></a>
<a name="id1090566"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.construct">Construct</a>
</h6>
<pre class="programlisting"><span class="identifier">binomial_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">n</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">p</span><span class="special">);</span>
@ -182,7 +176,7 @@
otherwise calls <a class="link" href="../../../main_overview/error_handling.html#domain_error">domain_error</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.accessors"></a><h6>
<a name="id1089956"></a>
<a name="id1090684"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.accessors">Accessors</a>
</h6>
<pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">success_fraction</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
@ -198,7 +192,7 @@
was constructed.
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.lower_bound_on_the_success_fraction"></a><h6>
<a name="id1090037"></a>
<a name="id1090765"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.lower_bound_on_the_success_fraction">Lower
Bound on the Success Fraction</a>
</h6>
@ -304,7 +298,7 @@
limits illustrated in the case of the binomial. Biometrika 26 404-413.
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.upper_bound_on_the_success_fraction"></a><h6>
<a name="id1090491"></a>
<a name="id1091220"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.upper_bound_on_the_success_fraction">Upper
Bound on the Success Fraction</a>
</h6>
@ -382,7 +376,7 @@
</td></tr>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.estimating_the_number_of_trials_required_for_a_certain_number_of_successes"></a><h6>
<a name="id1090807"></a>
<a name="id1091535"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.estimating_the_number_of_trials_required_for_a_certain_number_of_successes">Estimating
the Number of Trials Required for a Certain Number of Successes</a>
</h6>
@ -424,7 +418,7 @@
of seeing 10 events that occur with frequency one half.
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.estimating_the_maximum_number_of_trials_to_ensure_no_more_than_a_certain_number_of_successes"></a><h6>
<a name="id1091009"></a>
<a name="id1091737"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.estimating_the_maximum_number_of_trials_to_ensure_no_more_than_a_certain_number_of_successes">Estimating
the Maximum Number of Trials to Ensure no more than a Certain Number
of Successes</a>
@ -472,7 +466,7 @@
Worked Example.</a>
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.non_member_accessors"></a><h5>
<a name="id1091220"></a>
<a name="id1091948"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -497,7 +491,7 @@
in the context of this distribution:
</p>
<div class="table">
<a name="id1091879"></a><p class="title"><b>Table&#160;11.&#160;Meaning of the non-member accessors</b></p>
<a name="id1092080"></a><p class="title"><b>Table&#160;11.&#160;Meaning of the non-member accessors</b></p>
<div class="table-contents"><table class="table" summary="Meaning of the non-member accessors">
<colgroup>
<col>
@ -621,7 +615,7 @@
</table></div>
</div>
<br class="table-break"><a name="math_toolkit.dist.dist_ref.dists.binomial_dist.examples"></a><h5>
<a name="id1092302"></a>
<a name="id1092730"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.examples">Examples</a>
</h5>
<p>
@ -629,7 +623,7 @@
examples</a> are available illustrating the use of the binomial distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.accuracy"></a><h5>
<a name="id1092323"></a>
<a name="id1092751"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -639,7 +633,7 @@
please refer to these functions for information on accuracy.
</p>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.implementation"></a><h5>
<a name="id1092352"></a>
<a name="id1092780"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.implementation">Implementation</a>
</h5>
<p>
@ -883,7 +877,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.binomial_dist.references"></a><h5>
<a name="id1093397"></a>
<a name="id1093825"></a>
<a class="link" href="binomial_dist.html#math_toolkit.dist.dist_ref.dists.binomial_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist"></a><a class="link" href="cauchy_dist.html" title="Cauchy-Lorentz Distribution"> Cauchy-Lorentz
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist"></a><a class="link" href="cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy-Lorentz
Distribution</a>
</h5></div></div></div>
<p>
@ -81,7 +81,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/cauchy_pdf2.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist.member_functions"></a><h5>
<a name="id1093916"></a>
<a name="id1094344"></a>
<a class="link" href="cauchy_dist.html#math_toolkit.dist.dist_ref.dists.cauchy_dist.member_functions">Member
Functions</a>
</h5>
@ -107,7 +107,7 @@
Returns the scale parameter of the distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist.non_member_accessors"></a><h5>
<a name="id1095791"></a>
<a name="id1094492"></a>
<a class="link" href="cauchy_dist.html#math_toolkit.dist.dist_ref.dists.cauchy_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -141,7 +141,7 @@
The domain of the random variable is [-[max_value], +[min_value]].
</p>
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist.accuracy"></a><h5>
<a name="id1095934"></a>
<a name="id1094635"></a>
<a class="link" href="cauchy_dist.html#math_toolkit.dist.dist_ref.dists.cauchy_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -150,7 +150,7 @@
have very low error rates.
</p>
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist.implementation"></a><h5>
<a name="id1095968"></a>
<a name="id1094669"></a>
<a class="link" href="cauchy_dist.html#math_toolkit.dist.dist_ref.dists.cauchy_dist.implementation">Implementation</a>
</h5>
<p>
@ -266,7 +266,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.cauchy_dist.references"></a><h5>
<a name="id1096196"></a>
<a name="id1096828"></a>
<a class="link" href="cauchy_dist.html#math_toolkit.dist.dist_ref.dists.cauchy_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist"></a><a class="link" href="chi_squared_dist.html" title="Chi Squared Distribution">
Chi Squared Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist"></a><a class="link" href="chi_squared_dist.html" title="Chi Squared Distribution">Chi
Squared Distribution</a>
</h5></div></div></div>
<p>
@ -80,7 +80,7 @@ independent, normally distributed random
<span class="inlinemediaobject"><img src="../../../../../graphs/chi_squared_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist.member_functions"></a><h5>
<a name="id1096761"></a>
<a name="id1097393"></a>
<a class="link" href="chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.chi_squared_dist.member_functions">Member
Functions</a>
</h5>
@ -163,7 +163,7 @@ independent, normally distributed random
NIST Engineering Statistics Handbook, Section 7.2.3.2</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist.non_member_accessors"></a><h5>
<a name="id1097092"></a>
<a name="id1097725"></a>
<a class="link" href="chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.chi_squared_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -189,7 +189,7 @@ independent, normally distributed random
The domain of the random variable is [0, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist.examples"></a><h5>
<a name="id1097195"></a>
<a name="id1097828"></a>
<a class="link" href="chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.chi_squared_dist.examples">Examples</a>
</h5>
<p>
@ -197,7 +197,7 @@ independent, normally distributed random
are available illustrating the use of the Chi Squared Distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist.accuracy"></a><h5>
<a name="id1097222"></a>
<a name="id1097854"></a>
<a class="link" href="chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.chi_squared_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -205,7 +205,7 @@ independent, normally distributed random
gamma functions</a>: please refer to the accuracy data for those functions.
</p>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist.implementation"></a><h5>
<a name="id1097246"></a>
<a name="id1097878"></a>
<a class="link" href="chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.chi_squared_dist.implementation">Implementation</a>
</h5>
<p>
@ -372,7 +372,7 @@ independent, normally distributed random
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.chi_squared_dist.references"></a><h5>
<a name="id1097536"></a>
<a name="id1098169"></a>
<a class="link" href="chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.chi_squared_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.exp_dist"></a><a class="link" href="exp_dist.html" title="Exponential Distribution"> Exponential
<a name="math_toolkit.dist.dist_ref.dists.exp_dist"></a><a class="link" href="exp_dist.html" title="Exponential Distribution">Exponential
Distribution</a>
</h5></div></div></div>
<p>
@ -64,7 +64,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/exponential_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.exp_dist.member_functions"></a><h5>
<a name="id1098063"></a>
<a name="id1098603"></a>
<a class="link" href="exp_dist.html#math_toolkit.dist.dist_ref.dists.exp_dist.member_functions">Member
Functions</a>
</h5>
@ -84,7 +84,7 @@
Accessor function returns the lambda parameter of the distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.exp_dist.non_member_accessors"></a><h5>
<a name="id1098165"></a>
<a name="id1098705"></a>
<a class="link" href="exp_dist.html#math_toolkit.dist.dist_ref.dists.exp_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -104,7 +104,7 @@
The domain of the random variable is [0, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.exp_dist.accuracy"></a><h5>
<a name="id1098265"></a>
<a name="id1098805"></a>
<a class="link" href="exp_dist.html#math_toolkit.dist.dist_ref.dists.exp_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -115,7 +115,7 @@
should have very low error rates.
</p>
<a name="math_toolkit.dist.dist_ref.dists.exp_dist.implementation"></a><h5>
<a name="id1098313"></a>
<a name="id1099150"></a>
<a class="link" href="exp_dist.html#math_toolkit.dist.dist_ref.dists.exp_dist.implementation">Implementation</a>
</h5>
<p>
@ -276,7 +276,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.exp_dist.references"></a><h5>
<a name="id1098576"></a>
<a name="id1099413"></a>
<a class="link" href="exp_dist.html#math_toolkit.dist.dist_ref.dists.exp_dist.references">references</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.extreme_dist"></a><a class="link" href="extreme_dist.html" title="Extreme Value Distribution"> Extreme
<a name="math_toolkit.dist.dist_ref.dists.extreme_dist"></a><a class="link" href="extreme_dist.html" title="Extreme Value Distribution">Extreme
Value Distribution</a>
</h5></div></div></div>
<p>
@ -93,7 +93,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/extreme_value_pdf2.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.extreme_dist.member_functions"></a><h5>
<a name="id1099137"></a>
<a name="id1099975"></a>
<a class="link" href="extreme_dist.html#math_toolkit.dist.dist_ref.dists.extreme_dist.member_functions">Member
Functions</a>
</h5>
@ -118,7 +118,7 @@
Returns the scale parameter of the distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.extreme_dist.non_member_accessors"></a><h5>
<a name="id1099294"></a>
<a name="id1100132"></a>
<a class="link" href="extreme_dist.html#math_toolkit.dist.dist_ref.dists.extreme_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -138,7 +138,7 @@
The domain of the random parameter is [-&#8734;, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.extreme_dist.accuracy"></a><h5>
<a name="id1099392"></a>
<a name="id1100229"></a>
<a class="link" href="extreme_dist.html#math_toolkit.dist.dist_ref.dists.extreme_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -147,7 +147,7 @@
very low error rates.
</p>
<a name="math_toolkit.dist.dist_ref.dists.extreme_dist.implementation"></a><h5>
<a name="id1099425"></a>
<a name="id1100263"></a>
<a class="link" href="extreme_dist.html#math_toolkit.dist.dist_ref.dists.extreme_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.f_dist"></a><a class="link" href="f_dist.html" title="F Distribution"> F Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.f_dist"></a><a class="link" href="f_dist.html" title="F Distribution">F Distribution</a>
</h5></div></div></div>
<p>
@ -73,7 +73,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/fisher_f_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.f_dist.member_functions"></a><h5>
<a name="id1100251"></a>
<a name="id1101020"></a>
<a class="link" href="f_dist.html#math_toolkit.dist.dist_ref.dists.f_dist.member_functions">Member
Functions</a>
</h5>
@ -99,7 +99,7 @@
Returns the denominator degrees of freedom parameter of the distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.f_dist.non_member_accessors"></a><h5>
<a name="id1100406"></a>
<a name="id1101175"></a>
<a class="link" href="f_dist.html#math_toolkit.dist.dist_ref.dists.f_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -119,7 +119,7 @@
The domain of the random variable is [0, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.f_dist.examples"></a><h5>
<a name="id1100506"></a>
<a name="id1101274"></a>
<a class="link" href="f_dist.html#math_toolkit.dist.dist_ref.dists.f_dist.examples">Examples</a>
</h5>
<p>
@ -127,7 +127,7 @@
are available illustrating the use of the F Distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.f_dist.accuracy"></a><h5>
<a name="id1100527"></a>
<a name="id1101569"></a>
<a class="link" href="f_dist.html#math_toolkit.dist.dist_ref.dists.f_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -136,7 +136,7 @@
refer to those functions for accuracy data.
</p>
<a name="math_toolkit.dist.dist_ref.dists.f_dist.implementation"></a><h5>
<a name="id1100554"></a>
<a name="id1101596"></a>
<a class="link" href="f_dist.html#math_toolkit.dist.dist_ref.dists.f_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.gamma_dist"></a><a class="link" href="gamma_dist.html" title="Gamma (and Erlang) Distribution"> Gamma
<a name="math_toolkit.dist.dist_ref.dists.gamma_dist"></a><a class="link" href="gamma_dist.html" title="Gamma (and Erlang) Distribution">Gamma
(and Erlang) Distribution</a>
</h5></div></div></div>
<p>
@ -130,7 +130,7 @@
than a dedicated Erlang Distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.gamma_dist.member_functions"></a><h5>
<a name="id1101593"></a>
<a name="id1102635"></a>
<a class="link" href="gamma_dist.html#math_toolkit.dist.dist_ref.dists.gamma_dist.member_functions">Member
Functions</a>
</h5>
@ -155,7 +155,7 @@
Returns the <span class="emphasis"><em>scale</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.gamma_dist.non_member_accessors"></a><h5>
<a name="id1101739"></a>
<a name="id1102781"></a>
<a class="link" href="gamma_dist.html#math_toolkit.dist.dist_ref.dists.gamma_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -175,7 +175,7 @@
The domain of the random variable is [0,+&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.gamma_dist.accuracy"></a><h5>
<a name="id1101836"></a>
<a name="id1102879"></a>
<a class="link" href="gamma_dist.html#math_toolkit.dist.dist_ref.dists.gamma_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -187,7 +187,7 @@
refer to the accuracy data for those functions for more information.
</p>
<a name="math_toolkit.dist.dist_ref.dists.gamma_dist.implementation"></a><h5>
<a name="id1101875"></a>
<a name="id1102917"></a>
<a class="link" href="gamma_dist.html#math_toolkit.dist.dist_ref.dists.gamma_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.logistic_dist"></a><a class="link" href="logistic_dist.html" title="Logistic Distribution">
Logistic Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.logistic_dist"></a><a class="link" href="logistic_dist.html" title="Logistic Distribution">Logistic
Distribution</a>
</h5></div></div></div>
<p>
@ -65,7 +65,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/logistic_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.member_functions"></a><h5>
<a name="id1105216"></a>
<a name="id1103665"></a>
<a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.member_functions">Member
Functions</a>
</h5>
@ -91,7 +91,7 @@
Returns the scale of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.non_member_accessors"></a><h5>
<a name="id1105381"></a>
<a name="id1105142"></a>
<a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -121,7 +121,7 @@ as special cases if RealType
and +<a class="link" href="../../../main_overview/error_handling.html#overflow_error">overflow_error</a> respectively.
</p>
<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.accuracy"></a><h5>
<a name="id1105530"></a>
<a name="id1105290"></a>
<a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -133,7 +133,7 @@ as special cases if RealType
can be guarenteed.
</p>
<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.implementation"></a><h5>
<a name="id1105582"></a>
<a name="id1105342"></a>
<a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.implementation">Implementation</a>
</h5>
<div class="informaltable"><table class="table">

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.lognormal_dist"></a><a class="link" href="lognormal_dist.html" title="Log Normal Distribution">
Log Normal Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.lognormal_dist"></a><a class="link" href="lognormal_dist.html" title="Log Normal Distribution">Log
Normal Distribution</a>
</h5></div></div></div>
<p>
@ -81,7 +81,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/lognormal_pdf2.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.lognormal_dist.member_functions"></a><h5>
<a name="id1106329"></a>
<a name="id1106090"></a>
<a class="link" href="lognormal_dist.html#math_toolkit.dist.dist_ref.dists.lognormal_dist.member_functions">Member
Functions</a>
</h5>
@ -114,7 +114,7 @@
Returns the <span class="emphasis"><em>scale</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.lognormal_dist.non_member_accessors"></a><h5>
<a name="id1106490"></a>
<a name="id1106250"></a>
<a class="link" href="lognormal_dist.html#math_toolkit.dist.dist_ref.dists.lognormal_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -134,7 +134,7 @@
The domain of the random variable is [0,+&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.lognormal_dist.accuracy"></a><h5>
<a name="id1106590"></a>
<a name="id1106350"></a>
<a class="link" href="lognormal_dist.html#math_toolkit.dist.dist_ref.dists.lognormal_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -143,7 +143,7 @@
function</a>, and as such should have very low error rates.
</p>
<a name="math_toolkit.dist.dist_ref.dists.lognormal_dist.implementation"></a><h5>
<a name="id1106616"></a>
<a name="id1106376"></a>
<a class="link" href="lognormal_dist.html#math_toolkit.dist.dist_ref.dists.lognormal_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist"></a><a class="link" href="nc_beta_dist.html" title="Noncentral Beta Distribution"> Noncentral
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist"></a><a class="link" href="nc_beta_dist.html" title="Noncentral Beta Distribution">Noncentral
Beta Distribution</a>
</h5></div></div></div>
<p>
@ -89,7 +89,7 @@ is a central &#967;<sup>2</sup> random variable with <span class="emphasis"><em>
<span class="inlinemediaobject"><img src="../../../../../graphs/nc_beta_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist.member_functions"></a><h5>
<a name="id1111519"></a>
<a name="id1111882"></a>
<a class="link" href="nc_beta_dist.html#math_toolkit.dist.dist_ref.dists.nc_beta_dist.member_functions">Member
Functions</a>
</h5>
@ -121,7 +121,7 @@ is a central &#967;<sup>2</sup> random variable with <span class="emphasis"><em>
was constructed.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist.non_member_accessors"></a><h5>
<a name="id1111703"></a>
<a name="id1112066"></a>
<a class="link" href="nc_beta_dist.html#math_toolkit.dist.dist_ref.dists.nc_beta_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -145,7 +145,7 @@ is a central &#967;<sup>2</sup> random variable with <span class="emphasis"><em>
The domain of the random variable is [0, 1].
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist.accuracy"></a><h5>
<a name="id1111805"></a>
<a name="id1112168"></a>
<a class="link" href="nc_beta_dist.html#math_toolkit.dist.dist_ref.dists.nc_beta_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -161,7 +161,7 @@ is a central &#967;<sup>2</sup> random variable with <span class="emphasis"><em>
zero error</a>.
</p>
<div class="table">
<a name="id1111840"></a><p class="title"><b>Table&#160;13.&#160;Errors In CDF of the Noncentral Beta</b></p>
<a name="id1112203"></a><p class="title"><b>Table&#160;13.&#160;Errors In CDF of the Noncentral Beta</b></p>
<div class="table-contents"><table class="table" summary="Errors In CDF of the Noncentral Beta">
<colgroup>
<col>
@ -288,7 +288,7 @@ is a central &#967;<sup>2</sup> random variable with <span class="emphasis"><em>
functions are broadly similar.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist.tests"></a><h5>
<a name="id1112039"></a>
<a name="id1112402"></a>
<a class="link" href="nc_beta_dist.html#math_toolkit.dist.dist_ref.dists.nc_beta_dist.tests">Tests</a>
</h5>
<p>
@ -300,7 +300,7 @@ is a central &#967;<sup>2</sup> random variable with <span class="emphasis"><em>
tests.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_beta_dist.implementation"></a><h5>
<a name="id1112063"></a>
<a name="id1112426"></a>
<a class="link" href="nc_beta_dist.html#math_toolkit.dist.dist_ref.dists.nc_beta_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist"></a><a class="link" href="nc_chi_squared_dist.html" title="Noncentral Chi-Squared Distribution">
Noncentral Chi-Squared Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist"></a><a class="link" href="nc_chi_squared_dist.html" title="Noncentral Chi-Squared Distribution">Noncentral
Chi-Squared Distribution</a>
</h5></div></div></div>
<p>
@ -103,7 +103,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/nccs_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.member_functions"></a><h5>
<a name="id1113600"></a>
<a name="id1113661"></a>
<a class="link" href="nc_chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.member_functions">Member
Functions</a>
</h5>
@ -176,7 +176,7 @@
<span class="special">==</span> <span class="identifier">q</span></code>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.non_member_accessors"></a><h5>
<a name="id1114499"></a>
<a name="id1114560"></a>
<a class="link" href="nc_chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -196,7 +196,7 @@
The domain of the random variable is [0, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.examples"></a><h5>
<a name="id1114598"></a>
<a name="id1114660"></a>
<a class="link" href="nc_chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.examples">Examples</a>
</h5>
<p>
@ -204,7 +204,7 @@
example</a> for the noncentral chi-squared distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.accuracy"></a><h5>
<a name="id1114625"></a>
<a name="id1114686"></a>
<a class="link" href="nc_chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -216,7 +216,7 @@
zero error</a>.
</p>
<div class="table">
<a name="id1114655"></a><p class="title"><b>Table&#160;14.&#160;Errors In CDF of the Noncentral Chi-Squared</b></p>
<a name="id1114716"></a><p class="title"><b>Table&#160;14.&#160;Errors In CDF of the Noncentral Chi-Squared</b></p>
<div class="table-contents"><table class="table" summary="Errors In CDF of the Noncentral Chi-Squared">
<colgroup>
<col>
@ -352,7 +352,7 @@
produce an accuracy greater than the square root of the machine epsilon.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.tests"></a><h5>
<a name="id1116006"></a>
<a name="id1114932"></a>
<a class="link" href="nc_chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.tests">Tests</a>
</h5>
<p>
@ -366,7 +366,7 @@
to at least 50 decimal digits - and is the used for our accuracy tests.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.implementation"></a><h5>
<a name="id1116026"></a>
<a name="id1114951"></a>
<a class="link" href="nc_chi_squared_dist.html#math_toolkit.dist.dist_ref.dists.nc_chi_squared_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist"></a><a class="link" href="nc_f_dist.html" title="Noncentral F Distribution"> Noncentral
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist"></a><a class="link" href="nc_f_dist.html" title="Noncentral F Distribution">Noncentral
F Distribution</a>
</h5></div></div></div>
<p>
@ -88,7 +88,7 @@ random variable with <span class="emphasis"><em>v1</em></span>
<span class="inlinemediaobject"><img src="../../../../../graphs/nc_f_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist.member_functions"></a><h5>
<a name="id1116879"></a>
<a name="id1116985"></a>
<a class="link" href="nc_f_dist.html#math_toolkit.dist.dist_ref.dists.nc_f_dist.member_functions">Member
Functions</a>
</h5>
@ -120,7 +120,7 @@ random variable with <span class="emphasis"><em>v1</em></span>
which this object was constructed.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist.non_member_accessors"></a><h5>
<a name="id1117065"></a>
<a name="id1117171"></a>
<a class="link" href="nc_f_dist.html#math_toolkit.dist.dist_ref.dists.nc_f_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -140,7 +140,7 @@ random variable with <span class="emphasis"><em>v1</em></span>
The domain of the random variable is [0, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist.accuracy"></a><h5>
<a name="id1117164"></a>
<a name="id1117271"></a>
<a class="link" href="nc_f_dist.html#math_toolkit.dist.dist_ref.dists.nc_f_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -148,7 +148,7 @@ random variable with <span class="emphasis"><em>v1</em></span>
beta distribution</a>: refer to that distribution for accuracy data.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist.tests"></a><h5>
<a name="id1117187"></a>
<a name="id1117294"></a>
<a class="link" href="nc_f_dist.html#math_toolkit.dist.dist_ref.dists.nc_f_dist.tests">Tests</a>
</h5>
<p>
@ -157,7 +157,7 @@ random variable with <span class="emphasis"><em>v1</em></span>
Math library statistical package</a> and its pbeta and dbeta functions.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_f_dist.implementation"></a><h5>
<a name="id1117211"></a>
<a name="id1117318"></a>
<a class="link" href="nc_f_dist.html#math_toolkit.dist.dist_ref.dists.nc_f_dist.implementation">Implementation</a>
</h5>
<p>
@ -227,8 +227,6 @@ is the non-centrality parameter, <span class="emphasis"><em>x</em></span> is the
<p>
y = x * v1 / v2
</p>
<p>
</p>
</td>
</tr>
<tr>
@ -251,8 +249,6 @@ is the non-centrality parameter, <span class="emphasis"><em>x</em></span> is the
<p>
y = x * v1 / v2
</p>
<p>
</p>
</td>
</tr>
<tr>
@ -283,8 +279,6 @@ is the non-centrality parameter, <span class="emphasis"><em>x</em></span> is the
<p>
is the noncentral beta quantile.
</p>
<p>
</p>
</td>
</tr>
<tr>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist"></a><a class="link" href="nc_t_dist.html" title="Noncentral T Distribution"> Noncentral
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist"></a><a class="link" href="nc_t_dist.html" title="Noncentral T Distribution">Noncentral
T Distribution</a>
</h5></div></div></div>
<p>
@ -78,7 +78,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/nc_t_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist.member_functions"></a><h5>
<a name="id1118094"></a>
<a name="id1118190"></a>
<a class="link" href="nc_t_dist.html#math_toolkit.dist.dist_ref.dists.nc_t_dist.member_functions">Member
Functions</a>
</h5>
@ -104,7 +104,7 @@
which this object was constructed.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist.non_member_accessors"></a><h5>
<a name="id1119977"></a>
<a name="id1118328"></a>
<a class="link" href="nc_t_dist.html#math_toolkit.dist.dist_ref.dists.nc_t_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -124,7 +124,7 @@
The domain of the random variable is [-&#8734;, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist.accuracy"></a><h5>
<a name="id1120077"></a>
<a name="id1118428"></a>
<a class="link" href="nc_t_dist.html#math_toolkit.dist.dist_ref.dists.nc_t_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -134,7 +134,7 @@
one shown will have <a class="link" href="../../../backgrounders/relative_error.html#zero_error">effectively zero error</a>.
</p>
<div class="table">
<a name="id1120100"></a><p class="title"><b>Table&#160;15.&#160;Errors In CDF of the Noncentral T Distribution</b></p>
<a name="id1118450"></a><p class="title"><b>Table&#160;15.&#160;Errors In CDF of the Noncentral T Distribution</b></p>
<div class="table-contents"><table class="table" summary="Errors In CDF of the Noncentral T Distribution">
<colgroup>
<col>
@ -248,7 +248,7 @@
epsilon.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist.tests"></a><h5>
<a name="id1120269"></a>
<a name="id1121283"></a>
<a class="link" href="nc_t_dist.html#math_toolkit.dist.dist_ref.dists.nc_t_dist.tests">Tests</a>
</h5>
<p>
@ -263,7 +263,7 @@
least 50 decimal places.
</p>
<a name="math_toolkit.dist.dist_ref.dists.nc_t_dist.implementation"></a><h5>
<a name="id1120288"></a>
<a name="id1121302"></a>
<a class="link" href="nc_t_dist.html#math_toolkit.dist.dist_ref.dists.nc_t_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist"></a><a class="link" href="negative_binomial_dist.html" title="Negative Binomial Distribution">
Negative Binomial Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist"></a><a class="link" href="negative_binomial_dist.html" title="Negative Binomial Distribution">Negative
Binomial Distribution</a>
</h5></div></div></div>
<p>
@ -116,7 +116,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/negative_binomial_pdf_2.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.related_distributions"></a><h5>
<a name="id1107844"></a>
<a name="id1108136"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.related_distributions">Related
Distributions</a>
</h5>
@ -153,8 +153,6 @@
<p>
poisson(&#955;) = lim <sub>r &#8594; &#8734;</sub> negative_binomial(r, r / (&#955; + r)))
</p>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../images/caution.png"></td>
@ -162,43 +160,40 @@
</tr>
<tr><td align="left" valign="top">
<p>
The Negative Binomial distribution is a discrete distribution: internally
functions like the <code class="computeroutput"><span class="identifier">cdf</span></code>
and <code class="computeroutput"><span class="identifier">pdf</span></code> are treated
"as if" they are continuous functions, but in reality the
results returned from these functions only have meaning if an integer
value is provided for the random variate argument.
</p>
The Negative Binomial distribution is a discrete distribution: internally
functions like the <code class="computeroutput"><span class="identifier">cdf</span></code>
and <code class="computeroutput"><span class="identifier">pdf</span></code> are treated
"as if" they are continuous functions, but in reality the
results returned from these functions only have meaning if an integer
value is provided for the random variate argument.
</p>
<p>
The quantile function will by default return an integer result that
has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower
quantiles (where the probability is less than 0.5) are rounded downward,
and upper quantiles (where the probability is greater than 0.5) are
rounded upwards. This behaviour ensures that if an X% quantile is
requested, then <span class="emphasis"><em>at least</em></span> the requested coverage
will be present in the central region, and <span class="emphasis"><em>no more than</em></span>
the requested coverage will be present in the tails.
</p>
The quantile function will by default return an integer result that
has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower
quantiles (where the probability is less than 0.5) are rounded downward,
and upper quantiles (where the probability is greater than 0.5) are
rounded upwards. This behaviour ensures that if an X% quantile is requested,
then <span class="emphasis"><em>at least</em></span> the requested coverage will be present
in the central region, and <span class="emphasis"><em>no more than</em></span> the requested
coverage will be present in the tails.
</p>
<p>
This behaviour can be changed so that the quantile functions are
rounded differently, or even return a real-valued result using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>. It is
strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Quantiles of Discrete Distributions</a> before using the quantile
function on the Negative Binomial distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference
docs</a> describe how to change the rounding policy for these
distributions.
</p>
This behaviour can be changed so that the quantile functions are rounded
differently, or even return a real-valued result using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>.
It is strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Quantiles of Discrete Distributions</a> before using the quantile
function on the Negative Binomial distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference
docs</a> describe how to change the rounding policy for these distributions.
</p>
</td></tr>
</table></div>
<p>
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.member_functions"></a><h5>
<a name="id1107956"></a>
<a name="id1108245"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.member_functions">Member
Functions</a>
</h5>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.construct"></a><h6>
<a name="id1107971"></a>
<a name="id1108260"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.construct">Construct</a>
</h6>
<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">p</span><span class="special">);</span>
@ -214,7 +209,7 @@
<span class="special">&lt;=</span> <span class="number">1</span></code>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.accessors"></a><h6>
<a name="id1108079"></a>
<a name="id1108368"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.accessors">Accessors</a>
</h6>
<pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">success_fraction</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span> <span class="comment">// successes / trials (0 &lt;= p &lt;= 1)
@ -230,7 +225,7 @@
was constructed.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.lower_bound_on_parameter_p"></a><h6>
<a name="id1108164"></a>
<a name="id1108453"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.lower_bound_on_parameter_p">Lower
Bound on Parameter p</a>
</h6>
@ -291,7 +286,7 @@
vol. 48, no3, 605-621</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.upper_bound_on_parameter_p"></a><h6>
<a name="id1108430"></a>
<a name="id1108719"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.upper_bound_on_parameter_p">Upper
Bound on Parameter p</a>
</h6>
@ -351,7 +346,7 @@
vol. 48, no3, 605-621</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.estimating_number_of_trials_to_ensure_at_least_a_certain_number_of_failures"></a><h6>
<a name="id1108693"></a>
<a name="id1108982"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.estimating_number_of_trials_to_ensure_at_least_a_certain_number_of_failures">Estimating
Number of Trials to Ensure at Least a Certain Number of Failures</a>
</h6>
@ -402,7 +397,7 @@
probability of observing k failures or fewer.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.estimating_number_of_trials_to_ensure_a_maximum_number_of_failures_or_less"></a><h6>
<a name="id1108918"></a>
<a name="id1109207"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.estimating_number_of_trials_to_ensure_a_maximum_number_of_failures_or_less">Estimating
Number of Trials to Ensure a Maximum Number of Failures or Less</a>
</h6>
@ -450,7 +445,7 @@
probability of observing more than k failures.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.non_member_accessors"></a><h5>
<a name="id1109149"></a>
<a name="id1109438"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -471,7 +466,7 @@
in the context of this distribution:
</p>
<div class="table">
<a name="id1109243"></a><p class="title"><b>Table&#160;12.&#160;Meaning of the non-member accessors.</b></p>
<a name="id1109532"></a><p class="title"><b>Table&#160;12.&#160;Meaning of the non-member accessors.</b></p>
<div class="table-contents"><table class="table" summary="Meaning of the non-member accessors.">
<colgroup>
<col>
@ -599,7 +594,7 @@
</table></div>
</div>
<br class="table-break"><a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.accuracy"></a><h5>
<a name="id1110109"></a>
<a name="id1109951"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -609,7 +604,7 @@
please refer to these functions for information on accuracy.
</p>
<a name="math_toolkit.dist.dist_ref.dists.negative_binomial_dist.implementation"></a><h5>
<a name="id1110136"></a>
<a name="id1109977"></a>
<a class="link" href="negative_binomial_dist.html#math_toolkit.dist.dist_ref.dists.negative_binomial_dist.implementation">Implementation</a>
</h5>
<p>
@ -820,8 +815,6 @@
</p>
</td>
<td>
<p>
</p>
</td>
</tr>
<tr>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.normal_dist"></a><a class="link" href="normal_dist.html" title="Normal (Gaussian) Distribution"> Normal
<a name="math_toolkit.dist.dist_ref.dists.normal_dist"></a><a class="link" href="normal_dist.html" title="Normal (Gaussian) Distribution">Normal
(Gaussian) Distribution</a>
</h5></div></div></div>
<p>
@ -72,7 +72,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/normal_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.normal_dist.member_functions"></a><h5>
<a name="id1121001"></a>
<a name="id1122015"></a>
<a class="link" href="normal_dist.html#math_toolkit.dist.dist_ref.dists.normal_dist.member_functions">Member
Functions</a>
</h5>
@ -102,7 +102,7 @@
be used generically).
</p>
<a name="math_toolkit.dist.dist_ref.dists.normal_dist.non_member_accessors"></a><h5>
<a name="id1121198"></a>
<a name="id1122211"></a>
<a class="link" href="normal_dist.html#math_toolkit.dist.dist_ref.dists.normal_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -124,7 +124,7 @@
and complement cdf -&#8734; = 1 and +&#8734; = 0, if RealType permits.
</p>
<a name="math_toolkit.dist.dist_ref.dists.normal_dist.accuracy"></a><h5>
<a name="id1121295"></a>
<a name="id1122309"></a>
<a class="link" href="normal_dist.html#math_toolkit.dist.dist_ref.dists.normal_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -132,7 +132,7 @@
function</a>, and as such should have very low error rates.
</p>
<a name="math_toolkit.dist.dist_ref.dists.normal_dist.implementation"></a><h5>
<a name="id1121319"></a>
<a name="id1122333"></a>
<a class="link" href="normal_dist.html#math_toolkit.dist.dist_ref.dists.normal_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,8 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.pareto"></a><a class="link" href="pareto.html" title="Pareto Distribution"> Pareto
Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.pareto"></a><a class="link" href="pareto.html" title="Pareto Distribution">Pareto Distribution</a>
</h5></div></div></div>
<p>
@ -79,12 +78,12 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/pareto_pdf2.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.pareto.related_distributions"></a><h5>
<a name="id1122568"></a>
<a name="id1123116"></a>
<a class="link" href="pareto.html#math_toolkit.dist.dist_ref.dists.pareto.related_distributions">Related
distributions</a>
</h5>
<a name="math_toolkit.dist.dist_ref.dists.pareto.member_functions"></a><h5>
<a name="id1122586"></a>
<a name="id1123134"></a>
<a class="link" href="pareto.html#math_toolkit.dist.dist_ref.dists.pareto.member_functions">Member
Functions</a>
</h5>
@ -110,7 +109,7 @@
Returns the <span class="emphasis"><em>shape</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.pareto.non_member_accessors"></a><h5>
<a name="id1122757"></a>
<a name="id1123305"></a>
<a class="link" href="pareto.html#math_toolkit.dist.dist_ref.dists.pareto.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -130,7 +129,7 @@
The supported domain of the random variable is [location, &#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.pareto.accuracy"></a><h5>
<a name="id1122856"></a>
<a name="id1124142"></a>
<a class="link" href="pareto.html#math_toolkit.dist.dist_ref.dists.pareto.accuracy">Accuracy</a>
</h5>
<p>
@ -140,7 +139,7 @@
to unity.
</p>
<a name="math_toolkit.dist.dist_ref.dists.pareto.implementation"></a><h5>
<a name="id1122885"></a>
<a name="id1124171"></a>
<a class="link" href="pareto.html#math_toolkit.dist.dist_ref.dists.pareto.implementation">Implementation</a>
</h5>
<p>
@ -308,7 +307,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.pareto.references"></a><h5>
<a name="id1123190"></a>
<a name="id1124476"></a>
<a class="link" href="pareto.html#math_toolkit.dist.dist_ref.dists.pareto.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.poisson_dist"></a><a class="link" href="poisson_dist.html" title="Poisson Distribution"> Poisson
<a name="math_toolkit.dist.dist_ref.dists.poisson_dist"></a><a class="link" href="poisson_dist.html" title="Poisson Distribution">Poisson
Distribution</a>
</h5></div></div></div>
<p>
@ -75,8 +75,6 @@
<p>
<span class="inlinemediaobject"><img src="../../../../../graphs/poisson_pdf_1.png" align="middle"></span>
</p>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../images/caution.png"></td>
@ -84,38 +82,34 @@
</tr>
<tr><td align="left" valign="top">
<p>
The Poisson distribution is a discrete distribution: internally functions
like the <code class="computeroutput"><span class="identifier">cdf</span></code> and
<code class="computeroutput"><span class="identifier">pdf</span></code> are treated "as
if" they are continuous functions, but in reality the results
returned from these functions only have meaning if an integer value
is provided for the random variate argument.
</p>
The Poisson distribution is a discrete distribution: internally functions
like the <code class="computeroutput"><span class="identifier">cdf</span></code> and <code class="computeroutput"><span class="identifier">pdf</span></code> are treated "as if"
they are continuous functions, but in reality the results returned
from these functions only have meaning if an integer value is provided
for the random variate argument.
</p>
<p>
The quantile function will by default return an integer result that
has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower
quantiles (where the probability is less than 0.5) are rounded downward,
and upper quantiles (where the probability is greater than 0.5) are
rounded upwards. This behaviour ensures that if an X% quantile is
requested, then <span class="emphasis"><em>at least</em></span> the requested coverage
will be present in the central region, and <span class="emphasis"><em>no more than</em></span>
the requested coverage will be present in the tails.
</p>
The quantile function will by default return an integer result that
has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower
quantiles (where the probability is less than 0.5) are rounded downward,
and upper quantiles (where the probability is greater than 0.5) are
rounded upwards. This behaviour ensures that if an X% quantile is requested,
then <span class="emphasis"><em>at least</em></span> the requested coverage will be present
in the central region, and <span class="emphasis"><em>no more than</em></span> the requested
coverage will be present in the tails.
</p>
<p>
This behaviour can be changed so that the quantile functions are
rounded differently, or even return a real-valued result using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>. It is
strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Quantiles of Discrete Distributions</a> before using the quantile
function on the Poisson distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference
docs</a> describe how to change the rounding policy for these
distributions.
</p>
This behaviour can be changed so that the quantile functions are rounded
differently, or even return a real-valued result using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>.
It is strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Quantiles of Discrete Distributions</a> before using the quantile
function on the Poisson distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference
docs</a> describe how to change the rounding policy for these distributions.
</p>
</td></tr>
</table></div>
<p>
</p>
<a name="math_toolkit.dist.dist_ref.dists.poisson_dist.member_functions"></a><h5>
<a name="id1123717"></a>
<a name="id1124999"></a>
<a class="link" href="poisson_dist.html#math_toolkit.dist.dist_ref.dists.poisson_dist.member_functions">Member
Functions</a>
</h5>
@ -130,7 +124,7 @@
Returns the <span class="emphasis"><em>mean</em></span> of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.poisson_dist.non_member_accessors"></a><h5>
<a name="id1123807"></a>
<a name="id1125089"></a>
<a class="link" href="poisson_dist.html#math_toolkit.dist.dist_ref.dists.poisson_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -150,7 +144,7 @@
The domain of the random variable is [0, &#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.poisson_dist.accuracy"></a><h5>
<a name="id1123904"></a>
<a name="id1125186"></a>
<a class="link" href="poisson_dist.html#math_toolkit.dist.dist_ref.dists.poisson_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -164,7 +158,7 @@
using an iterative method with a lower tolerance to avoid excessive computation.
</p>
<a name="math_toolkit.dist.dist_ref.dists.poisson_dist.implementation"></a><h5>
<a name="id1123933"></a>
<a name="id1125215"></a>
<a class="link" href="poisson_dist.html#math_toolkit.dist.dist_ref.dists.poisson_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.rayleigh"></a><a class="link" href="rayleigh.html" title="Rayleigh Distribution"> Rayleigh
<a name="math_toolkit.dist.dist_ref.dists.rayleigh"></a><a class="link" href="rayleigh.html" title="Rayleigh Distribution">Rayleigh
Distribution</a>
</h5></div></div></div>
<p>
@ -79,7 +79,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/rayleigh_cdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.rayleigh.related_distributions"></a><h5>
<a name="id1124654"></a>
<a name="id1125937"></a>
<a class="link" href="rayleigh.html#math_toolkit.dist.dist_ref.dists.rayleigh.related_distributions">Related
distributions</a>
</h5>
@ -95,7 +95,7 @@
distribution</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.rayleigh.member_functions"></a><h5>
<a name="id1124706"></a>
<a name="id1125989"></a>
<a class="link" href="rayleigh.html#math_toolkit.dist.dist_ref.dists.rayleigh.member_functions">Member
Functions</a>
</h5>
@ -114,7 +114,7 @@
Returns the <span class="emphasis"><em>sigma</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.rayleigh.non_member_accessors"></a><h5>
<a name="id1127300"></a>
<a name="id1126093"></a>
<a class="link" href="rayleigh.html#math_toolkit.dist.dist_ref.dists.rayleigh.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -134,7 +134,7 @@
The domain of the random variable is [0, max_value].
</p>
<a name="math_toolkit.dist.dist_ref.dists.rayleigh.accuracy"></a><h5>
<a name="id1127399"></a>
<a name="id1126193"></a>
<a class="link" href="rayleigh.html#math_toolkit.dist.dist_ref.dists.rayleigh.accuracy">Accuracy</a>
</h5>
<p>
@ -144,7 +144,7 @@
using NTL RR type with 150-bit accuracy, about 50 decimal digits.
</p>
<a name="math_toolkit.dist.dist_ref.dists.rayleigh.implementation"></a><h5>
<a name="id1127433"></a>
<a name="id1126226"></a>
<a class="link" href="rayleigh.html#math_toolkit.dist.dist_ref.dists.rayleigh.implementation">Implementation</a>
</h5>
<p>
@ -313,7 +313,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.rayleigh.references"></a><h5>
<a name="id1127765"></a>
<a name="id1127741"></a>
<a class="link" href="rayleigh.html#math_toolkit.dist.dist_ref.dists.rayleigh.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist"></a><a class="link" href="students_t_dist.html" title="Students t Distribution">
Students t Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist"></a><a class="link" href="students_t_dist.html" title="Students t Distribution">Students
t Distribution</a>
</h5></div></div></div>
<p>
@ -90,7 +90,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/students_t_pdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist.member_functions"></a><h5>
<a name="id1128346"></a>
<a name="id1128322"></a>
<a class="link" href="students_t_dist.html#math_toolkit.dist.dist_ref.dists.students_t_dist.member_functions">Member
Functions</a>
</h5>
@ -167,7 +167,7 @@
Engineering Statistics Handbook</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist.non_member_accessors"></a><h5>
<a name="id1128638"></a>
<a name="id1128613"></a>
<a class="link" href="students_t_dist.html#math_toolkit.dist.dist_ref.dists.students_t_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -187,7 +187,7 @@
The domain of the random variable is [-&#8734;, +&#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist.examples"></a><h5>
<a name="id1128737"></a>
<a name="id1128713"></a>
<a class="link" href="students_t_dist.html#math_toolkit.dist.dist_ref.dists.students_t_dist.examples">Examples</a>
</h5>
<p>
@ -195,7 +195,7 @@
are available illustrating the use of the Student's t distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist.accuracy"></a><h5>
<a name="id1128764"></a>
<a name="id1128739"></a>
<a class="link" href="students_t_dist.html#math_toolkit.dist.dist_ref.dists.students_t_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -204,7 +204,7 @@
inverses</a>, refer to accuracy data on those functions for more information.
</p>
<a name="math_toolkit.dist.dist_ref.dists.students_t_dist.implementation"></a><h5>
<a name="id1128795"></a>
<a name="id1128770"></a>
<a class="link" href="students_t_dist.html#math_toolkit.dist.dist_ref.dists.students_t_dist.implementation">Implementation</a>
</h5>
<p>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist"></a><a class="link" href="triangular_dist.html" title="Triangular Distribution">
Triangular Distribution</a>
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist"></a><a class="link" href="triangular_dist.html" title="Triangular Distribution">Triangular
Distribution</a>
</h5></div></div></div>
<p>
@ -121,7 +121,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/triangular_cdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist.member_functions"></a><h5>
<a name="id1130094"></a>
<a name="id1129934"></a>
<a class="link" href="triangular_dist.html#math_toolkit.dist.dist_ref.dists.triangular_dist.member_functions">Member
Functions</a>
</h5>
@ -156,7 +156,7 @@
(default+1).
</p>
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist.non_member_accessors"></a><h5>
<a name="id1130313"></a>
<a name="id1130152"></a>
<a class="link" href="triangular_dist.html#math_toolkit.dist.dist_ref.dists.triangular_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -177,7 +177,7 @@
range is lower &lt;= x &lt;= upper.
</p>
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist.accuracy"></a><h5>
<a name="id1130412"></a>
<a name="id1130252"></a>
<a class="link" href="triangular_dist.html#math_toolkit.dist.dist_ref.dists.triangular_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -186,7 +186,7 @@
with arguments nearing the extremes of zero and unity.
</p>
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist.implementation"></a><h5>
<a name="id1130434"></a>
<a name="id1130273"></a>
<a class="link" href="triangular_dist.html#math_toolkit.dist.dist_ref.dists.triangular_dist.implementation">Implementation</a>
</h5>
<p>
@ -371,7 +371,7 @@
Calculate and plot probability distributions</a>
</p>
<a name="math_toolkit.dist.dist_ref.dists.triangular_dist.references"></a><h5>
<a name="id1130766"></a>
<a name="id1130606"></a>
<a class="link" href="triangular_dist.html#math_toolkit.dist.dist_ref.dists.triangular_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist"></a><a class="link" href="uniform_dist.html" title="Uniform Distribution"> Uniform
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist"></a><a class="link" href="uniform_dist.html" title="Uniform Distribution">Uniform
Distribution</a>
</h5></div></div></div>
<p>
@ -110,7 +110,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/uniform_cdf.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist.member_functions"></a><h5>
<a name="id1132848"></a>
<a name="id1133156"></a>
<a class="link" href="uniform_dist.html#math_toolkit.dist.dist_ref.dists.uniform_dist.member_functions">Member
Functions</a>
</h5>
@ -137,7 +137,7 @@
Returns the <span class="emphasis"><em>upper</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist.non_member_accessors"></a><h5>
<a name="id1133014"></a>
<a name="id1133323"></a>
<a class="link" href="uniform_dist.html#math_toolkit.dist.dist_ref.dists.uniform_dist.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -158,7 +158,7 @@
range is only <span class="emphasis"><em>lower</em></span> &lt;= x &lt;= <span class="emphasis"><em>upper</em></span>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist.accuracy"></a><h5>
<a name="id1133119"></a>
<a name="id1133428"></a>
<a class="link" href="uniform_dist.html#math_toolkit.dist.dist_ref.dists.uniform_dist.accuracy">Accuracy</a>
</h5>
<p>
@ -166,7 +166,7 @@
and so should have errors within an epsilon or two.
</p>
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist.implementation"></a><h5>
<a name="id1133138"></a>
<a name="id1133447"></a>
<a class="link" href="uniform_dist.html#math_toolkit.dist.dist_ref.dists.uniform_dist.implementation">Implementation</a>
</h5>
<p>
@ -330,7 +330,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.uniform_dist.references"></a><h5>
<a name="id1133414"></a>
<a name="id1133723"></a>
<a class="link" href="uniform_dist.html#math_toolkit.dist.dist_ref.dists.uniform_dist.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.dist_ref.dists.weibull"></a><a class="link" href="weibull.html" title="Weibull Distribution"> Weibull
<a name="math_toolkit.dist.dist_ref.dists.weibull"></a><a class="link" href="weibull.html" title="Weibull Distribution">Weibull
Distribution</a>
</h5></div></div></div>
<p>
@ -93,7 +93,7 @@
<span class="inlinemediaobject"><img src="../../../../../graphs/weibull_pdf2.png" align="middle"></span>
</p>
<a name="math_toolkit.dist.dist_ref.dists.weibull.related_distributions"></a><h5>
<a name="id1131362"></a>
<a name="id1131201"></a>
<a class="link" href="weibull.html#math_toolkit.dist.dist_ref.dists.weibull.related_distributions">Related
distributions</a>
</h5>
@ -107,7 +107,7 @@
Distributions, Theory and Applications Samuel Kotz &amp; Saralees Nadarajah</a>.
</p>
<a name="math_toolkit.dist.dist_ref.dists.weibull.member_functions"></a><h5>
<a name="id1131405"></a>
<a name="id1131244"></a>
<a class="link" href="weibull.html#math_toolkit.dist.dist_ref.dists.weibull.member_functions">Member
Functions</a>
</h5>
@ -133,7 +133,7 @@
Returns the <span class="emphasis"><em>scale</em></span> parameter of this distribution.
</p>
<a name="math_toolkit.dist.dist_ref.dists.weibull.non_member_accessors"></a><h5>
<a name="id1131564"></a>
<a name="id1131404"></a>
<a class="link" href="weibull.html#math_toolkit.dist.dist_ref.dists.weibull.non_member_accessors">Non-member
Accessors</a>
</h5>
@ -153,7 +153,7 @@
The domain of the random variable is [0, &#8734;].
</p>
<a name="math_toolkit.dist.dist_ref.dists.weibull.accuracy"></a><h5>
<a name="id1131664"></a>
<a name="id1131503"></a>
<a class="link" href="weibull.html#math_toolkit.dist.dist_ref.dists.weibull.accuracy">Accuracy</a>
</h5>
<p>
@ -163,7 +163,7 @@
as such should have very low error rates.
</p>
<a name="math_toolkit.dist.dist_ref.dists.weibull.implementation"></a><h5>
<a name="id1131705"></a>
<a name="id1131544"></a>
<a class="link" href="weibull.html#math_toolkit.dist.dist_ref.dists.weibull.implementation">Implementation</a>
</h5>
<p>
@ -330,7 +330,7 @@
</tbody>
</table></div>
<a name="math_toolkit.dist.dist_ref.dists.weibull.references"></a><h5>
<a name="id1132201"></a>
<a name="id1131869"></a>
<a class="link" href="weibull.html#math_toolkit.dist.dist_ref.dists.weibull.references">References</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</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>
<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
@ -29,10 +29,9 @@
<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="id1077841"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.function_index">Function
Index</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__function_index____function_index"></a><h5>
<a name="id1078965"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__function_index____function_index"><a name="function_index"></a> Function Index</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
@ -87,10 +86,9 @@
<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="id1078065"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.conceptual_index">Conceptual
Index</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__concept_index____conceptual_index"></a><h5>
<a name="id1079188"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__concept_index____conceptual_index"><a name="concept_index"></a> Conceptual Index</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
@ -174,10 +172,9 @@
<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="id1078400"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.cumulative_distribution_function">Cumulative
Distribution Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_cdf____cumulative_distribution_function"></a><h5>
<a name="id1079519"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_cdf____cumulative_distribution_function"><a name="math.dist.cdf"></a> 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>
@ -198,10 +195,9 @@
<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="id1078570"></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>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_ccdf____complement_of_the_cumulative_distribution_function"></a><h5>
<a name="id1079686"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_ccdf____complement_of_the_cumulative_distribution_function"><a name="math.dist.ccdf"></a> 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>
@ -239,9 +235,9 @@
See <a class="link" href="../stat_tut/overview.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="id1078858"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.hazard_function">Hazard Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_hazard____hazard_function"></a><h5>
<a name="id1079973"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_hazard____hazard_function"><a name="math.dist.hazard"></a> 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>
@ -267,10 +263,9 @@
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="id1079041"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.cumulative_hazard_function">Cumulative
Hazard Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_chf____cumulative_hazard_function"></a><h5>
<a name="id1080152"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_chf____cumulative_hazard_function"><a name="math.dist.chf"></a> 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>
@ -295,9 +290,9 @@
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="id1079286"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.mean">mean</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_mean____mean"></a><h5>
<a name="id1080330"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_mean____mean"><a name="math.dist.mean"></a> 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>
@ -310,9 +305,9 @@
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="id1079404"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.median">median</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_median____median"></a><h5>
<a name="id1080567"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_median____median"><a name="math.dist.median"></a> 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>
@ -320,9 +315,9 @@
<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="id1079513"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.mode">mode</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_mode____mode"></a><h5>
<a name="id1080675"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_mode____mode"><a name="math.dist.mode"></a> 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>
@ -334,10 +329,9 @@
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="id1079628"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.probability_density_function">Probability
Density Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_pdf____probability_density_function"></a><h5>
<a name="id1080786"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_pdf____probability_density_function"><a name="math.dist.pdf"></a> 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>
@ -363,9 +357,9 @@
<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="id1079798"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.range">range</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_range____range"></a><h5>
<a name="id1080952"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_range____range"><a name="math.dist.range"></a> 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>
@ -373,9 +367,9 @@
<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="id1079933"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.quantile">Quantile</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_quantile____quantile"></a><h5>
<a name="id1081086"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_quantile____quantile"><a name="math.dist.quantile"></a> 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>
@ -402,10 +396,9 @@
<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="id1080158"></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>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_quantile_c____quantile_from_the_complement_of_the_probability_"></a><h5>
<a name="id1081309"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_quantile_c____quantile_from_the_complement_of_the_probability_"><a name="math.dist.quantile_c"></a> Quantile from the complement of the probability.</a>
</h5>
<p>
<a class="link" href="../stat_tut/overview.html#complements">complements</a>
@ -448,10 +441,9 @@
<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="id1080498"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.standard_deviation">Standard
Deviation</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_sd____standard_deviation"></a><h5>
<a name="id1081649"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_sd____standard_deviation"><a name="math.dist.sd"></a> 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>
@ -463,9 +455,9 @@
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="id1080620"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.support">support</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_support____support"></a><h5>
<a name="id1081768"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_support____support"><a name="math.dist.support"></a> 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>
@ -480,9 +472,9 @@
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="id1080764"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.variance">Variance</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_variance____variance"></a><h5>
<a name="id1081911"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_variance____variance"><a name="math.dist.variance"></a> 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>
@ -494,9 +486,9 @@
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="id1080882"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.skewness">Skewness</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_skewness____skewness"></a><h5>
<a name="id1082028"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_skewness____skewness"><a name="math.dist.skewness"></a> 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>
@ -508,9 +500,9 @@
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="id1081001"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.kurtosis">Kurtosis</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_kurtosis____kurtosis"></a><h5>
<a name="id1082146"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_kurtosis____kurtosis"><a name="math.dist.kurtosis"></a> 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>
@ -550,10 +542,9 @@
<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="id1081209"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.kurtosis_excess">Kurtosis
excess</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_kurtosis_excess____kurtosis_excess"></a><h5>
<a name="id1082352"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__math_dist_kurtosis_excess____kurtosis_excess"><a name="math.dist.kurtosis_excess"></a> 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>
@ -585,9 +576,9 @@
<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="id1082782"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.p_and_q">P and Q</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__cdfpq____p_and_q"></a><h5>
<a name="id1082538"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__cdfpq____p_and_q"><a name="cdfPQ"></a> 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
@ -595,36 +586,32 @@
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="id1082812"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.percent_point_function">Percent
Point Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__percent____percent_point_function"></a><h5>
<a name="id1082569"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__percent____percent_point_function"><a name="percent"></a> 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="id1082838"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.inverse_cdf_function_">Inverse
CDF Function.</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__cdf_inv____inverse_cdf_function_"></a><h5>
<a name="id1082593"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__cdf_inv____inverse_cdf_function_"><a name="cdf_inv"></a> 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="id1082866"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.inverse_survival_function_">Inverse
Survival Function.</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__survival_inv____inverse_survival_function_"></a><h5>
<a name="id1082617"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__survival_inv____inverse_survival_function_"><a name="survival_inv"></a> 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="id1082896"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.probability_mass_function">Probability
Mass Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__pmf____probability_mass_function"></a><h5>
<a name="id1082641"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__pmf____probability_mass_function"><a name="pmf"></a> 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
@ -635,20 +622,18 @@
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="id1082934"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.lower_critical_value_">Lower
Critical Value.</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__lower_critical____lower_critical_value_"></a><h5>
<a name="id1082675"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__lower_critical____lower_critical_value_"><a name="lower_critical"></a> 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="id1082960"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.upper_critical_value_">Upper
Critical Value.</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__upper_critical____upper_critical_value_"></a><h5>
<a name="id1082699"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__upper_critical____upper_critical_value_"><a name="upper_critical"></a> Upper Critical Value.</a>
</h5>
<p>
The upper critical value calculates the value of the random variable given
@ -656,10 +641,9 @@
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="id1082986"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp.survival_function">Survival
Function</a>
<a name="math_toolkit.dist.dist_ref.nmp._anchor_id__survival____survival_function"></a><h5>
<a name="id1082723"></a>
<a class="link" href="nmp.html#math_toolkit.dist.dist_ref.nmp._anchor_id__survival____survival_function"><a name="survival"></a> Survival Function</a>
</h5>
<p>
Refer to the <a class="link" href="nmp.html#math.dist.ccdf">Complement of the Cumulative

View File

@ -17,10 +17,10 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.dist.future"></a><a class="link" href="future.html" title="Extras/Future Directions"> Extras/Future Directions</a>
<a name="math_toolkit.dist.future"></a><a class="link" href="future.html" title="Extras/Future Directions">Extras/Future Directions</a>
</h3></div></div></div>
<a name="math_toolkit.dist.future.adding_additional_location_and_scale_parameters"></a><h5>
<a name="id1135811"></a>
<a name="id1136052"></a>
<a class="link" href="future.html#math_toolkit.dist.future.adding_additional_location_and_scale_parameters">Adding
Additional Location and Scale Parameters</a>
</h5>
@ -48,7 +48,7 @@
functions.
</p>
<a name="math_toolkit.dist.future.an__quot_any_distribution_quot__class"></a><h5>
<a name="id1135975"></a>
<a name="id1136217"></a>
<a class="link" href="future.html#math_toolkit.dist.future.an__quot_any_distribution_quot__class">An
"any_distribution" class</a>
</h5>
@ -77,7 +77,7 @@
use case: this needs more investigation.
</p>
<a name="math_toolkit.dist.future.higher_level_hypothesis_tests"></a><h5>
<a name="id1136184"></a>
<a name="id1136426"></a>
<a class="link" href="future.html#math_toolkit.dist.future.higher_level_hypothesis_tests">Higher
Level Hypothesis Tests</a>
</h5>
@ -97,7 +97,7 @@
<span class="emphasis"><em>expected_mean</em></span>.
</p>
<a name="math_toolkit.dist.future.integration_with_statistical_accumulators"></a><h5>
<a name="id1136345"></a>
<a name="id1136586"></a>
<a class="link" href="future.html#math_toolkit.dist.future.integration_with_statistical_accumulators">Integration
With Statistical Accumulators</a>
</h5>

View File

@ -17,95 +17,93 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.dist.stat_tut"></a><a class="link" href="stat_tut.html" title="Statistical Distributions Tutorial"> Statistical Distributions
<a name="math_toolkit.dist.stat_tut"></a><a class="link" href="stat_tut.html" title="Statistical Distributions Tutorial">Statistical Distributions
Tutorial</a>
</h3></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="stat_tut/overview.html"> Overview</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg.html"> Worked Examples</a></span></dt>
<dt><span class="section"><a href="stat_tut/overview.html">Overview</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg.html">Worked Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/dist_construct_eg.html">
Distribution Construction Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg.html"> Student's
t Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/st_eg/tut_mean_intervals.html">
Calculating confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/tut_mean_test.html">
Testing a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/tut_mean_size.html">
Estimating how large a sample size would have to become in order to give
a significant Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/two_sample_students_t.html">
Comparing the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/paired_st.html">
Comparing two paired samples with the Student's t distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/weg/cs_eg.html"> Chi Squared
<dt><span class="section"><a href="stat_tut/weg/dist_construct_eg.html">Distribution
Construction Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg.html">Student's t
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/cs_eg/chi_sq_intervals.html">
Confidence Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/cs_eg/chi_sq_test.html">
Chi-Square Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/cs_eg/chi_sq_size.html">
Estimating the Required Sample Sizes for a Chi-Square Test for the Standard
Deviation</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/tut_mean_intervals.html">Calculating
confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/tut_mean_test.html">Testing
a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/tut_mean_size.html">Estimating
how large a sample size would have to become in order to give a significant
Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/two_sample_students_t.html">Comparing
the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/st_eg/paired_st.html">Comparing
two paired samples with the Student's t distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/weg/f_eg.html"> F Distribution
<dt><span class="section"><a href="stat_tut/weg/cs_eg.html">Chi Squared
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/cs_eg/chi_sq_intervals.html">Confidence
Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/cs_eg/chi_sq_test.html">Chi-Square
Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/cs_eg/chi_sq_size.html">Estimating
the Required Sample Sizes for a Chi-Square Test for the Standard Deviation</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/weg/f_eg.html">F Distribution
Examples</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg.html"> Binomial
<dt><span class="section"><a href="stat_tut/weg/binom_eg.html">Binomial
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binomial_coinflip_example.html">
Binomial Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binomial_quiz_example.html">
Binomial Quiz Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for a Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binom_size_eg.html">
Estimating Sample Sizes for a Binomial Distribution.</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binomial_coinflip_example.html">Binomial
Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binomial_quiz_example.html">Binomial
Quiz Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for a Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/binom_eg/binom_size_eg.html">Estimating
Sample Sizes for a Binomial Distribution.</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg.html"> Negative
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg.html">Negative
Binomial Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/neg_binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for the
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html">
Estimating Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/negative_binomial_example1.html">
Negative Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/negative_binomial_example2.html">
Negative Binomial Table Printing Example.</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/neg_binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for the Negative Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html">Estimating
Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/negative_binomial_example1.html">Negative
Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/neg_binom_eg/negative_binomial_example2.html">Negative
Binomial Table Printing Example.</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/weg/normal_example.html"> Normal
<dt><span class="section"><a href="stat_tut/weg/normal_example.html">Normal
Distribution Examples</a></span></dt>
<dd><dl><dt><span class="section"><a href="stat_tut/weg/normal_example/normal_misc.html">
Some Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></dd>
<dt><span class="section"><a href="stat_tut/weg/nccs_eg.html"> Non Central
<dd><dl><dt><span class="section"><a href="stat_tut/weg/normal_example/normal_misc.html">Some
Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></dd>
<dt><span class="section"><a href="stat_tut/weg/nccs_eg.html">Non Central
Chi Squared Example</a></span></dt>
<dd><dl><dt><span class="section"><a href="stat_tut/weg/nccs_eg/nccs_power_eg.html">
Tables of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></dd>
<dt><span class="section"><a href="stat_tut/weg/error_eg.html"> Error Handling
<dd><dl><dt><span class="section"><a href="stat_tut/weg/nccs_eg/nccs_power_eg.html">Tables
of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></dd>
<dt><span class="section"><a href="stat_tut/weg/error_eg.html">Error Handling
Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/find_eg.html"> Find Location
<dt><span class="section"><a href="stat_tut/weg/find_eg.html">Find Location
and Scale Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="stat_tut/weg/find_eg/find_location_eg.html">
Find Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/find_eg/find_scale_eg.html">
Find Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/find_eg/find_mean_and_sd_eg.html">
Find mean and standard deviation example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/find_eg/find_location_eg.html">Find
Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/find_eg/find_scale_eg.html">Find
Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="stat_tut/weg/find_eg/find_mean_and_sd_eg.html">Find
mean and standard deviation example</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/weg/nag_library.html"> Comparison
<dt><span class="section"><a href="stat_tut/weg/nag_library.html">Comparison
with C, R, FORTRAN-style Free Functions</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stat_tut/variates.html"> Random Variates
<dt><span class="section"><a href="stat_tut/variates.html">Random Variates
and Distribution Parameters</a></span></dt>
<dt><span class="section"><a href="stat_tut/dist_params.html"> Discrete Probability
<dt><span class="section"><a href="stat_tut/dist_params.html">Discrete Probability
Distributions</a></span></dt>
</dl></div>
<p>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.stat_tut.dist_params"></a><a class="link" href="dist_params.html" title="Discrete Probability Distributions"> Discrete Probability
<a name="math_toolkit.dist.stat_tut.dist_params"></a><a class="link" href="dist_params.html" title="Discrete Probability Distributions">Discrete Probability
Distributions</a>
</h4></div></div></div>
<p>

View File

@ -17,10 +17,10 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.stat_tut.overview"></a><a class="link" href="overview.html" title="Overview"> Overview</a>
<a name="math_toolkit.dist.stat_tut.overview"></a><a class="link" href="overview.html" title="Overview">Overview</a>
</h4></div></div></div>
<a name="math_toolkit.dist.stat_tut.overview.headers_and_namespaces"></a><h5>
<a name="id995888"></a>
<a name="id997723"></a>
<a class="link" href="overview.html#math_toolkit.dist.stat_tut.overview.headers_and_namespaces">Headers
and Namespaces</a>
</h5>
@ -37,7 +37,7 @@
or &lt;boost/math/distributions.hpp&gt;
</p>
<a name="math_toolkit.dist.stat_tut.overview.distributions_are_objects"></a><h5>
<a name="id995920"></a>
<a name="id997756"></a>
<a class="link" href="overview.html#math_toolkit.dist.stat_tut.overview.distributions_are_objects">Distributions
are Objects</a>
</h5>
@ -124,7 +124,7 @@
and <span class="emphasis"><em>quantiles</em></span> etc for these distributions.
</p>
<a name="math_toolkit.dist.stat_tut.overview.generic_operations_common_to_all_distributions_are_non_member_functions"></a><h5>
<a name="id996280"></a>
<a name="id998116"></a>
<a class="link" href="overview.html#math_toolkit.dist.stat_tut.overview.generic_operations_common_to_all_distributions_are_non_member_functions">Generic
operations common to all distributions are non-member functions</a>
</h5>
@ -159,8 +159,6 @@
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top">
<p>
</p>
<p>
<span class="bold"><strong>Random numbers that approximate Quantiles of Distributions</strong></span>
</p>
@ -199,8 +197,6 @@
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
<p>
</p>
<p>
<span class="bold"><strong>Random Variates and Distribution Parameters</strong></span>
</p>
@ -266,8 +262,6 @@
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top">
<p>
</p>
<p>
<span class="bold"><strong>Discrete Probability Distributions</strong></span>
</p>
@ -316,10 +310,8 @@
</p>
</td></tr>
</table></div>
<a name="complements"></a><p>
</p>
<a name="math_toolkit.dist.stat_tut.overview.complements_are_supported_too"></a><h5>
<a name="id997456"></a>
<a name="complements"></a><a name="math_toolkit.dist.stat_tut.overview.complements_are_supported_too"></a><h5>
<a name="id999277"></a>
<a class="link" href="overview.html#math_toolkit.dist.stat_tut.overview.complements_are_supported_too">Complements
are supported too</a>
</h5>
@ -366,8 +358,6 @@
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top">
<p>
</p>
<p>
<span class="bold"><strong>Critical values are just quantiles</strong></span>
</p>
@ -401,8 +391,6 @@
</p>
</td></tr>
</table></div>
<a name="why_complements"></a><p>
</p>
<div class="tip"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../images/tip.png"></td>
@ -410,9 +398,8 @@
</tr>
<tr><td align="left" valign="top">
<p>
</p>
<p>
<span class="bold"><strong>Why bother with complements anyway?</strong></span>
<span class="bold"><strong><a name="why_complements"></a> Why bother with
complements anyway?</strong></span>
</p>
<p>
It's very tempting to dispense with complements, and simply subtract
@ -454,7 +441,7 @@
</td></tr>
</table></div>
<a name="math_toolkit.dist.stat_tut.overview.parameters_can_be_calculated"></a><h5>
<a name="id998303"></a>
<a name="id1000112"></a>
<a class="link" href="overview.html#math_toolkit.dist.stat_tut.overview.parameters_can_be_calculated">Parameters
can be calculated</a>
</h5>
@ -485,7 +472,7 @@
sample size.
</p>
<a name="math_toolkit.dist.stat_tut.overview.summary"></a><h5>
<a name="id998395"></a>
<a name="id1000204"></a>
<a class="link" href="overview.html#math_toolkit.dist.stat_tut.overview.summary">Summary</a>
</h5>
<div class="itemizedlist"><ul type="disc">

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.stat_tut.variates"></a><a class="link" href="variates.html" title="Random Variates and Distribution Parameters"> Random Variates
<a name="math_toolkit.dist.stat_tut.variates"></a><a class="link" href="variates.html" title="Random Variates and Distribution Parameters">Random Variates
and Distribution Parameters</a>
</h4></div></div></div>
<p>

View File

@ -17,92 +17,86 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="math_toolkit.dist.stat_tut.weg"></a><a class="link" href="weg.html" title="Worked Examples"> Worked Examples</a>
<a name="math_toolkit.dist.stat_tut.weg"></a><a class="link" href="weg.html" title="Worked Examples">Worked Examples</a>
</h4></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="weg/dist_construct_eg.html">
Distribution Construction Example</a></span></dt>
<dt><span class="section"><a href="weg/st_eg.html"> Student's
t Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="weg/st_eg/tut_mean_intervals.html">
Calculating confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/tut_mean_test.html">
Testing a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/tut_mean_size.html">
Estimating how large a sample size would have to become in order to give
a significant Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/two_sample_students_t.html">
Comparing the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/paired_st.html">
Comparing two paired samples with the Student's t distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="weg/cs_eg.html"> Chi Squared
<dt><span class="section"><a href="weg/dist_construct_eg.html">Distribution
Construction Example</a></span></dt>
<dt><span class="section"><a href="weg/st_eg.html">Student's t
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="weg/cs_eg/chi_sq_intervals.html">
Confidence Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="weg/cs_eg/chi_sq_test.html">
Chi-Square Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="weg/cs_eg/chi_sq_size.html">
Estimating the Required Sample Sizes for a Chi-Square Test for the Standard
Deviation</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/tut_mean_intervals.html">Calculating
confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/tut_mean_test.html">Testing
a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/tut_mean_size.html">Estimating
how large a sample size would have to become in order to give a significant
Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/two_sample_students_t.html">Comparing
the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="weg/st_eg/paired_st.html">Comparing
two paired samples with the Student's t distribution</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="weg/f_eg.html"> F Distribution
<dt><span class="section"><a href="weg/cs_eg.html">Chi Squared
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="weg/cs_eg/chi_sq_intervals.html">Confidence
Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="weg/cs_eg/chi_sq_test.html">Chi-Square
Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="weg/cs_eg/chi_sq_size.html">Estimating
the Required Sample Sizes for a Chi-Square Test for the Standard Deviation</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="weg/f_eg.html">F Distribution
Examples</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg.html"> Binomial
<dt><span class="section"><a href="weg/binom_eg.html">Binomial
Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="weg/binom_eg/binomial_coinflip_example.html">
Binomial Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binomial_quiz_example.html">
Binomial Quiz Example</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for a Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binom_size_eg.html">
Estimating Sample Sizes for a Binomial Distribution.</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binomial_coinflip_example.html">Binomial
Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binomial_quiz_example.html">Binomial
Quiz Example</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for a Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="weg/binom_eg/binom_size_eg.html">Estimating
Sample Sizes for a Binomial Distribution.</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="weg/neg_binom_eg.html"> Negative
<dt><span class="section"><a href="weg/neg_binom_eg.html">Negative
Binomial Distribution Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="weg/neg_binom_eg/neg_binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for the
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/neg_binom_size_eg.html">
Estimating Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/negative_binomial_example1.html">
Negative Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/negative_binomial_example2.html">
Negative Binomial Table Printing Example.</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/neg_binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for the Negative Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/neg_binom_size_eg.html">Estimating
Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/negative_binomial_example1.html">Negative
Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="weg/neg_binom_eg/negative_binomial_example2.html">Negative
Binomial Table Printing Example.</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="weg/normal_example.html"> Normal
<dt><span class="section"><a href="weg/normal_example.html">Normal
Distribution Examples</a></span></dt>
<dd><dl><dt><span class="section"><a href="weg/normal_example/normal_misc.html">
Some Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></dd>
<dt><span class="section"><a href="weg/nccs_eg.html"> Non Central
<dd><dl><dt><span class="section"><a href="weg/normal_example/normal_misc.html">Some
Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></dd>
<dt><span class="section"><a href="weg/nccs_eg.html">Non Central
Chi Squared Example</a></span></dt>
<dd><dl><dt><span class="section"><a href="weg/nccs_eg/nccs_power_eg.html">
Tables of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></dd>
<dt><span class="section"><a href="weg/error_eg.html"> Error Handling
<dd><dl><dt><span class="section"><a href="weg/nccs_eg/nccs_power_eg.html">Tables
of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></dd>
<dt><span class="section"><a href="weg/error_eg.html">Error Handling
Example</a></span></dt>
<dt><span class="section"><a href="weg/find_eg.html"> Find Location
<dt><span class="section"><a href="weg/find_eg.html">Find Location
and Scale Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="weg/find_eg/find_location_eg.html">
Find Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="weg/find_eg/find_scale_eg.html">
Find Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="weg/find_eg/find_mean_and_sd_eg.html">
Find mean and standard deviation example</a></span></dt>
<dt><span class="section"><a href="weg/find_eg/find_location_eg.html">Find
Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="weg/find_eg/find_scale_eg.html">Find
Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="weg/find_eg/find_mean_and_sd_eg.html">Find
mean and standard deviation example</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="weg/nag_library.html"> Comparison
<dt><span class="section"><a href="weg/nag_library.html">Comparison
with C, R, FORTRAN-style Free Functions</a></span></dt>
</dl></div>
<p>
</p>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,19 +17,18 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.binom_eg"></a><a class="link" href="binom_eg.html" title="Binomial Distribution Examples"> Binomial
<a name="math_toolkit.dist.stat_tut.weg.binom_eg"></a><a class="link" href="binom_eg.html" title="Binomial Distribution Examples">Binomial
Distribution Examples</a>
</h5></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="binom_eg/binomial_coinflip_example.html">
Binomial Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="binom_eg/binomial_quiz_example.html">
Binomial Quiz Example</a></span></dt>
<dt><span class="section"><a href="binom_eg/binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for a Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="binom_eg/binom_size_eg.html">
Estimating Sample Sizes for a Binomial Distribution.</a></span></dt>
<dt><span class="section"><a href="binom_eg/binomial_coinflip_example.html">Binomial
Coin-Flipping Example</a></span></dt>
<dt><span class="section"><a href="binom_eg/binomial_quiz_example.html">Binomial
Quiz Example</a></span></dt>
<dt><span class="section"><a href="binom_eg/binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for a Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="binom_eg/binom_size_eg.html">Estimating
Sample Sizes for a Binomial Distribution.</a></span></dt>
</dl></div>
<p>
See also the reference documentation for the <a class="link" href="../../dist_ref/dists/binomial_dist.html" title="Binomial Distribution">Binomial

View File

@ -17,9 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binom_conf"></a><a class="link" href="binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for a Binomial Distribution">
Calculating Confidence Limits on the Frequency of Occurrence for a Binomial
Distribution</a>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binom_conf"></a><a class="link" href="binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for a Binomial Distribution">Calculating
Confidence Limits on the Frequency of Occurrence for a Binomial Distribution</a>
</h6></div></div></div>
<p>
Imagine you have a process that follows a binomial distribution: for

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binom_size_eg"></a><a class="link" href="binom_size_eg.html" title="Estimating Sample Sizes for a Binomial Distribution.">
Estimating Sample Sizes for a Binomial Distribution.</a>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binom_size_eg"></a><a class="link" href="binom_size_eg.html" title="Estimating Sample Sizes for a Binomial Distribution.">Estimating
Sample Sizes for a Binomial Distribution.</a>
</h6></div></div></div>
<p>
Imagine you have a critical component that you know will fail in 1

View File

@ -17,48 +17,36 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_coinflip_example"></a><a class="link" href="binomial_coinflip_example.html" title="Binomial Coin-Flipping Example">
Binomial Coin-Flipping Example</a>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_coinflip_example"></a><a class="link" href="binomial_coinflip_example.html" title="Binomial Coin-Flipping Example">Binomial
Coin-Flipping Example</a>
</h6></div></div></div>
<p>
</p>
An example of a <a href="http://en.wikipedia.org/wiki/Bernoulli_process" target="_top">Bernoulli
process</a> is coin flipping. A variable in such a sequence may
be called a Bernoulli variable.
</p>
<p>
An example of a <a href="http://en.wikipedia.org/wiki/Bernoulli_process" target="_top">Bernoulli
process</a> is coin flipping. A variable in such a sequence may
be called a Bernoulli variable.
</p>
This example shows using the Binomial distribution to predict the probability
of heads and tails when throwing a coin.
</p>
<p>
</p>
The number of correct answers (say heads), X, is distributed as a binomial
random variable with binomial distribution parameters number of trials
(flips) n = 10 and probability (success_fraction) of getting a head
p = 0.5 (a 'fair' coin).
</p>
<p>
This example shows using the Binomial distribution to predict the
probability of heads and tails when throwing a coin.
</p>
(Our coin is assumed fair, but we could easily change the success_fraction
parameter p from 0.5 to some other value to simulate an unfair coin,
say 0.6 for one with chewing gum on the tail, so it is more likely
to fall tails down and heads up).
</p>
<p>
</p>
First we need some includes and using statements to be able to use
the binomial distribution, some std input and output, and get started:
</p>
<p>
The number of correct answers (say heads), X, is distributed as a
binomial random variable with binomial distribution parameters number
of trials (flips) n = 10 and probability (success_fraction) of getting
a head p = 0.5 (a 'fair' coin).
</p>
<p>
</p>
<p>
(Our coin is assumed fair, but we could easily change the success_fraction
parameter p from 0.5 to some other value to simulate an unfair coin,
say 0.6 for one with chewing gum on the tail, so it is more likely
to fall tails down and heads up).
</p>
<p>
</p>
<p>
First we need some includes and using statements to be able to use
the binomial distribution, some std input and output, and get started:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">binomial</span><span class="special">;</span>
@ -74,23 +62,17 @@
<span class="keyword">try</span>
<span class="special">{</span></pre>
<p>
</p>
</p>
<p>
</p>
See note <a class="link" href="binomial_coinflip_example.html#coinflip_eg_catch">with the catch block</a>
about why a try and catch block is always a good idea.
</p>
<p>
See note <a class="link" href="binomial_coinflip_example.html#coinflip_eg_catch">with the catch block</a>
about why a try and catch block is always a good idea.
</p>
First, construct a binomial distribution with parameters success_fraction
1/2, and how many flips.
</p>
<p>
</p>
<p>
First, construct a binomial distribution with parameters success_fraction
1/2, and how many flips.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">success_fraction</span> <span class="special">=</span> <span class="number">0.5</span><span class="special">;</span> <span class="comment">// = 50% = 1/2 for a 'fair' coin.
</span><span class="keyword">int</span> <span class="identifier">flips</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
@ -98,16 +80,12 @@
<span class="identifier">cout</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="number">4</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
Then some examples of using Binomial moments (and echoing the parameters).
</p>
<p>
Then some examples of using Binomial moments (and echoing the parameters).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"From "</span> <span class="special">&lt;&lt;</span> <span class="identifier">flips</span> <span class="special">&lt;&lt;</span> <span class="string">" one can expect to get on average "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">mean</span><span class="special">(</span><span class="identifier">flip</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" heads (or tails)."</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -123,141 +101,104 @@
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Skewness if success_fraction is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">flip</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">()</span>
<span class="special">&lt;&lt;</span> <span class="string">" is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">skewness</span><span class="special">(</span><span class="identifier">flip</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Expect zero for a 'fair' coin.</span></pre>
<p>
</p>
</p>
<p>
</p>
Now we show a variety of predictions on the probability of heads:
</p>
<p>
Now we show a variety of predictions on the probability of heads:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"For "</span> <span class="special">&lt;&lt;</span> <span class="identifier">flip</span><span class="special">.</span><span class="identifier">trials</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">" coin flips: "</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting no heads is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting at least one head is "</span> <span class="special">&lt;&lt;</span> <span class="number">1.</span> <span class="special">-</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
When we want to calculate the probability for a range or values we
can sum the PDF's:
</p>
<p>
When we want to calculate the probability for a range or values we
can sum the PDF's:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting 0 or 1 heads is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// sum of exactly == probabilities</span></pre>
<p>
</p>
</p>
<p>
</p>
Or we can use the cdf.
</p>
<p>
Or we can use the cdf.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting 0 or 1 (&lt;= 1) heads is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting 9 or 10 heads is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">9</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Note that using
</p>
<p>
Note that using
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting 9 or 10 heads is "</span> <span class="special">&lt;&lt;</span> <span class="number">1.</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">8</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
is less accurate than using the complement
</p>
<p>
is less accurate than using the complement
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting 9 or 10 heads is "</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">flip</span><span class="special">,</span> <span class="number">8</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Since the subtraction may involve <a href="http://docs.sun.com/source/806-3568/ncg_goldberg.html" target="_top">cancellation
error</a>, where as <code class="computeroutput"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">8</span><span class="special">))</span></code>
does not use such a subtraction internally, and so does not exhibit
the problem.
</p>
<p>
Since the subtraction may involve <a href="http://docs.sun.com/source/806-3568/ncg_goldberg.html" target="_top">cancellation
error</a>, where as <code class="computeroutput"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">8</span><span class="special">))</span></code> does not use such a subtraction
internally, and so does not exhibit the problem.
</p>
To get the probability for a range of heads, we can either add the
pdfs for each number of heads
</p>
<p>
</p>
<p>
To get the probability for a range of heads, we can either add the
pdfs for each number of heads
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of between 4 and 6 heads (4 or 5 or 6) is "</span>
<span class="comment">// P(X == 4) + P(X == 5) + P(X == 6)
</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">5</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">6</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
But this is probably less efficient than using the cdf
</p>
<p>
But this is probably less efficient than using the cdf
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of between 4 and 6 heads (4 or 5 or 6) is "</span>
<span class="comment">// P(X &lt;= 6) - P(X &lt;= 3) == P(X &lt; 4)
</span> <span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">6</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">3</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Certainly for a bigger range like, 3 to 7
</p>
<p>
Certainly for a bigger range like, 3 to 7
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of between 3 and 7 heads (3, 4, 5, 6 or 7) is "</span>
<span class="comment">// P(X &lt;= 7) - P(X &lt;= 2) == P(X &lt; 3)
</span> <span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">7</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="number">2</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Finally, print two tables of probability for the <span class="emphasis"><em>exactly</em></span>
and <span class="emphasis"><em>at least</em></span> a number of heads.
</p>
<p>
Finally, print two tables of probability for the <span class="emphasis"><em>exactly</em></span>
and <span class="emphasis"><em>at least</em></span> a number of heads.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// Print a table of probability for the exactly a number of heads.
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting exactly (==) heads"</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -281,58 +222,42 @@
<span class="special">&lt;&lt;</span> <span class="identifier">probability</span> <span class="special">*</span> <span class="number">100.</span> <span class="special">&lt;&lt;</span> <span class="string">"%"</span><span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="comment">// for i</span></pre>
<p>
</p>
</p>
<p>
</p>
The last (0 to 10 heads) must, of course, be 100% probability.
</p>
<p>
The last (0 to 10 heads) must, of course, be 100% probability.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="special">}</span>
<span class="keyword">catch</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">e</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">//</span></pre>
<p>
</p>
</p>
<p>
<a name="coinflip_eg_catch"></a>
</p>
<a name="coinflip_eg_catch"></a> It is always essential to include
try &amp; catch blocks because default policies are to throw exceptions
on arguments that are out of domain or cause errors like numeric-overflow.
</p>
<p>
It is always essential to include try &amp; catch blocks because
default policies are to throw exceptions on arguments that are out
of domain or cause errors like numeric-overflow.
</p>
Lacking try &amp; catch blocks, the program will abort, whereas the
message below from the thrown exception will give some helpful clues
as to the cause of the problem.
</p>
<p>
</p>
<p>
Lacking try &amp; catch blocks, the program will abort, whereas the
message below from the thrown exception will give some helpful clues
as to the cause of the problem.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span>
<span class="string">"\n"</span><span class="string">"Message from thrown exception was:\n "</span> <span class="special">&lt;&lt;</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</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>
<span class="special">}</span>
</pre>
<p>
</p>
<p>
</p>
<p>
See <a href="../../../../../../../../example/binomial_coinflip_example.cpp" target="_top">binomial_coinflip_example.cpp</a>
for full source code, the program output looks like this:
</p>
<p>
</p>
<pre class="programlisting">Using Binomial distribution to predict how many heads and tails.
From 10 one can expect to get on average 5 heads (or tails).
Mode is 5
@ -379,8 +304,6 @@ Probability of getting upto (&lt;</code>) heads
9 0.999 or 1 in 1.001, or 99.9%
10 1 or 1 in 1, or 100%
</pre>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,33 +17,27 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example"></a><a class="link" href="binomial_quiz_example.html" title="Binomial Quiz Example">
Binomial Quiz Example</a>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example"></a><a class="link" href="binomial_quiz_example.html" title="Binomial Quiz Example">Binomial
Quiz Example</a>
</h6></div></div></div>
<p>
</p>
A multiple choice test has four possible answers to each of 16 questions.
A student guesses the answer to each question, so the probability of
getting a correct answer on any given question is one in four, a quarter,
1/4, 25% or fraction 0.25. The conditions of the binomial experiment
are assumed to be met: n = 16 questions constitute the trials; each
question results in one of two possible outcomes (correct or incorrect);
the probability of being correct is 0.25 and is constant if no knowledge
about the subject is assumed; the questions are answered independently
if the student's answer to a question in no way influences his/her
answer to another question.
</p>
<p>
A multiple choice test has four possible answers to each of 16 questions.
A student guesses the answer to each question, so the probability
of getting a correct answer on any given question is one in four,
a quarter, 1/4, 25% or fraction 0.25. The conditions of the binomial
experiment are assumed to be met: n = 16 questions constitute the
trials; each question results in one of two possible outcomes (correct
or incorrect); the probability of being correct is 0.25 and is constant
if no knowledge about the subject is assumed; the questions are answered
independently if the student's answer to a question in no way influences
his/her answer to another question.
</p>
First, we need to be able to use the binomial distribution constructor
(and some std input/output, of course).
</p>
<p>
</p>
<p>
First, we need to be able to use the binomial distribution constructor
(and some std input/output, of course).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">binomial</span><span class="special">;</span>
@ -55,19 +49,14 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">setw</span><span class="special">;</span> <span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">setprecision</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<p>
</p>
The number of correct answers, X, is distributed as a binomial random
variable with binomial distribution parameters: questions n = 16 and
success fraction probability p = 0.25. So we construct a binomial distribution:
</p>
<p>
The number of correct answers, X, is distributed as a binomial random
variable with binomial distribution parameters: questions n = 16
and success fraction probability p = 0.25. So we construct a binomial
distribution:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">questions</span> <span class="special">=</span> <span class="number">16</span><span class="special">;</span> <span class="comment">// All the questions in the quiz.
</span><span class="keyword">int</span> <span class="identifier">answers</span> <span class="special">=</span> <span class="number">4</span><span class="special">;</span> <span class="comment">// Possible answers to each question.
@ -75,32 +64,24 @@
</span><span class="comment">// Caution: = answers / questions would be zero (because they are integers)!
</span><span class="identifier">binomial</span> <span class="identifier">quiz</span><span class="special">(</span><span class="identifier">questions</span><span class="special">,</span> <span class="identifier">success_fraction</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
and display the distribution parameters we used thus:
</p>
<p>
and display the distribution parameters we used thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"In a quiz with "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quiz</span><span class="special">.</span><span class="identifier">trials</span><span class="special">()</span>
<span class="special">&lt;&lt;</span> <span class="string">" questions and with a probability of guessing right of "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">quiz</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">()</span> <span class="special">*</span> <span class="number">100</span> <span class="special">&lt;&lt;</span> <span class="string">" %"</span>
<span class="special">&lt;&lt;</span> <span class="string">" or 1 in "</span> <span class="special">&lt;&lt;</span> <span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;(</span><span class="number">1.</span> <span class="special">/</span> <span class="identifier">quiz</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">())</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Show a few probabilities of just guessing:
</p>
<p>
Show a few probabilities of just guessing:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting none right is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.010023
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting exactly one right is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -109,30 +90,20 @@
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting exactly "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pass_score</span> <span class="special">&lt;&lt;</span> <span class="string">" answers right by chance is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">questions</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting none right is 0.0100226
Probability of getting exactly one right is 0.0534538
Probability of getting exactly two right is 0.133635
Probability of getting exactly 11 answers right by chance is 2.32831e-010
</pre>
<p>
</p>
These don't give any encouragement to guessers!
</p>
<p>
These don't give any encouragement to guessers!
</p>
We can tabulate the 'getting exactly right' ( == ) probabilities thus:
</p>
<p>
</p>
<p>
We can tabulate the 'getting exactly right' ( == ) probabilities
thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span> <span class="string">"Guessed Probability"</span> <span class="special">&lt;&lt;</span> <span class="identifier">right</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">successes</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">successes</span> <span class="special">&lt;=</span> <span class="identifier">questions</span><span class="special">;</span> <span class="identifier">successes</span><span class="special">++)</span>
@ -142,10 +113,7 @@ Probability of getting exactly 11 answers right by chance is 2.32831e-010
<span class="special">}</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Guessed Probability
0 0.0100226
1 0.0534538
@ -166,152 +134,101 @@ Probability of getting exactly 11 answers right by chance is 2.32831e-010
16 2.32831e-010
</pre>
<p>
</p>
Then we can add the probabilities of some 'exactly right' like this:
</p>
<p>
Then we can add the probabilities of some 'exactly right' like this:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting none or one right is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting none or one right is 0.0634764
</pre>
<p>
</p>
But if more than a couple of scores are involved, it is more convenient
(and may be more accurate) to use the Cumulative Distribution Function
(cdf) instead:
</p>
<p>
But if more than a couple of scores are involved, it is more convenient
(and may be more accurate) to use the Cumulative Distribution Function
(cdf) instead:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting none or one right is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting none or one right is 0.0634764
</pre>
<p>
</p>
Since the cdf is inclusive, we can get the probability of getting up
to 10 right ( &lt;= )
</p>
<p>
Since the cdf is inclusive, we can get the probability of getting
up to 10 right ( &lt;= )
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting &lt;= 10 right (to fail) is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting &lt;= 10 right (to fail) is 0.999715
</pre>
<p>
</p>
<p>
To get the probability of getting 11 or more right (to pass), it
is tempting to use
To get the probability of getting 11 or more right (to pass), it is
tempting to use
</p>
<pre class="programlisting"><span class="number">1</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span></pre>
<p>
to get the probability of &gt; 10
</p>
to get the probability of &gt; 10
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting &gt; 10 right (to pass) is "</span> <span class="special">&lt;&lt;</span> <span class="number">1</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">10</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting &gt; 10 right (to pass) is 0.000285239
</pre>
<p>
</p>
But this should be resisted in favor of using the complement function.
<a class="link" href="../../overview.html#why_complements">Why complements?</a>
</p>
<p>
But this should be resisted in favor of using the complement function.
<a class="link" href="../../overview.html#why_complements">Why complements?</a>
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting &gt; 10 right (to pass) is "</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">quiz</span><span class="special">,</span> <span class="number">10</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting &gt; 10 right (to pass) is 0.000285239
</pre>
<p>
</p>
And we can check that these two, &lt;= 10 and &gt; 10, add up to unity.
</p>
<p>
And we can check that these two, &lt;= 10 and &gt; 10, add up to
unity.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">10</span><span class="special">)</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">quiz</span><span class="special">,</span> <span class="number">10</span><span class="special">)))</span> <span class="special">==</span> <span class="number">1.</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
If we want a &lt; rather than a &lt;= test, because the CDF is inclusive,
we must subtract one from the score.
</p>
<p>
If we want a &lt; rather than a &lt;= test, because the CDF is inclusive,
we must subtract one from the score.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting less than "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pass_score</span>
<span class="special">&lt;&lt;</span> <span class="string">" (&lt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pass_score</span> <span class="special">&lt;&lt;</span> <span class="string">") answers right by guessing is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">pass_score</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting less than 11 (&lt; 11) answers right by guessing is 0.999715
</pre>
<p>
</p>
and similarly to get a &gt;= rather than a &gt; test we also need to
subtract one from the score (and can again check the sum is unity).
This is because if the cdf is <span class="emphasis"><em>inclusive</em></span>, then
its complement must be <span class="emphasis"><em>exclusive</em></span> otherwise there
would be one possible outcome counted twice!
</p>
<p>
and similarly to get a &gt;= rather than a &gt; test we also need
to subtract one from the score (and can again check the sum is unity).
This is because if the cdf is <span class="emphasis"><em>inclusive</em></span>, then
its complement must be <span class="emphasis"><em>exclusive</em></span> otherwise there
would be one possible outcome counted twice!
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting at least "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pass_score</span>
<span class="special">&lt;&lt;</span> <span class="string">"(&gt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pass_score</span> <span class="special">&lt;&lt;</span> <span class="string">") answers right by guessing is "</span>
@ -320,21 +237,14 @@ Probability of getting exactly 11 answers right by chance is 2.32831e-010
<span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">pass_score</span> <span class="special">-</span><span class="number">1</span><span class="special">)</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">quiz</span><span class="special">,</span> <span class="identifier">pass_score</span><span class="special">-</span><span class="number">1</span><span class="special">)))</span> <span class="special">==</span> <span class="number">1</span><span class="special">);</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting at least 11 (&gt;= 11) answers right by guessing is 0.000285239, only 1 in 3505.83
</pre>
<p>
</p>
Finally we can tabulate some probabilities:
</p>
<p>
Finally we can tabulate some probabilities:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span> <span class="string">"At most (&lt;=)"</span><span class="string">"\n"</span><span class="string">"Guessed OK Probability"</span> <span class="special">&lt;&lt;</span> <span class="identifier">right</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">score</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">score</span> <span class="special">&lt;=</span> <span class="identifier">questions</span><span class="special">;</span> <span class="identifier">score</span><span class="special">++)</span>
@ -344,10 +254,7 @@ Probability of getting exactly 11 answers right by chance is 2.32831e-010
<span class="special">}</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">At most (&lt;=)
Guessed OK Probability
0 0.01002259576
@ -369,9 +276,7 @@ Guessed OK Probability
16 1
</pre>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\n"</span> <span class="string">"At least (&gt;)"</span><span class="string">"\n"</span><span class="string">"Guessed OK Probability"</span> <span class="special">&lt;&lt;</span> <span class="identifier">right</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">score</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">score</span> <span class="special">&lt;=</span> <span class="identifier">questions</span><span class="special">;</span> <span class="identifier">score</span><span class="special">++)</span>
@ -380,10 +285,7 @@ Guessed OK Probability
<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">quiz</span><span class="special">,</span> <span class="identifier">score</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">At least (&gt;)
Guessed OK Probability
0 0.9899774042
@ -405,21 +307,15 @@ Guessed OK Probability
16 0
</pre>
<p>
</p>
We now consider the probabilities of <span class="bold"><strong>ranges</strong></span>
of correct guesses.
</p>
<p>
We now consider the probabilities of <span class="bold"><strong>ranges</strong></span>
of correct guesses.
</p>
First, calculate the probability of getting a range of guesses right,
by adding the exact probabilities of each from low ... high.
</p>
<p>
</p>
<p>
First, calculate the probability of getting a range of guesses right,
by adding the exact probabilities of each from low ... high.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">low</span> <span class="special">=</span> <span class="number">3</span><span class="special">;</span> <span class="comment">// Getting at least 3 right.
</span><span class="keyword">int</span> <span class="identifier">high</span> <span class="special">=</span> <span class="number">5</span><span class="special">;</span> <span class="comment">// Getting as most 5 right.
@ -433,40 +329,26 @@ Guessed OK Probability
<span class="special">&lt;&lt;</span> <span class="identifier">low</span> <span class="special">&lt;&lt;</span> <span class="string">" and "</span> <span class="special">&lt;&lt;</span> <span class="identifier">high</span> <span class="special">&lt;&lt;</span> <span class="string">" answers right by guessing is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">sum</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.61323</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting between 3 and 5 answers right by guessing is 0.6132
</pre>
<p>
</p>
Or, usually better, we can use the difference of cdfs instead:
</p>
<p>
Or, usually better, we can use the difference of cdfs instead:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting between "</span> <span class="special">&lt;&lt;</span> <span class="identifier">low</span> <span class="special">&lt;&lt;</span> <span class="string">" and "</span> <span class="special">&lt;&lt;</span> <span class="identifier">high</span> <span class="special">&lt;&lt;</span> <span class="string">" answers right by guessing is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">high</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">low</span> <span class="special">-</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.61323</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting between 3 and 5 answers right by guessing is 0.6132
</pre>
<p>
</p>
And we can also try a few more combinations of high and low choices:
</p>
<p>
And we can also try a few more combinations of high and low choices:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">low</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span> <span class="identifier">high</span> <span class="special">=</span> <span class="number">6</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting between "</span> <span class="special">&lt;&lt;</span> <span class="identifier">low</span> <span class="special">&lt;&lt;</span> <span class="string">" and "</span> <span class="special">&lt;&lt;</span> <span class="identifier">high</span> <span class="special">&lt;&lt;</span> <span class="string">" answers right by guessing is "</span>
@ -478,32 +360,22 @@ Guessed OK Probability
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting between "</span> <span class="special">&lt;&lt;</span> <span class="identifier">low</span> <span class="special">&lt;&lt;</span> <span class="string">" and "</span> <span class="special">&lt;&lt;</span> <span class="identifier">high</span> <span class="special">&lt;&lt;</span> <span class="string">" answers right by guessing is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">high</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="identifier">low</span> <span class="special">-</span> <span class="number">1</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 4 &lt;= x 4 P = 0.22520</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of getting between 1 and 6 answers right by guessing is 0.9104
Probability of getting between 1 and 8 answers right by guessing is 0.9825
Probability of getting between 4 and 4 answers right by guessing is 0.2252
</pre>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.using_binomial_distribution_moments"></a><h5>
<a name="id1030066"></a>
<a class="link" href="binomial_quiz_example.html#math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.using_binomial_distribution_moments">Using
Binomial distribution moments</a>
</h5>
<p>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.using_binomial_distribution_moments"></a>
</p>
<h5>
<a name="id1028225"></a>
<a class="link" href="binomial_quiz_example.html#math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.using_binomial_distribution_moments">Using
Binomial distribution moments</a>
</h5>
Using moments of the distribution, we can say more about the spread
of results from guessing.
</p>
<p>
</p>
<p>
Using moments of the distribution, we can say more about the spread
of results from guessing.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"By guessing, on average, one can expect to get "</span> <span class="special">&lt;&lt;</span> <span class="identifier">mean</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" correct answers."</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Standard deviation is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">standard_deviation</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -513,33 +385,23 @@ Probability of getting between 4 and 4 answers right by guessing is 0.2252
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Mode (the most frequent) is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">mode</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Skewness is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">skewness</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">By guessing, on average, one can expect to get 4 correct answers.
Standard deviation is 1.732
So about 2/3 will lie within 1 standard deviation and get between 3 and 5 correct.
Mode (the most frequent) is 4
Skewness is 0.2887
</pre>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.quantiles"></a><h5>
<a name="id1031827"></a>
<a class="link" href="binomial_quiz_example.html#math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.quantiles">Quantiles</a>
</h5>
<p>
<a name="math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.quantiles"></a>
</p>
<h5>
<a name="id1029850"></a>
<a class="link" href="binomial_quiz_example.html#math_toolkit.dist.stat_tut.weg.binom_eg.binomial_quiz_example.quantiles">Quantiles</a>
</h5>
The quantiles (percentiles or percentage points) for a few probability
levels:
</p>
<p>
</p>
<p>
The quantiles (percentiles or percentage points) for a few probability
levels:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quartiles "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0.25</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" to "</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">quiz</span><span class="special">,</span> <span class="number">0.25</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Quartiles
@ -557,16 +419,11 @@ Skewness is 0.2887
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If guessing then percentiles 1 to 99% will get "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0.01</span><span class="special">)</span>
<span class="special">&lt;&lt;</span> <span class="string">" to "</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">quiz</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="string">" right."</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Notice that these output integral values because the default policy
is <code class="computeroutput"><span class="identifier">integer_round_outwards</span></code>.
</p>
<p>
</p>
Notice that these output integral values because the default policy
is <code class="computeroutput"><span class="identifier">integer_round_outwards</span></code>.
</p>
<pre class="programlisting">Quartiles 2 to 5
1 standard deviation 2 to 5
Deciles 1 to 6
@ -575,59 +432,34 @@ Deciles 1 to 6
2 to 98% 0 to 8
</pre>
<p>
</p>
Quantiles values are controlled by the <a class="link" href="../../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">discrete
quantile policy</a> chosen. The default is <code class="computeroutput"><span class="identifier">integer_round_outwards</span></code>,
so the lower quantile is rounded down, and the upper quantile is rounded
up.
</p>
<p>
Quantiles values are controlled by the <a class="link" href="../../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">discrete
quantile policy</a> chosen. The default is <code class="computeroutput"><span class="identifier">integer_round_outwards</span></code>,
so the lower quantile is rounded down, and the upper quantile is
rounded up.
</p>
But we might believe that the real values tell us a little more - see
<a class="link" href="../../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Discrete Quantile Policy</a>.
</p>
<p>
</p>
<p>
But we might believe that the real values tell us a little more -
see <a class="link" href="../../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding
Discrete Quantile Policy</a>.
</p>
<p>
</p>
<p>
We could control the policy for <span class="bold"><strong>all</strong></span>
distributions by
</p>
<p>
</p>
We could control the policy for <span class="bold"><strong>all</strong></span>
distributions by
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DISCRETE_QUANTILE_POLICY</span> <span class="identifier">real</span>
<span class="identifier">at</span> <span class="identifier">the</span> <span class="identifier">head</span> <span class="identifier">of</span> <span class="identifier">the</span> <span class="identifier">program</span> <span class="identifier">would</span> <span class="identifier">make</span> <span class="keyword">this</span> <span class="identifier">policy</span> <span class="identifier">apply</span>
</pre>
<p>
</p>
to this <span class="bold"><strong>one, and only</strong></span>, translation
unit.
</p>
<p>
#define BOOST_MATH_DISCRETE_QUANTILE_POLICY real
</p>
Or we can now create a (typedef for) policy that has discrete quantiles
real (here avoiding any 'using namespaces ...' statements):
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">at</span> <span class="identifier">the</span> <span class="identifier">head</span> <span class="identifier">of</span> <span class="identifier">the</span> <span class="identifier">program</span> <span class="identifier">would</span> <span class="identifier">make</span> <span class="keyword">this</span> <span class="identifier">policy</span> <span class="identifier">apply</span>
</pre>
<p>
</p>
<p>
at the head of the program would make this policy apply to this
<span class="bold"><strong>one, and only</strong></span>, translation unit.
</p>
<p>
</p>
<p>
Or we can now create a (typedef for) policy that has discrete quantiles
real (here avoiding any 'using namespaces ...' statements):
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">policy</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">discrete_quantile</span><span class="special">;</span>
@ -635,51 +467,39 @@ Deciles 1 to 6
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">integer_round_outwards</span><span class="special">;</span> <span class="comment">// Default.
</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">policy</span><span class="special">&lt;</span><span class="identifier">discrete_quantile</span><span class="special">&lt;</span><span class="identifier">real</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">real_quantile_policy</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Add a custom binomial distribution called
Add a custom binomial distribution called
</p>
<pre class="programlisting"><span class="identifier">real_quantile_binomial</span></pre>
<p>
that uses
that uses
</p>
<pre class="programlisting"><span class="identifier">real_quantile_policy</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">binomial_distribution</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">real_quantile_policy</span><span class="special">&gt;</span> <span class="identifier">real_quantile_binomial</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Construct an object of this custom distribution:
</p>
<p>
Construct an object of this custom distribution:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">real_quantile_binomial</span> <span class="identifier">quiz_real</span><span class="special">(</span><span class="identifier">questions</span><span class="special">,</span> <span class="identifier">success_fraction</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
And use this to show some quantiles - that now have real rather than
integer values.
</p>
<p>
And use this to show some quantiles - that now have real rather than
integer values.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quartiles "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0.25</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" to "</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">quiz_real</span><span class="special">,</span> <span class="number">0.25</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Quartiles 2 to 4.6212
@ -697,10 +517,7 @@ Deciles 1 to 6
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If guessing, then percentiles 1 to 99% will get "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">quiz_real</span><span class="special">,</span> <span class="number">0.01</span><span class="special">)</span>
<span class="special">&lt;&lt;</span> <span class="string">" to "</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">quiz_real</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="string">" right."</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Real Quantiles
Quartiles 2 to 4.621
1 standard deviation 2.665 to 4.194
@ -710,8 +527,6 @@ Deciles 1.349 to 5.758
2 to 98% 0.3131 to 7.252
If guessing then percentiles 1 to 99% will get 0 to 7.788 right.
</pre>
<p>
</p>
<p>
See <a href="../../../../../../../../example/binomial_quiz_example.cpp" target="_top">binomial_quiz_example.cpp</a>
for full source code and output.

View File

@ -17,17 +17,16 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.cs_eg"></a><a class="link" href="cs_eg.html" title="Chi Squared Distribution Examples"> Chi Squared
<a name="math_toolkit.dist.stat_tut.weg.cs_eg"></a><a class="link" href="cs_eg.html" title="Chi Squared Distribution Examples">Chi Squared
Distribution Examples</a>
</h5></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="cs_eg/chi_sq_intervals.html">
Confidence Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="cs_eg/chi_sq_test.html">
Chi-Square Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="cs_eg/chi_sq_size.html">
Estimating the Required Sample Sizes for a Chi-Square Test for the Standard
Deviation</a></span></dt>
<dt><span class="section"><a href="cs_eg/chi_sq_intervals.html">Confidence
Intervals on the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="cs_eg/chi_sq_test.html">Chi-Square
Test for the Standard Deviation</a></span></dt>
<dt><span class="section"><a href="cs_eg/chi_sq_size.html">Estimating
the Required Sample Sizes for a Chi-Square Test for the Standard Deviation</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_intervals"></a><a class="link" href="chi_sq_intervals.html" title="Confidence Intervals on the Standard Deviation">
Confidence Intervals on the Standard Deviation</a>
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_intervals"></a><a class="link" href="chi_sq_intervals.html" title="Confidence Intervals on the Standard Deviation">Confidence
Intervals on the Standard Deviation</a>
</h6></div></div></div>
<p>
Once you have calculated the standard deviation for your data, a legitimate
@ -132,7 +132,7 @@ _____________________________________________
is between 0.00551 and 0.00729.
</p>
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_intervals.confidence_intervals_as_a_function_of_the_number_of_observations"></a><h5>
<a name="id1012423"></a>
<a name="id1014220"></a>
<a class="link" href="chi_sq_intervals.html#math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_intervals.confidence_intervals_as_a_function_of_the_number_of_observations">Confidence
intervals as a function of the number of observations</a>
</h5>

View File

@ -17,9 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_size"></a><a class="link" href="chi_sq_size.html" title="Estimating the Required Sample Sizes for a Chi-Square Test for the Standard Deviation">
Estimating the Required Sample Sizes for a Chi-Square Test for the Standard
Deviation</a>
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_size"></a><a class="link" href="chi_sq_size.html" title="Estimating the Required Sample Sizes for a Chi-Square Test for the Standard Deviation">Estimating
the Required Sample Sizes for a Chi-Square Test for the Standard Deviation</a>
</h6></div></div></div>
<p>
Suppose we conduct a Chi Squared test for standard deviation and the

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_test"></a><a class="link" href="chi_sq_test.html" title="Chi-Square Test for the Standard Deviation">
Chi-Square Test for the Standard Deviation</a>
<a name="math_toolkit.dist.stat_tut.weg.cs_eg.chi_sq_test"></a><a class="link" href="chi_sq_test.html" title="Chi-Square Test for the Standard Deviation">Chi-Square
Test for the Standard Deviation</a>
</h6></div></div></div>
<p>
We use this test to determine whether the standard deviation of a sample

View File

@ -17,34 +17,28 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.dist_construct_eg"></a><a class="link" href="dist_construct_eg.html" title="Distribution Construction Example">
Distribution Construction Example</a>
<a name="math_toolkit.dist.stat_tut.weg.dist_construct_eg"></a><a class="link" href="dist_construct_eg.html" title="Distribution Construction Example">Distribution
Construction Example</a>
</h5></div></div></div>
<p>
See <a href="../../../../../../../example/distribution_construction.cpp" target="_top">distribution_construction.cpp</a>
for full source code.
</p>
<p>
</p>
The structure of distributions is rather different from some other statistical
libraries, for example in less object-oriented language like FORTRAN
and C, that provide a few arguments to each free function. This library
provides each distribution as a template C++ class. A distribution is
constructed with a few arguments, and then member and non-member functions
are used to find values of the distribution, often a function of a random
variate.
</p>
<p>
The structure of distributions is rather different from some other
statistical libraries, for example in less object-oriented language
like FORTRAN and C, that provide a few arguments to each free function.
This library provides each distribution as a template C++ class. A
distribution is constructed with a few arguments, and then member and
non-member functions are used to find values of the distribution, often
a function of a random variate.
</p>
First we need some includes to access the negative binomial distribution
(and the binomial, beta and gamma too).
</p>
<p>
</p>
<p>
First we need some includes to access the negative binomial distribution
(and the binomial, beta and gamma too).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">negative_binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for negative_binomial_distribution
</span> <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial_distribution</span><span class="special">;</span> <span class="comment">// default type is double.
@ -54,239 +48,166 @@
</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">gamma</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for gamma_distribution.
</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for normal_distribution.</span></pre>
<p>
</p>
</p>
<p>
</p>
Several examples of constructing distributions follow:
</p>
<p>
Several examples of constructing distributions follow:
</p>
<p>
</p>
<p>
First, a negative binomial distribution with 8 successes and a success
fraction 0.25, 25% or 1 in 4, is constructed like this:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">mydist0</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span></pre>
<p>
</p>
<p>
</p>
<p>
But this is inconveniently long, so by writing
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
<p>
or
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial_distribution</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
<p>
we can reduce typing.
</p>
<p>
</p>
<p>
Since the vast majority of applications use will be using double precision,
the template argument to the distribution (RealType) defaults to type
double, so we can also write:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">mydist9</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span> <span class="comment">// Uses default RealType = double.</span></pre>
<p>
</p>
<p>
</p>
<p>
But the name "negative_binomial_distribution" is still inconveniently
long, so for most distributions, a convenience typedef is provided,
for example:
</p>
First, a negative binomial distribution with 8 successes and a success
fraction 0.25, 25% or 1 in 4, is constructed like this:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">mydist0</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span></pre>
<p>
</p>
<p>
But this is inconveniently long, so by writing
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">;</span></pre>
<p>
</p>
<p>
or
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial_distribution</span><span class="special">;</span></pre>
<p>
</p>
<p>
we can reduce typing.
</p>
<p>
Since the vast majority of applications use will be using double precision,
the template argument to the distribution (RealType) defaults to type
double, so we can also write:
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">mydist9</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span> <span class="comment">// Uses default RealType = double.</span></pre>
<p>
</p>
<p>
But the name "negative_binomial_distribution" is still inconveniently
long, so for most distributions, a convenience typedef is provided, for
example:
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">negative_binomial</span><span class="special">;</span> <span class="comment">// Reserved name of type double.
</span></pre>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>
This convenience typedef is <span class="emphasis"><em>not</em></span> provided if
a clash would occur with the name of a function: currently only "beta"
and "gamma" fall into this category.
</p></td></tr>
This convenience typedef is <span class="emphasis"><em>not</em></span> provided if a
clash would occur with the name of a function: currently only "beta"
and "gamma" fall into this category.
</p></td></tr>
</table></div>
<p>
</p>
So, after a using statement,
</p>
<p>
So, after a using statement,
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
we have a convenient typedef to <code class="computeroutput"><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span></code>:
</p>
<p>
we have a convenient typedef to <code class="computeroutput"><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span></code>:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial</span> <span class="identifier">mydist</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
Some more examples using the convenience typedef:
</p>
<p>
Some more examples using the convenience typedef:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial</span> <span class="identifier">mydist10</span><span class="special">(</span><span class="number">5.</span><span class="special">,</span> <span class="number">0.4</span><span class="special">);</span> <span class="comment">// Both arguments double.</span></pre>
<p>
</p>
</p>
<p>
</p>
And automatic conversion takes place, so you can use integers and floats:
</p>
<p>
And automatic conversion takes place, so you can use integers and floats:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial</span> <span class="identifier">mydist11</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="number">0.4</span><span class="special">);</span> <span class="comment">// Using provided typedef double, int and double arguments.</span></pre>
<p>
</p>
</p>
<p>
</p>
This is probably the most common usage.
</p>
<p>
This is probably the most common usage.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial</span> <span class="identifier">mydist12</span><span class="special">(</span><span class="number">5.</span><span class="special">,</span> <span class="number">0.4F</span><span class="special">);</span> <span class="comment">// Double and float arguments.
</span><span class="identifier">negative_binomial</span> <span class="identifier">mydist13</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span> <span class="comment">// Both arguments integer.</span></pre>
<p>
</p>
</p>
<p>
</p>
Similarly for most other distributions like the binomial.
</p>
<p>
Similarly for most other distributions like the binomial.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">binomial</span> <span class="identifier">mybinomial</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">);</span> <span class="comment">// is more concise than
</span><span class="identifier">binomial_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">mybinomd1</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
For cases when the typdef distribution name would clash with a math
special function (currently only beta and gamma) the typedef is deliberately
not provided, and the longer version of the name must be used. For
example do not use:
</p>
<p>
</p>
For cases when the typdef distribution name would clash with a math special
function (currently only beta and gamma) the typedef is deliberately
not provided, and the longer version of the name must be used. For example
do not use:
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">beta</span><span class="special">;</span>
<span class="identifier">beta</span> <span class="identifier">mybetad0</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">);</span> <span class="comment">// Error beta is a math FUNCTION!
</span></pre>
<p>
</p>
<p>
Which produces the error messages:
</p>
<p>
</p>
Which produces the error messages:
</p>
<pre class="programlisting">error C2146: syntax error : missing ';' before identifier 'mybetad0'
warning C4551: function call missing argument list
error C3861: 'mybetad0': identifier not found
</pre>
<p>
</p>
Instead you should use:
</p>
<p>
Instead you should use:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">beta_distribution</span><span class="special">;</span>
<span class="identifier">beta_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">mybetad1</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
or for the gamma distribution:
</p>
<p>
or for the gamma distribution:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">gamma_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">mygammad1</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
We can, of course, still provide the type explicitly thus:
</p>
<p>
We can, of course, still provide the type explicitly thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// Explicit double precision:
</span><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">mydist1</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span>
@ -309,65 +230,40 @@ error C3861: 'mybetad0': identifier not found
<span class="comment">// Explicit long double precision:
</span><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">mydist7</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
And if you have your own RealType called MyFPType, for example NTL
RR (an arbitrary precision type), then we can write:
</p>
<p>
</p>
And if you have your own RealType called MyFPType, for example NTL RR
(an arbitrary precision type), then we can write:
</p>
<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">MyFPType</span><span class="special">&gt;</span> <span class="identifier">mydist6</span><span class="special">(</span><span class="number">8</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span> <span class="comment">// Integer arguments -&gt; MyFPType.
</span></pre>
<a name="math_toolkit.dist.stat_tut.weg.dist_construct_eg.default_arguments_to_distribution_constructors_"></a><h6>
<a name="id1003481"></a>
<a class="link" href="dist_construct_eg.html#math_toolkit.dist.stat_tut.weg.dist_construct_eg.default_arguments_to_distribution_constructors_">Default
arguments to distribution constructors.</a>
</h6>
<p>
<a name="math_toolkit.dist.stat_tut.weg.dist_construct_eg.default_arguments_to_distribution_constructors_"></a>
</p>
<h6>
<a name="id1002149"></a>
<a class="link" href="dist_construct_eg.html#math_toolkit.dist.stat_tut.weg.dist_construct_eg.default_arguments_to_distribution_constructors_">Default
arguments to distribution constructors.</a>
</h6>
<p>
</p>
<p>
Note that default constructor arguments are only provided for some
distributions. So if you wrongly assume a default argument you will
get an error message, for example:
</p>
<p>
</p>
Note that default constructor arguments are only provided for some distributions.
So if you wrongly assume a default argument you will get an error message,
for example:
</p>
<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special">&lt;&gt;</span> <span class="identifier">mydist8</span><span class="special">;</span>
</pre>
<p>
</p>
<pre class="programlisting">error C2512 no appropriate default constructor available.</pre>
<p>
</p>
<p>
No default constructors are provided for the negative binomial, because
it is difficult to chose any sensible default values for this distribution.
For other distributions, like the normal distribution, it is obviously
very useful to provide 'standard' defaults for the mean and standard
deviation thus:
</p>
<p>
</p>
No default constructors are provided for the negative binomial, because
it is difficult to chose any sensible default values for this distribution.
For other distributions, like the normal distribution, it is obviously
very useful to provide 'standard' defaults for the mean and standard
deviation thus:
</p>
<pre class="programlisting"><span class="identifier">normal_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">mean</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">sd</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
</pre>
<p>
</p>
So in this case we can write:
</p>
<p>
So in this case we can write:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="keyword">using</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="special">;</span>
@ -378,13 +274,9 @@ error C3861: 'mybetad0': identifier not found
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span> <span class="comment">// int main()</span></pre>
<p>
</p>
<p>
</p>
<p>
There is no useful output from this program, of course.
</p>
</p>
<p>
There is no useful output from this program, of course.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.error_eg"></a><a class="link" href="error_eg.html" title="Error Handling Example"> Error Handling
<a name="math_toolkit.dist.stat_tut.weg.error_eg"></a><a class="link" href="error_eg.html" title="Error Handling Example">Error Handling
Example</a>
</h5></div></div></div>
<p>
@ -36,68 +36,43 @@
the policy.
</p>
<p>
</p>
The following example demonstrates the effect of setting the macro BOOST_MATH_DOMAIN_ERROR_POLICY
when an invalid argument is encountered. For the purposes of this example,
we'll pass a negative degrees of freedom parameter to the student's t
distribution.
</p>
<p>
The following example demonstrates the effect of setting the macro
BOOST_MATH_DOMAIN_ERROR_POLICY when an invalid argument is encountered.
For the purposes of this example, we'll pass a negative degrees of
freedom parameter to the student's t distribution.
</p>
<p>
</p>
<p>
Since we know that this is a single file program we could just add:
</p>
<p>
</p>
Since we know that this is a single file program we could just add:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DOMAIN_ERROR_POLICY</span> <span class="identifier">ignore_error</span>
</pre>
<p>
</p>
<p>
to the top of the source file to change the default policy to one that
simply returns a NaN when a domain error occurs. Alternatively we could
use:
</p>
<p>
</p>
to the top of the source file to change the default policy to one that
simply returns a NaN when a domain error occurs. Alternatively we could
use:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DOMAIN_ERROR_POLICY</span> <span class="identifier">errno_on_error</span>
</pre>
<p>
</p>
To ensure the <code class="computeroutput"><span class="special">::</span><span class="identifier">errno</span></code>
is set when a domain error occurs as well as returning a NaN.
</p>
<p>
To ensure the <code class="computeroutput"><span class="special">::</span><span class="identifier">errno</span></code>
is set when a domain error occurs as well as returning a NaN.
</p>
<p>
</p>
<p>
This is safe provided the program consists of a single translation
unit <span class="emphasis"><em>and</em></span> we place the define <span class="emphasis"><em>before</em></span>
any #includes. Note that should we add the define after the includes
then it will have no effect! A warning such as:
</p>
<p>
</p>
This is safe provided the program consists of a single translation unit
<span class="emphasis"><em>and</em></span> we place the define <span class="emphasis"><em>before</em></span>
any #includes. Note that should we add the define after the includes
then it will have no effect! A warning such as:
</p>
<pre class="programlisting">warning C4005: 'BOOST_MATH_OVERFLOW_ERROR_POLICY' : macro redefinition</pre>
<p>
</p>
is a certain sign that it will <span class="emphasis"><em>not</em></span> have the desired
effect.
</p>
<p>
is a certain sign that it will <span class="emphasis"><em>not</em></span> have the desired
effect.
</p>
We'll begin our sample program with the needed includes:
</p>
<p>
</p>
<p>
We'll begin our sample program with the needed includes:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// Boost
</span><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">students_t</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
@ -111,18 +86,14 @@
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">stdexcept</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Next we'll define the program's main() to call the student's t distribution
with an invalid degrees of freedom parameter, the program is set up to
handle either an exception or a NaN:
</p>
<p>
Next we'll define the program's main() to call the student's t distribution
with an invalid degrees of freedom parameter, the program is set up
to handle either an exception or a NaN:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
@ -156,16 +127,11 @@
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span> <span class="comment">// int main()</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Here's what the program output looks like with a default build (one
that does throw exceptions):
</p>
<p>
</p>
Here's what the program output looks like with a default build (one that
does throw exceptions):
</p>
<pre class="programlisting">Example error handling using Student's t function.
BOOST_MATH_DOMAIN_ERROR_POLICY is set to: throw_on_error
@ -174,53 +140,31 @@ Message from thrown exception was:
Degrees of freedom argument is -1, but must be &gt; 0 !
</pre>
<p>
</p>
<p>
Alternatively let's build with:
</p>
<p>
</p>
Alternatively let's build with:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DOMAIN_ERROR_POLICY</span> <span class="identifier">ignore_error</span>
</pre>
<p>
</p>
<p>
Now the program output is:
</p>
<p>
</p>
Now the program output is:
</p>
<pre class="programlisting">Example error handling using Student's t function.
BOOST_MATH_DOMAIN_ERROR_POLICY is set to: ignore_error
cdf returned a NaN!
errno is set to: 0
</pre>
<p>
</p>
<p>
And finally let's build with:
</p>
<p>
</p>
And finally let's build with:
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DOMAIN_ERROR_POLICY</span> <span class="identifier">errno_on_error</span>
</pre>
<p>
</p>
<p>
Which gives the output:
</p>
<p>
</p>
Which gives the output:
</p>
<pre class="programlisting">Example error handling using Student's t function.
BOOST_MATH_DOMAIN_ERROR_POLICY is set to: errno_on_error
cdf returned a NaN!
errno is set to: 33
</pre>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../images/caution.png"></td>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.f_eg"></a><a class="link" href="f_eg.html" title="F Distribution Examples"> F Distribution
<a name="math_toolkit.dist.stat_tut.weg.f_eg"></a><a class="link" href="f_eg.html" title="F Distribution Examples">F Distribution
Examples</a>
</h5></div></div></div>
<p>

View File

@ -17,16 +17,16 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.find_eg"></a><a class="link" href="find_eg.html" title="Find Location and Scale Examples"> Find Location
<a name="math_toolkit.dist.stat_tut.weg.find_eg"></a><a class="link" href="find_eg.html" title="Find Location and Scale Examples">Find Location
and Scale Examples</a>
</h5></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="find_eg/find_location_eg.html">
Find Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="find_eg/find_scale_eg.html">
Find Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="find_eg/find_mean_and_sd_eg.html">
Find mean and standard deviation example</a></span></dt>
<dt><span class="section"><a href="find_eg/find_location_eg.html">Find
Location (Mean) Example</a></span></dt>
<dt><span class="section"><a href="find_eg/find_scale_eg.html">Find
Scale (Standard Deviation) Example</a></span></dt>
<dt><span class="section"><a href="find_eg/find_mean_and_sd_eg.html">Find
mean and standard deviation example</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,19 +17,15 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_location_eg"></a><a class="link" href="find_location_eg.html" title="Find Location (Mean) Example">
Find Location (Mean) Example</a>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_location_eg"></a><a class="link" href="find_location_eg.html" title="Find Location (Mean) Example">Find
Location (Mean) Example</a>
</h6></div></div></div>
<p>
</p>
First we need some includes to access the normal distribution, the
algorithms to find location (and some std output of course).
</p>
<p>
First we need some includes to access the normal distribution, the
algorithms to find location (and some std output of course).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for normal_distribution
</span> <span class="keyword">using</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="special">;</span> <span class="comment">// typedef provides default type is double.
@ -50,34 +46,26 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<p>
</p>
For this example, we will use the standard normal distribution, with
mean (location) zero and standard deviation (scale) unity. This is
also the default for this implementation.
</p>
<p>
For this example, we will use the standard normal distribution, with
mean (location) zero and standard deviation (scale) unity. This is
also the default for this implementation.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">N01</span><span class="special">;</span> <span class="comment">// Default 'standard' normal distribution with zero mean and
</span><span class="keyword">double</span> <span class="identifier">sd</span> <span class="special">=</span> <span class="number">1.</span><span class="special">;</span> <span class="comment">// normal default standard deviation is 1.</span></pre>
<p>
</p>
</p>
<p>
</p>
Suppose we want to find a different normal distribution whose mean
is shifted so that only fraction p (here 0.001 or 0.1%) are below a
certain chosen limit (here -2, two standard deviations).
</p>
<p>
Suppose we want to find a different normal distribution whose mean
is shifted so that only fraction p (here 0.001 or 0.1%) are below
a certain chosen limit (here -2, two standard deviations).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">z</span> <span class="special">=</span> <span class="special">-</span><span class="number">2.</span><span class="special">;</span> <span class="comment">// z to give prob p
</span><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">0.001</span><span class="special">;</span> <span class="comment">// only 0.1% below z
@ -91,66 +79,44 @@
<span class="special">&lt;&lt;</span> <span class="string">", has "</span> <span class="special">&lt;&lt;</span> <span class="string">"fraction &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span>
<span class="special">&lt;&lt;</span> <span class="string">", p = "</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">N01</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Note: uses complement.</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Normal distribution with mean = 0, standard deviation 1, has fraction &lt;= -2, p = 0.0227501
Normal distribution with mean = 0, standard deviation 1, has fraction &gt; -2, p = 0.97725
</pre>
<p>
</p>
We can now use ''find_location'' to give a new offset mean.
</p>
<p>
We can now use ''find_location'' to give a new offset mean.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">sd</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"offset location (mean) = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">l</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
that outputs:
</p>
<p>
</p>
that outputs:
</p>
<pre class="programlisting">offset location (mean) = 1.09023
</pre>
<p>
</p>
showing that we need to shift the mean just over one standard deviation
from its previous value of zero.
</p>
<p>
showing that we need to shift the mean just over one standard deviation
from its previous value of zero.
</p>
Then we can check that we have achieved our objective by constructing
a new distribution with the offset mean (but same standard deviation):
</p>
<p>
</p>
<p>
Then we can check that we have achieved our objective by constructing
a new distribution with the offset mean (but same standard deviation):
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">np001pc</span><span class="special">(</span><span class="identifier">l</span><span class="special">,</span> <span class="identifier">sd</span><span class="special">);</span> <span class="comment">// Same standard_deviation (scale) but with mean (location) shifted.</span></pre>
<p>
</p>
</p>
<p>
</p>
And re-calculating the fraction below our chosen limit.
</p>
<p>
And re-calculating the fraction below our chosen limit.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Normal distribution with mean = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">l</span>
<span class="special">&lt;&lt;</span> <span class="string">" has "</span> <span class="special">&lt;&lt;</span> <span class="string">"fraction &lt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span>
@ -159,53 +125,37 @@ Normal distribution with mean = 0, standard deviation 1, has fraction &gt; -2, p
<span class="special">&lt;&lt;</span> <span class="string">" has "</span> <span class="special">&lt;&lt;</span> <span class="string">"fraction &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span>
<span class="special">&lt;&lt;</span> <span class="string">", p = "</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">np001pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Normal distribution with mean = 1.09023 has fraction &lt;= -2, p = 0.001
Normal distribution with mean = 1.09023 has fraction &gt; -2, p = 0.999
</pre>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_location_eg.controlling_error_handling_from_find_location"></a><h5>
<a name="id1065940"></a>
<a class="link" href="find_location_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_location_eg.controlling_error_handling_from_find_location">Controlling
Error Handling from find_location</a>
</h5>
<p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_location_eg.controlling_error_handling_from_find_location"></a>
</p>
<h5>
<a name="id1065622"></a>
<a class="link" href="find_location_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_location_eg.controlling_error_handling_from_find_location">Controlling
Error Handling from find_location</a>
</h5>
We can also control the policy for handling various errors. For example,
we can define a new (possibly unwise) policy to ignore domain errors
('bad' arguments).
</p>
<p>
</p>
Unless we are using the boost::math namespace, we will need:
</p>
<p>
We can also control the policy for handling various errors. For example,
we can define a new (possibly unwise) policy to ignore domain errors
('bad' arguments).
</p>
<p>
</p>
<p>
Unless we are using the boost::math namespace, we will need:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">policy</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">domain_error</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">ignore_error</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Using a typedef is often convenient, especially if it is re-used, although
it is not required, as the various examples below show.
</p>
<p>
Using a typedef is often convenient, especially if it is re-used,
although it is not required, as the various examples below show.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">policy</span><span class="special">&lt;</span><span class="identifier">domain_error</span><span class="special">&lt;</span><span class="identifier">ignore_error</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">ignore_domain_policy</span><span class="special">;</span>
<span class="comment">// find_location with new policy, using typedef.
@ -217,19 +167,15 @@ Normal distribution with mean = 1.09023 has fraction &gt; -2, p = 0.999
<span class="comment">// A new policy, ignoring domain errors, without using a typedef.
</span><span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">sd</span><span class="special">,</span> <span class="identifier">policy</span><span class="special">&lt;</span><span class="identifier">domain_error</span><span class="special">&lt;</span><span class="identifier">ignore_error</span><span class="special">&gt;</span> <span class="special">&gt;());</span></pre>
<p>
</p>
</p>
<p>
</p>
If we want to use a probability that is the <a class="link" href="../../overview.html#complements">complement
of our probability</a>, we should not even think of writing <code class="computeroutput"><span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="number">1</span> <span class="special">-</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">sd</span><span class="special">)</span></code>,
but, <a class="link" href="../../overview.html#why_complements">to avoid loss of accuracy</a>,
use the complement version.
</p>
<p>
If we want to use a probability that is the <a class="link" href="../../overview.html#complements">complement
of our probability</a>, we should not even think of writing <code class="computeroutput"><span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="number">1</span> <span class="special">-</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">sd</span><span class="special">)</span></code>,
but, <a class="link" href="../../overview.html#why_complements">to avoid loss of accuracy</a>,
use the complement version.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">z</span> <span class="special">=</span> <span class="number">2.</span><span class="special">;</span>
<span class="keyword">double</span> <span class="identifier">q</span> <span class="special">=</span> <span class="number">0.95</span><span class="special">;</span> <span class="comment">// = 1 - p; // complement.
@ -242,11 +188,11 @@ Normal distribution with mean = 1.09023 has fraction &gt; -2, p = 0.999
<span class="special">&lt;&lt;</span> <span class="string">"fraction &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</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">np95pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<p>
See <a href="../../../../../../../../example/find_location_example.cpp" target="_top">find_location_example.cpp</a>
for full source code: the program output looks like this:
</p>
for full source code: the program output looks like this:
</p>
<pre class="programlisting">Example: Find location (mean).
Normal distribution with mean = 0, standard deviation 1, has fraction &lt;= -2, p = 0.0227501
Normal distribution with mean = 0, standard deviation 1, has fraction &gt; -2, p = 0.97725
@ -256,8 +202,6 @@ Normal distribution with mean = 1.09023 has fraction &gt; -2, p = 0.999
Normal distribution with mean = 0.355146 has fraction &lt;= 2 = 0.95
Normal distribution with mean = 0.355146 has fraction &gt; 2 = 0.05
</pre>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,19 +17,15 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg"></a><a class="link" href="find_mean_and_sd_eg.html" title="Find mean and standard deviation example">
Find mean and standard deviation example</a>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg"></a><a class="link" href="find_mean_and_sd_eg.html" title="Find mean and standard deviation example">Find
mean and standard deviation example</a>
</h6></div></div></div>
<p>
</p>
First we need some includes to access the normal distribution, the
algorithms to find location and scale (and some std output of course).
</p>
<p>
First we need some includes to access the normal distribution, the
algorithms to find location and scale (and some std output of course).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for normal_distribution
</span> <span class="keyword">using</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="special">;</span> <span class="comment">// typedef provides default type is double.
@ -50,108 +46,78 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_find_location_and_find_scale_to_meet_dispensing_and_measurement_specifications"></a><h5>
<a name="id1071609"></a>
<a class="link" href="find_mean_and_sd_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_find_location_and_find_scale_to_meet_dispensing_and_measurement_specifications">Using
find_location and find_scale to meet dispensing and measurement specifications</a>
</h5>
<p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_find_location_and_find_scale_to_meet_dispensing_and_measurement_specifications"></a>
</p>
<h5>
<a name="id1070813"></a>
<a class="link" href="find_mean_and_sd_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_find_location_and_find_scale_to_meet_dispensing_and_measurement_specifications">Using
find_location and find_scale to meet dispensing and measurement specifications</a>
</h5>
Consider an example from K Krishnamoorthy, Handbook of Statistical
Distributions with Applications, ISBN 1-58488-635-8, (2006) p 126,
example 10.3.7.
</p>
<p>
</p>
"A machine is set to pack 3 kg of ground beef per pack. Over a
long period of time it is found that the average packed was 3 kg with
a standard deviation of 0.1 kg. Assume the packing is normally distributed."
</p>
<p>
Consider an example from K Krishnamoorthy, Handbook of Statistical
Distributions with Applications, ISBN 1-58488-635-8, (2006) p 126,
example 10.3.7.
</p>
We start by constructing a normal distribution with the given parameters:
</p>
<p>
</p>
<p>
"A machine is set to pack 3 kg of ground beef per pack. Over
a long period of time it is found that the average packed was 3 kg
with a standard deviation of 0.1 kg. Assume the packing is normally
distributed."
</p>
<p>
</p>
<p>
We start by constructing a normal distribution with the given parameters:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">mean</span> <span class="special">=</span> <span class="number">3.</span><span class="special">;</span> <span class="comment">// kg
</span><span class="keyword">double</span> <span class="identifier">standard_deviation</span> <span class="special">=</span> <span class="number">0.1</span><span class="special">;</span> <span class="comment">// kg
</span><span class="identifier">normal</span> <span class="identifier">packs</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
We can then find the fraction (or %) of packages that weigh more than
3.1 kg.
</p>
<p>
We can then find the fraction (or %) of packages that weigh more
than 3.1 kg.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">max_weight</span> <span class="special">=</span> <span class="number">3.1</span><span class="special">;</span> <span class="comment">// kg
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Percentage of packs &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">max_weight</span> <span class="special">&lt;&lt;</span> <span class="string">" is "</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">packs</span><span class="special">,</span> <span class="identifier">max_weight</span><span class="special">))</span> <span class="special">*</span> <span class="number">100.</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X &gt; 3.1)</span></pre>
<p>
</p>
</p>
<p>
</p>
We might want to ensure that 95% of packs are over a minimum weight
specification, then we want the value of the mean such that P(X &lt;
2.9) = 0.05.
</p>
<p>
We might want to ensure that 95% of packs are over a minimum weight
specification, then we want the value of the mean such that P(X &lt;
2.9) = 0.05.
</p>
Using the mean of 3 kg, we can estimate the fraction of packs that
fail to meet the specification of 2.9 kg.
</p>
<p>
</p>
<p>
Using the mean of 3 kg, we can estimate the fraction of packs that
fail to meet the specification of 2.9 kg.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">minimum_weight</span> <span class="special">=</span> <span class="number">2.9</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span><span class="string">"Fraction of packs &lt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">minimum_weight</span> <span class="special">&lt;&lt;</span> <span class="string">" with a mean of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">mean</span>
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">packs</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// fraction of packs &lt;= 2.9 with a mean of 3 is 0.841345</span></pre>
<p>
</p>
</p>
<p>
</p>
This is 0.84 - more than the target fraction of 0.95. If we want 95%
to be over the minimum weight, what should we set the mean weight to
be?
</p>
<p>
This is 0.84 - more than the target fraction of 0.95. If we want
95% to be over the minimum weight, what should we set the mean weight
to be?
</p>
Using the KK StatCalc program supplied with the book and the method
given on page 126 gives 3.06449.
</p>
<p>
</p>
We can confirm this by constructing a new distribution which we call
'xpacks' with a safety margin mean of 3.06449 thus:
</p>
<p>
Using the KK StatCalc program supplied with the book and the method
given on page 126 gives 3.06449.
</p>
<p>
</p>
<p>
We can confirm this by constructing a new distribution which we call
'xpacks' with a safety margin mean of 3.06449 thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">over_mean</span> <span class="special">=</span> <span class="number">3.06449</span><span class="special">;</span>
<span class="identifier">normal</span> <span class="identifier">xpacks</span><span class="special">(</span><span class="identifier">over_mean</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span>
@ -160,17 +126,13 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">xpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// fraction of packs &gt;= 2.9 with a mean of 3.06449 is 0.950005</span></pre>
<p>
</p>
</p>
<p>
</p>
Using this Math Toolkit, we can calculate the required mean directly
thus:
</p>
<p>
Using this Math Toolkit, we can calculate the required mean directly
thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">under_fraction</span> <span class="special">=</span> <span class="number">0.05</span><span class="special">;</span> <span class="comment">// so 95% are above the minimum weight mean - sd = 2.9
</span><span class="keyword">double</span> <span class="identifier">low_limit</span> <span class="special">=</span> <span class="identifier">standard_deviation</span><span class="special">;</span>
@ -184,94 +146,69 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">nominal_packs</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Setting the packer to 3.06449 will mean that fraction of packs &gt;= 2.9 is 0.95</span></pre>
<p>
</p>
</p>
<p>
</p>
This calculation is generalized as the free function called <a class="link" href="../../../dist_ref/dist_algorithms.html" title="Distribution Algorithms">find_location</a>.
</p>
<p>
This calculation is generalized as the free function called <a class="link" href="../../../dist_ref/dist_algorithms.html" title="Distribution Algorithms">find_location</a>.
</p>
To use this we will need to
</p>
<p>
</p>
<p>
To use this we will need to
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">find_location</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">find_location</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
and then use find_location function to find safe_mean, &amp; construct
a new normal distribution called 'goodpacks'.
</p>
<p>
and then use find_location function to find safe_mean, &amp; construct
a new normal distribution called 'goodpacks'.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">safe_mean</span> <span class="special">=</span> <span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="identifier">under_fraction</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span>
<span class="identifier">normal</span> <span class="identifier">good_packs</span><span class="special">(</span><span class="identifier">safe_mean</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
with the same confirmation as before:
</p>
<p>
with the same confirmation as before:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Setting the packer to "</span> <span class="special">&lt;&lt;</span> <span class="identifier">nominal_mean</span> <span class="special">&lt;&lt;</span> <span class="string">" will mean that "</span>
<span class="special">&lt;&lt;</span> <span class="string">"fraction of packs &gt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">minimum_weight</span>
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">good_packs</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Setting the packer to 3.06449 will mean that fraction of packs &gt;= 2.9 is 0.95</span></pre>
<p>
</p>
</p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_cauchy_lorentz_instead_of_normal_distribution"></a><h5>
<a name="id1072790"></a>
<a class="link" href="find_mean_and_sd_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_cauchy_lorentz_instead_of_normal_distribution">Using
Cauchy-Lorentz instead of normal distribution</a>
</h5>
<p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_cauchy_lorentz_instead_of_normal_distribution"></a>
</p>
<h5>
<a name="id1071994"></a>
<a class="link" href="find_mean_and_sd_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.using_cauchy_lorentz_instead_of_normal_distribution">Using
Cauchy-Lorentz instead of normal distribution</a>
</h5>
After examining the weight distribution of a large number of packs,
we might decide that, after all, the assumption of a normal distribution
is not really justified. We might find that the fit is better to a
<a class="link" href="../../../dist_ref/dists/cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy
Distribution</a>. This distribution has wider 'wings', so that whereas
most of the values are closer to the mean than the normal, there are
also more values than 'normal' that lie further from the mean than
the normal.
</p>
<p>
</p>
This might happen because a larger than normal lump of meat is either
included or excluded.
</p>
<p>
After examining the weight distribution of a large number of packs,
we might decide that, after all, the assumption of a normal distribution
is not really justified. We might find that the fit is better to
a <a class="link" href="../../../dist_ref/dists/cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy
Distribution</a>. This distribution has wider 'wings', so that
whereas most of the values are closer to the mean than the normal,
there are also more values than 'normal' that lie further from the
mean than the normal.
</p>
We first create a <a class="link" href="../../../dist_ref/dists/cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy
Distribution</a> with the original mean and standard deviation,
and estimate the fraction that lie below our minimum weight specification.
</p>
<p>
</p>
<p>
This might happen because a larger than normal lump of meat is either
included or excluded.
</p>
<p>
</p>
<p>
We first create a <a class="link" href="../../../dist_ref/dists/cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy
Distribution</a> with the original mean and standard deviation,
and estimate the fraction that lie below our minimum weight specification.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cauchy</span> <span class="identifier">cpacks</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Cauchy Setting the packer to "</span> <span class="special">&lt;&lt;</span> <span class="identifier">mean</span> <span class="special">&lt;&lt;</span> <span class="string">" will mean that "</span>
@ -279,39 +216,29 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">cpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Cauchy Setting the packer to 3 will mean that fraction of packs &gt;= 2.9 is 0.75</span></pre>
<p>
</p>
</p>
<p>
</p>
Note that far fewer of the packs meet the specification, only 75% instead
of 95%. Now we can repeat the find_location, using the cauchy distribution
as template parameter, in place of the normal used above.
</p>
<p>
Note that far fewer of the packs meet the specification, only 75%
instead of 95%. Now we can repeat the find_location, using the cauchy
distribution as template parameter, in place of the normal used above.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">lc</span> <span class="special">=</span> <span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">cauchy</span><span class="special">&gt;(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="identifier">under_fraction</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"find_location&lt;cauchy&gt;(minimum_weight, over fraction, standard_deviation); "</span> <span class="special">&lt;&lt;</span> <span class="identifier">lc</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// find_location&lt;cauchy&gt;(minimum_weight, over fraction, packs.standard_deviation()); 3.53138</span></pre>
<p>
</p>
</p>
<p>
</p>
Note that the safe_mean setting needs to be much higher, 3.53138 instead
of 3.06449, so we will make rather less profit.
</p>
<p>
Note that the safe_mean setting needs to be much higher, 3.53138
instead of 3.06449, so we will make rather less profit.
</p>
And again confirm that the fraction meeting specification is as expected.
</p>
<p>
</p>
<p>
And again confirm that the fraction meeting specification is as expected.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cauchy</span> <span class="identifier">goodcpacks</span><span class="special">(</span><span class="identifier">lc</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Cauchy Setting the packer to "</span> <span class="special">&lt;&lt;</span> <span class="identifier">lc</span> <span class="special">&lt;&lt;</span> <span class="string">" will mean that "</span>
@ -319,17 +246,13 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">goodcpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Cauchy Setting the packer to 3.53138 will mean that fraction of packs &gt;= 2.9 is 0.95</span></pre>
<p>
</p>
</p>
<p>
</p>
Finally we could estimate the effect of a much tighter specification,
that 99% of packs met the specification.
</p>
<p>
Finally we could estimate the effect of a much tighter specification,
that 99% of packs met the specification.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Cauchy Setting the packer to "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">find_location</span><span class="special">&lt;</span><span class="identifier">cauchy</span><span class="special">&gt;(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="number">0.99</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">)</span>
@ -337,114 +260,81 @@
<span class="special">&lt;&lt;</span> <span class="string">"fraction of packs &gt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">minimum_weight</span>
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">goodcpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Setting the packer to 3.13263 will mean that fraction of packs &gt;=
2.9 is 0.99, but will more than double the mean loss from 0.0644 to
0.133 kg per pack.
</p>
<p>
Setting the packer to 3.13263 will mean that fraction of packs &gt;=
2.9 is 0.99, but will more than double the mean loss from 0.0644
to 0.133 kg per pack.
</p>
Of course, this calculation is not limited to packs of meat, it applies
to dispensing anything, and it also applies to a 'virtual' material
like any measurement.
</p>
<p>
</p>
The only caveat is that the calculation assumes that the standard deviation
(scale) is known with a reasonably low uncertainty, something that
is not so easy to ensure in practice. And that the distribution is
well defined, <a class="link" href="../../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a> or <a class="link" href="../../../dist_ref/dists/cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy
Distribution</a>, or some other.
</p>
<p>
Of course, this calculation is not limited to packs of meat, it applies
to dispensing anything, and it also applies to a 'virtual' material
like any measurement.
</p>
If one is simply dispensing a very large number of packs, then it may
be feasible to measure the weight of hundreds or thousands of packs.
With a healthy 'degrees of freedom', the confidence intervals for the
standard deviation are not too wide, typically about + and - 10% for
hundreds of observations.
</p>
<p>
</p>
For other applications, where it is more difficult or expensive to
make many observations, the confidence intervals are depressingly wide.
</p>
<p>
The only caveat is that the calculation assumes that the standard
deviation (scale) is known with a reasonably low uncertainty, something
that is not so easy to ensure in practice. And that the distribution
is well defined, <a class="link" href="../../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a> or <a class="link" href="../../../dist_ref/dists/cauchy_dist.html" title="Cauchy-Lorentz Distribution">Cauchy
Distribution</a>, or some other.
</p>
See <a class="link" href="../cs_eg/chi_sq_intervals.html" title="Confidence Intervals on the Standard Deviation">Confidence
Intervals on the standard deviation</a> for a worked example <a href="../../../../../../../../example/chi_square_std_dev_test.cpp" target="_top">chi_square_std_dev_test.cpp</a>
of estimating these intervals.
</p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.changing_the_scale_or_standard_deviation"></a><h5>
<a name="id1073787"></a>
<a class="link" href="find_mean_and_sd_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.changing_the_scale_or_standard_deviation">Changing
the scale or standard deviation</a>
</h5>
<p>
</p>
Alternatively, we could invest in a better (more precise) packer (or
measuring device) with a lower standard deviation, or scale.
</p>
<p>
If one is simply dispensing a very large number of packs, then it
may be feasible to measure the weight of hundreds or thousands of
packs. With a healthy 'degrees of freedom', the confidence intervals
for the standard deviation are not too wide, typically about + and
- 10% for hundreds of observations.
</p>
This might cost more, but would reduce the amount we have to 'give
away' in order to meet the specification.
</p>
<p>
</p>
To estimate how much better (how much smaller standard deviation) it
would have to be, we need to get the 5% quantile to be located at the
under_weight limit, 2.9
</p>
<p>
For other applications, where it is more difficult or expensive to
make many observations, the confidence intervals are depressingly
wide.
</p>
<p>
</p>
<p>
See <a class="link" href="../cs_eg/chi_sq_intervals.html" title="Confidence Intervals on the Standard Deviation">Confidence
Intervals on the standard deviation</a> for a worked example
<a href="../../../../../../../../example/chi_square_std_dev_test.cpp" target="_top">chi_square_std_dev_test.cpp</a>
of estimating these intervals.
</p>
<p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.changing_the_scale_or_standard_deviation"></a>
</p>
<h5>
<a name="id1072718"></a>
<a class="link" href="find_mean_and_sd_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_mean_and_sd_eg.changing_the_scale_or_standard_deviation">Changing
the scale or standard deviation</a>
</h5>
<p>
</p>
<p>
Alternatively, we could invest in a better (more precise) packer
(or measuring device) with a lower standard deviation, or scale.
</p>
<p>
</p>
<p>
This might cost more, but would reduce the amount we have to 'give
away' in order to meet the specification.
</p>
<p>
</p>
<p>
To estimate how much better (how much smaller standard deviation)
it would have to be, we need to get the 5% quantile to be located
at the under_weight limit, 2.9
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">0.05</span><span class="special">;</span> <span class="comment">// wanted p th quantile.
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">packs</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span>
<span class="special">&lt;&lt;</span> <span class="string">", mean = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">", sd = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Quantile of 0.05 = 2.83551, mean = 3, sd = 0.1
</p>
<p>
Quantile of 0.05 = 2.83551, mean = 3, sd = 0.1
</p>
With the current packer (mean = 3, sd = 0.1), the 5% quantile is at
2.8551 kg, a little below our target of 2.9 kg. So we know that the
standard deviation is going to have to be smaller.
</p>
<p>
</p>
Let's start by guessing that it (now 0.1) needs to be halved, to a
standard deviation of 0.05 kg.
</p>
<p>
With the current packer (mean = 3, sd = 0.1), the 5% quantile is
at 2.8551 kg, a little below our target of 2.9 kg. So we know that
the standard deviation is going to have to be smaller.
</p>
<p>
</p>
<p>
Let's start by guessing that it (now 0.1) needs to be halved, to
a standard deviation of 0.05 kg.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">pack05</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="number">0.05</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">pack05</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span>
@ -456,20 +346,15 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">pack05</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation of 0.05 is 0.97725</span></pre>
<p>
</p>
</p>
<p>
</p>
So 0.05 was quite a good guess, but we are a little over the 2.9 target,
so the standard deviation could be a tiny bit more. So we could do
some more guessing to get closer, say by increasing standard deviation
to 0.06 kg, constructing another new distribution called pack06.
</p>
<p>
So 0.05 was quite a good guess, but we are a little over the 2.9
target, so the standard deviation could be a tiny bit more. So we
could do some more guessing to get closer, say by increasing standard
deviation to 0.06 kg, constructing another new distribution called
pack06.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">pack06</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="number">0.06</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">pack06</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span>
@ -481,46 +366,34 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">pack06</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation of 0.06 is 0.95221</span></pre>
<p>
</p>
</p>
<p>
</p>
Now we are getting really close, but to do the job properly, we might
need to use root finding method, for example the tools provided, and
used elsewhere, in the Math Toolkit, see <a class="link" href="../../../../toolkit/internals1/roots2.html" title="Root Finding Without Derivatives">Root
Finding Without Derivatives</a>.
</p>
<p>
Now we are getting really close, but to do the job properly, we might
need to use root finding method, for example the tools provided,
and used elsewhere, in the Math Toolkit, see <a class="link" href="../../../../toolkit/internals1/roots2.html" title="Root Finding Without Derivatives">Root
Finding Without Derivatives</a>.
</p>
But in this (normal) distribution case, we can and should be even smarter
and make a direct calculation.
</p>
<p>
</p>
Our required limit is minimum_weight = 2.9 kg, often called the random
variate z. For a standard normal distribution, then probability p =
N((minimum_weight - mean) / sd).
</p>
<p>
But in this (normal) distribution case, we can and should be even
smarter and make a direct calculation.
</p>
We want to find the standard deviation that would be required to meet
this limit, so that the p th quantile is located at z (minimum_weight).
In this case, the 0.05 (5%) quantile is at 2.9 kg pack weight, when
the mean is 3 kg, ensuring that 0.95 (95%) of packs are above the minimum
weight.
</p>
<p>
</p>
Rearranging, we can directly calculate the required standard deviation:
</p>
<p>
Our required limit is minimum_weight = 2.9 kg, often called the random
variate z. For a standard normal distribution, then probability p
= N((minimum_weight - mean) / sd).
</p>
<p>
</p>
<p>
We want to find the standard deviation that would be required to
meet this limit, so that the p th quantile is located at z (minimum_weight).
In this case, the 0.05 (5%) quantile is at 2.9 kg pack weight, when
the mean is 3 kg, ensuring that 0.95 (95%) of packs are above the
minimum weight.
</p>
<p>
</p>
<p>
Rearranging, we can directly calculate the required standard deviation:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">N01</span><span class="special">;</span> <span class="comment">// standard normal distribution with meamn zero and unit standard deviation.
</span><span class="identifier">p</span> <span class="special">=</span> <span class="number">0.05</span><span class="special">;</span>
@ -531,17 +404,13 @@
<span class="special">&lt;&lt;</span> <span class="identifier">minimum_weight</span> <span class="special">&lt;&lt;</span> <span class="string">", would need a standard deviation of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sd95</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// For the 0.05th quantile to be located at 2.9, would need a standard deviation of 0.0607957</span></pre>
<p>
</p>
</p>
<p>
</p>
We can now construct a new (normal) distribution pack95 for the 'better'
packer, and check that our distribution will meet the specification.
</p>
<p>
We can now construct a new (normal) distribution pack95 for the 'better'
packer, and check that our distribution will meet the specification.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">pack95</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="identifier">sd95</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span><span class="string">"Fraction of packs &gt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">minimum_weight</span> <span class="special">&lt;&lt;</span> <span class="string">" with a mean of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">mean</span>
@ -549,108 +418,75 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">pack95</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation of 0.0607957 is 0.95</span></pre>
<p>
</p>
</p>
<p>
</p>
This calculation is generalized in the free function find_scale, as
shown below, giving the same standard deviation.
</p>
<p>
This calculation is generalized in the free function find_scale,
as shown below, giving the same standard deviation.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">ss</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="identifier">under_fraction</span><span class="special">,</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">mean</span><span class="special">());</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"find_scale&lt;normal&gt;(minimum_weight, under_fraction, packs.mean()); "</span> <span class="special">&lt;&lt;</span> <span class="identifier">ss</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// find_scale&lt;normal&gt;(minimum_weight, under_fraction, packs.mean()); 0.0607957</span></pre>
<p>
</p>
</p>
<p>
</p>
If we had defined an over_fraction, or percentage that must pass specification
</p>
<p>
If we had defined an over_fraction, or percentage that must pass
specification
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">over_fraction</span> <span class="special">=</span> <span class="number">0.95</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
And (wrongly) written
</p>
<p>
</p>
And (wrongly) written
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">sso</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="identifier">over_fraction</span><span class="special">,</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">mean</span><span class="special">());</span>
</pre>
<p>
</p>
<p>
With the default policy, we would get a message like
</p>
<p>
</p>
With the default policy, we would get a message like
</p>
<pre class="programlisting">Message from thrown exception was:
Error in function boost::math::find_scale&lt;Dist, Policy&gt;(double, double, double, Policy):
Computed scale (-0.060795683191176959) is &lt;= 0! Was the complement intended?
</pre>
<p>
</p>
But this would return a <span class="bold"><strong>negative</strong></span> standard
deviation - obviously impossible. The probability should be 1 - over_fraction,
not over_fraction, thus:
</p>
<p>
But this would return a <span class="bold"><strong>negative</strong></span>
standard deviation - obviously impossible. The probability should
be 1 - over_fraction, not over_fraction, thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">ss1o</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="number">1</span> <span class="special">-</span> <span class="identifier">over_fraction</span><span class="special">,</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">mean</span><span class="special">());</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"find_scale&lt;normal&gt;(minimum_weight, under_fraction, packs.mean()); "</span> <span class="special">&lt;&lt;</span> <span class="identifier">ss1o</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// find_scale&lt;normal&gt;(minimum_weight, under_fraction, packs.mean()); 0.0607957</span></pre>
<p>
</p>
</p>
<p>
</p>
But notice that using '1 - over_fraction' - will lead to a <a class="link" href="../../overview.html#why_complements">loss
of accuracy, especially if over_fraction was close to unity.</a>
In this (very common) case, we should instead use the <a class="link" href="../../overview.html#complements">complements</a>,
giving the most accurate result.
</p>
<p>
But notice that using '1 - over_fraction' - will lead to a <a class="link" href="../../overview.html#why_complements">loss of accuracy, especially if over_fraction
was close to unity.</a> In this (very common) case, we should
instead use the <a class="link" href="../../overview.html#complements">complements</a>, giving
the most accurate result.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">ssc</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">minimum_weight</span><span class="special">,</span> <span class="identifier">over_fraction</span><span class="special">,</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()));</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"find_scale&lt;normal&gt;(complement(minimum_weight, over_fraction, packs.mean())); "</span> <span class="special">&lt;&lt;</span> <span class="identifier">ssc</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// find_scale&lt;normal&gt;(complement(minimum_weight, over_fraction, packs.mean())); 0.0607957</span></pre>
<p>
</p>
</p>
<p>
</p>
Note that our guess of 0.06 was close to the accurate value of 0.060795683191176959.
</p>
<p>
Note that our guess of 0.06 was close to the accurate value of 0.060795683191176959.
</p>
We can again confirm our prediction thus:
</p>
<p>
</p>
<p>
We can again confirm our prediction thus:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">pack95c</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="identifier">ssc</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span><span class="string">"Fraction of packs &gt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">minimum_weight</span> <span class="special">&lt;&lt;</span> <span class="string">" with a mean of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">mean</span>
@ -658,45 +494,31 @@
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">pack95c</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation of 0.0607957 is 0.95</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Notice that these two deceptively simple questions:
</p>
<p>
</p>
Notice that these two deceptively simple questions:
</p>
<div class="itemizedlist"><ul type="disc"><li>
Do we over-fill to make sure we meet a minimum specification
(or under-fill to avoid an overdose)?
</li></ul></div>
Do we over-fill to make sure we meet a minimum specification (or
under-fill to avoid an overdose)?
</li></ul></div>
<p>
</p>
<p>
and/or
</p>
<p>
</p>
and/or
</p>
<div class="itemizedlist"><ul type="disc"><li>
Do we measure better?
</li></ul></div>
Do we measure better?
</li></ul></div>
<p>
</p>
are actually extremely common.
</p>
<p>
are actually extremely common.
</p>
The weight of beef might be replaced by a measurement of more or less
anything, from drug tablet content, Apollo landing rocket firing, X-ray
treatment doses...
</p>
<p>
</p>
<p>
The weight of beef might be replaced by a measurement of more or
less anything, from drug tablet content, Apollo landing rocket firing,
X-ray treatment doses...
</p>
<p>
</p>
<p>
The scale can be variation in dispensing or uncertainty in measurement.
</p>
The scale can be variation in dispensing or uncertainty in measurement.
</p>
<p>
See <a href="../../../../../../../../example/find_mean_and_sd_normal.cpp" target="_top">find_mean_and_sd_normal.cpp</a>
for full source code &amp; appended program output.

View File

@ -17,20 +17,16 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_scale_eg"></a><a class="link" href="find_scale_eg.html" title="Find Scale (Standard Deviation) Example">
Find Scale (Standard Deviation) Example</a>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_scale_eg"></a><a class="link" href="find_scale_eg.html" title="Find Scale (Standard Deviation) Example">Find
Scale (Standard Deviation) Example</a>
</h6></div></div></div>
<p>
</p>
First we need some includes to access the <a class="link" href="../../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a>, the algorithms to find scale (and some std output
of course).
</p>
<p>
First we need some includes to access the <a class="link" href="../../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a>, the algorithms to find scale (and some std output
of course).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for normal_distribution
</span> <span class="keyword">using</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="special">;</span> <span class="comment">// typedef provides default type is double.
@ -47,35 +43,27 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<p>
</p>
For this example, we will use the standard <a class="link" href="../../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a>, with location (mean) zero and standard deviation
(scale) unity. Conveniently, this is also the default for this implementation's
constructor.
</p>
<p>
For this example, we will use the standard <a class="link" href="../../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a>, with location (mean) zero and standard deviation
(scale) unity. Conveniently, this is also the default for this implementation's
constructor.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">N01</span><span class="special">;</span> <span class="comment">// Default 'standard' normal distribution with zero mean
</span><span class="keyword">double</span> <span class="identifier">sd</span> <span class="special">=</span> <span class="number">1.</span><span class="special">;</span> <span class="comment">// and standard deviation is 1.</span></pre>
<p>
</p>
</p>
<p>
</p>
Suppose we want to find a different normal distribution with standard
deviation so that only fraction p (here 0.001 or 0.1%) are below a
certain chosen limit (here -2. standard deviations).
</p>
<p>
Suppose we want to find a different normal distribution with standard
deviation so that only fraction p (here 0.001 or 0.1%) are below
a certain chosen limit (here -2. standard deviations).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">z</span> <span class="special">=</span> <span class="special">-</span><span class="number">2.</span><span class="special">;</span> <span class="comment">// z to give prob p
</span><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">0.001</span><span class="special">;</span> <span class="comment">// only 0.1% below z = -2
@ -89,70 +77,46 @@
<span class="special">&lt;&lt;</span> <span class="string">", has "</span> <span class="special">&lt;&lt;</span> <span class="string">"fraction &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span>
<span class="special">&lt;&lt;</span> <span class="string">", p = "</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">N01</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Note: uses complement.</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Normal distribution with mean = 0 has fraction &lt;= -2, p = 0.0227501
Normal distribution with mean = 0 has fraction &gt; -2, p = 0.97725
</pre>
<p>
</p>
Noting that p = 0.02 instead of our target of 0.001, we can now use
<code class="computeroutput"><span class="identifier">find_scale</span></code> to give
a new standard deviation.
</p>
<p>
Noting that p = 0.02 instead of our target of 0.001, we can now use
<code class="computeroutput"><span class="identifier">find_scale</span></code> to give
a new standard deviation.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">l</span> <span class="special">=</span> <span class="identifier">N01</span><span class="special">.</span><span class="identifier">location</span><span class="special">();</span>
<span class="keyword">double</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">l</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"scale (standard deviation) = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">s</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
that outputs:
</p>
<p>
</p>
that outputs:
</p>
<pre class="programlisting">scale (standard deviation) = 0.647201
</pre>
<p>
</p>
showing that we need to reduce the standard deviation from 1. to 0.65.
</p>
<p>
showing that we need to reduce the standard deviation from 1. to
0.65.
</p>
Then we can check that we have achieved our objective by constructing
a new distribution with the new standard deviation (but same zero mean):
</p>
<p>
</p>
<p>
Then we can check that we have achieved our objective by constructing
a new distribution with the new standard deviation (but same zero
mean):
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">np001pc</span><span class="special">(</span><span class="identifier">N01</span><span class="special">.</span><span class="identifier">location</span><span class="special">(),</span> <span class="identifier">s</span><span class="special">);</span></pre>
<p>
</p>
</p>
<p>
</p>
And re-calculating the fraction below (and above) our chosen limit.
</p>
<p>
And re-calculating the fraction below (and above) our chosen limit.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Normal distribution with mean = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">l</span>
<span class="special">&lt;&lt;</span> <span class="string">" has "</span> <span class="special">&lt;&lt;</span> <span class="string">"fraction &lt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span>
@ -161,53 +125,37 @@ Normal distribution with mean = 0 has fraction &gt; -2, p = 0.97725
<span class="special">&lt;&lt;</span> <span class="string">" has "</span> <span class="special">&lt;&lt;</span> <span class="string">"fraction &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span>
<span class="special">&lt;&lt;</span> <span class="string">", p = "</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">np001pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Normal distribution with mean = 0 has fraction &lt;= -2, p = 0.001
Normal distribution with mean = 0 has fraction &gt; -2, p = 0.999
</pre>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_scale_eg.controlling_how_errors_from_find_scale_are_handled"></a><h5>
<a name="id1068135"></a>
<a class="link" href="find_scale_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_scale_eg.controlling_how_errors_from_find_scale_are_handled">Controlling
how Errors from find_scale are handled</a>
</h5>
<p>
<a name="math_toolkit.dist.stat_tut.weg.find_eg.find_scale_eg.controlling_how_errors_from_find_scale_are_handled"></a>
</p>
<h5>
<a name="id1067817"></a>
<a class="link" href="find_scale_eg.html#math_toolkit.dist.stat_tut.weg.find_eg.find_scale_eg.controlling_how_errors_from_find_scale_are_handled">Controlling
how Errors from find_scale are handled</a>
</h5>
We can also control the policy for handling various errors. For example,
we can define a new (possibly unwise) policy to ignore domain errors
('bad' arguments).
</p>
<p>
</p>
Unless we are using the boost::math namespace, we will need:
</p>
<p>
We can also control the policy for handling various errors. For example,
we can define a new (possibly unwise) policy to ignore domain errors
('bad' arguments).
</p>
<p>
</p>
<p>
Unless we are using the boost::math namespace, we will need:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">policy</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">domain_error</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">ignore_error</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Using a typedef is convenient, especially if it is re-used, although
it is not required, as the various examples below show.
</p>
<p>
Using a typedef is convenient, especially if it is re-used, although
it is not required, as the various examples below show.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">policy</span><span class="special">&lt;</span><span class="identifier">domain_error</span><span class="special">&lt;</span><span class="identifier">ignore_error</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">ignore_domain_policy</span><span class="special">;</span>
<span class="comment">// find_scale with new policy, using typedef.
@ -220,20 +168,16 @@ Normal distribution with mean = 0 has fraction &gt; -2, p = 0.999
<span class="comment">// New policy, without typedef.
</span><span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">l</span><span class="special">,</span> <span class="identifier">policy</span><span class="special">&lt;</span><span class="identifier">domain_error</span><span class="special">&lt;</span><span class="identifier">ignore_error</span><span class="special">&gt;</span> <span class="special">&gt;());</span></pre>
<p>
</p>
</p>
<p>
</p>
If we want to express a probability, say 0.999, that is a complement,
<code class="computeroutput"><span class="number">1</span> <span class="special">-</span>
<span class="identifier">p</span></code> we should not even think
of writing <code class="computeroutput"><span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="number">1</span> <span class="special">-</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">l</span><span class="special">)</span></code>, but <a class="link" href="../../overview.html#why_complements">instead</a>,
use the <a class="link" href="../../overview.html#complements">complements</a> version.
</p>
<p>
If we want to express a probability, say 0.999, that is a complement,
<code class="computeroutput"><span class="number">1</span> <span class="special">-</span>
<span class="identifier">p</span></code> we should not even think
of writing <code class="computeroutput"><span class="identifier">find_scale</span><span class="special">&lt;</span><span class="identifier">normal</span><span class="special">&gt;(</span><span class="identifier">z</span><span class="special">,</span> <span class="number">1</span> <span class="special">-</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">l</span><span class="special">)</span></code>, but <a class="link" href="../../overview.html#why_complements">instead</a>,
use the <a class="link" href="../../overview.html#complements">complements</a> version.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">z</span> <span class="special">=</span> <span class="special">-</span><span class="number">2.</span><span class="special">;</span>
<span class="keyword">double</span> <span class="identifier">q</span> <span class="special">=</span> <span class="number">0.999</span><span class="special">;</span> <span class="comment">// = 1 - p; // complement of 0.001.
@ -245,31 +189,24 @@ Normal distribution with mean = 0 has fraction &gt; -2, p = 0.999
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Normal distribution with mean = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">l</span> <span class="special">&lt;&lt;</span> <span class="string">" has "</span>
<span class="special">&lt;&lt;</span> <span class="string">"fraction &gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</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">np95pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Sadly, it is all too easy to get probabilities the wrong way round,
when you may get a warning like this:
</p>
<p>
</p>
Sadly, it is all too easy to get probabilities the wrong way round,
when you may get a warning like this:
</p>
<pre class="programlisting">Message from thrown exception was:
Error in function boost::math::find_scale&lt;Dist, Policy&gt;(complement(double, double, double, Policy)):
Computed scale (-0.48043523852179076) is &lt;= 0! Was the complement intended?
</pre>
<p>
</p>
<p>
The default error handling policy is to throw an exception with this
message, but if you chose a policy to ignore the error, the (impossible)
negative scale is quietly returned.
</p>
The default error handling policy is to throw an exception with this
message, but if you chose a policy to ignore the error, the (impossible)
negative scale is quietly returned.
</p>
<p>
See <a href="../../../../../../../../example/find_scale_example.cpp" target="_top">find_scale_example.cpp</a>
for full source code: the program output looks like this:
</p>
for full source code: the program output looks like this:
</p>
<pre class="programlisting">Example: Find scale (standard deviation).
Normal distribution with mean = 0, standard deviation 1, has fraction &lt;= -2, p = 0.0227501
Normal distribution with mean = 0, standard deviation 1, has fraction &gt; -2, p = 0.97725
@ -279,8 +216,6 @@ Normal distribution with mean = 0 has fraction &gt; -2, p = 0.999
Normal distribution with mean = 0.946339 has fraction &lt;= -2 = 0.001
Normal distribution with mean = 0.946339 has fraction &gt; -2 = 0.999
</pre>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.nag_library"></a><a class="link" href="nag_library.html" title="Comparison with C, R, FORTRAN-style Free Functions"> Comparison
<a name="math_toolkit.dist.stat_tut.weg.nag_library"></a><a class="link" href="nag_library.html" title="Comparison with C, R, FORTRAN-style Free Functions">Comparison
with C, R, FORTRAN-style Free Functions</a>
</h5></div></div></div>
<p>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.nccs_eg"></a><a class="link" href="nccs_eg.html" title="Non Central Chi Squared Example"> Non Central
<a name="math_toolkit.dist.stat_tut.weg.nccs_eg"></a><a class="link" href="nccs_eg.html" title="Non Central Chi Squared Example">Non Central
Chi Squared Example</a>
</h5></div></div></div>
<div class="toc"><dl><dt><span class="section"><a href="nccs_eg/nccs_power_eg.html">
Tables of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></div>
<div class="toc"><dl><dt><span class="section"><a href="nccs_eg/nccs_power_eg.html">Tables
of the power function of the &#967;<sup>2</sup> test.</a></span></dt></dl></div>
<p>
(See also the reference documentation for the <a class="link" href="../../dist_ref/dists/nc_chi_squared_dist.html" title="Noncentral Chi-Squared Distribution">Non
Central Chi Squared</a>.)

View File

@ -17,19 +17,19 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg"></a><a class="link" href="neg_binom_eg.html" title="Negative Binomial Distribution Examples"> Negative
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg"></a><a class="link" href="neg_binom_eg.html" title="Negative Binomial Distribution Examples">Negative
Binomial Distribution Examples</a>
</h5></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="neg_binom_eg/neg_binom_conf.html">
Calculating Confidence Limits on the Frequency of Occurrence for the
Negative Binomial Distribution</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/neg_binom_size_eg.html">
Estimating Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/negative_binomial_example1.html">
Negative Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/negative_binomial_example2.html">
Negative Binomial Table Printing Example.</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/neg_binom_conf.html">Calculating
Confidence Limits on the Frequency of Occurrence for the Negative Binomial
Distribution</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/neg_binom_size_eg.html">Estimating
Sample Sizes for the Negative Binomial.</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/negative_binomial_example1.html">Negative
Binomial Sales Quota Example.</a></span></dt>
<dt><span class="section"><a href="neg_binom_eg/negative_binomial_example2.html">Negative
Binomial Table Printing Example.</a></span></dt>
</dl></div>
<p>
(See also the reference documentation for the <a class="link" href="../../dist_ref/dists/negative_binomial_dist.html" title="Negative Binomial Distribution">Negative

View File

@ -17,9 +17,9 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.neg_binom_conf"></a><a class="link" href="neg_binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for the Negative Binomial Distribution">
Calculating Confidence Limits on the Frequency of Occurrence for the
Negative Binomial Distribution</a>
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.neg_binom_conf"></a><a class="link" href="neg_binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for the Negative Binomial Distribution">Calculating
Confidence Limits on the Frequency of Occurrence for the Negative Binomial
Distribution</a>
</h6></div></div></div>
<p>
Imagine you have a process that follows a negative binomial distribution:
@ -48,15 +48,11 @@
illustrates their use.
</p>
<p>
</p>
First we need some includes to access the negative binomial distribution
(and some basic std output of course).
</p>
<p>
First we need some includes to access the negative binomial distribution
(and some basic std output of course).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">negative_binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial</span><span class="special">;</span>
@ -67,39 +63,28 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">setprecision</span><span class="special">;</span>
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">setw</span><span class="special">;</span> <span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">left</span><span class="special">;</span> <span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">fixed</span><span class="special">;</span> <span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">right</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
First define a table of significance levels: these are the probabilities
that the true occurrence frequency lies outside the calculated interval:
</p>
<p>
First define a table of significance levels: these are the probabilities
that the true occurrence frequency lies outside the calculated interval:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">alpha</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span> <span class="number">0.5</span><span class="special">,</span> <span class="number">0.25</span><span class="special">,</span> <span class="number">0.1</span><span class="special">,</span> <span class="number">0.05</span><span class="special">,</span> <span class="number">0.01</span><span class="special">,</span> <span class="number">0.001</span><span class="special">,</span> <span class="number">0.0001</span><span class="special">,</span> <span class="number">0.00001</span> <span class="special">};</span></pre>
<p>
</p>
</p>
<p>
</p>
Confidence value as % is (1 - alpha) * 100, so alpha 0.05 == 95% confidence
that the true occurence frequency lies <span class="bold"><strong>inside</strong></span>
the calculated interval.
</p>
<p>
Confidence value as % is (1 - alpha) * 100, so alpha 0.05 == 95%
confidence that the true occurence frequency lies <span class="bold"><strong>inside</strong></span>
the calculated interval.
</p>
We need a function to calculate and print confidence limits for an
observed frequency of occurrence that follows a negative binomial distribution.
</p>
<p>
</p>
<p>
We need a function to calculate and print confidence limits for an
observed frequency of occurrence that follows a negative binomial
distribution.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">confidence_limits_on_frequency</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">trials</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">successes</span><span class="special">)</span>
<span class="special">{</span>
@ -125,25 +110,21 @@
<span class="string">" Value (%) Limit Limit\n"</span>
<span class="string">"___________________________________________\n"</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
And now for the important part - the bounds themselves. For each value
of <span class="emphasis"><em>alpha</em></span>, we call <code class="computeroutput"><span class="identifier">find_lower_bound_on_p</span></code>
and <code class="computeroutput"><span class="identifier">find_upper_bound_on_p</span></code>
to obtain lower and upper bounds respectively. Note that since we are
calculating a two-sided interval, we must divide the value of alpha
in two. Had we been calculating a single-sided interval, for example:
<span class="emphasis"><em>"Calculate a lower bound so that we are P% sure that
the true occurrence frequency is greater than some value"</em></span>
then we would <span class="bold"><strong>not</strong></span> have divided by
two.
</p>
<p>
And now for the important part - the bounds themselves. For each
value of <span class="emphasis"><em>alpha</em></span>, we call <code class="computeroutput"><span class="identifier">find_lower_bound_on_p</span></code>
and <code class="computeroutput"><span class="identifier">find_upper_bound_on_p</span></code>
to obtain lower and upper bounds respectively. Note that since we
are calculating a two-sided interval, we must divide the value of
alpha in two. Had we been calculating a single-sided interval, for
example: <span class="emphasis"><em>"Calculate a lower bound so that we are P%
sure that the true occurrence frequency is greater than some value"</em></span>
then we would <span class="bold"><strong>not</strong></span> have divided by
two.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="comment">// Now print out the upper and lower limits for the alpha table values.
</span> <span class="keyword">for</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">alpha</span><span class="special">)/</span><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">alpha</span><span class="special">[</span><span class="number">0</span><span class="special">]);</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
@ -160,17 +141,13 @@
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="comment">// void confidence_limits_on_frequency(unsigned trials, unsigned successes)</span></pre>
<p>
</p>
</p>
<p>
</p>
And then call confidence_limits_on_frequency with increasing numbers
of trials, but always the same success fraction 0.1, or 1 in 10.
</p>
<p>
And then call confidence_limits_on_frequency with increasing numbers
of trials, but always the same success fraction 0.1, or 1 in 10.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
@ -183,7 +160,7 @@
</span>
</pre>
<p>
</p>
</p>
<p>
Let's see some sample output for a 1 in 10 success ratio, first for
a mere 20 trials:

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.neg_binom_size_eg"></a><a class="link" href="neg_binom_size_eg.html" title="Estimating Sample Sizes for the Negative Binomial.">
Estimating Sample Sizes for the Negative Binomial.</a>
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.neg_binom_size_eg"></a><a class="link" href="neg_binom_size_eg.html" title="Estimating Sample Sizes for the Negative Binomial.">Estimating
Sample Sizes for the Negative Binomial.</a>
</h6></div></div></div>
<p>
Imagine you have an event (let's call it a "failure" - though
@ -36,62 +36,43 @@
demonstrates its usage.
</p>
<p>
</p>
<p>
It centres around a routine that prints out a table of minimum sample
sizes for various probability thresholds:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">find_number_of_trials</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">failures</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">p</span><span class="special">);</span></pre>
<p>
</p>
<p>
</p>
<p>
First define a table of significance levels: these are the maximum
acceptable probability that <span class="emphasis"><em>failure</em></span> or fewer
events will be observed.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">alpha</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span> <span class="number">0.5</span><span class="special">,</span> <span class="number">0.25</span><span class="special">,</span> <span class="number">0.1</span><span class="special">,</span> <span class="number">0.05</span><span class="special">,</span> <span class="number">0.01</span><span class="special">,</span> <span class="number">0.001</span><span class="special">,</span> <span class="number">0.0001</span><span class="special">,</span> <span class="number">0.00001</span> <span class="special">};</span></pre>
<p>
</p>
<p>
</p>
<p>
Confidence value as % is (1 - alpha) * 100, so alpha 0.05 == 95%
confidence that the desired number of failures will be observed.
</p>
<p>
</p>
<p>
Much of the rest of the program is pretty-printing, the important
part is in the calculation of minimum number of trials required for
each value of alpha using:
</p>
It centres around a routine that prints out a table of minimum sample
sizes for various probability thresholds:
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">find_number_of_trials</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">failures</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">p</span><span class="special">);</span></pre>
<p>
</p>
<p>
First define a table of significance levels: these are the maximum
acceptable probability that <span class="emphasis"><em>failure</em></span> or fewer events
will be observed.
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">alpha</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span> <span class="number">0.5</span><span class="special">,</span> <span class="number">0.25</span><span class="special">,</span> <span class="number">0.1</span><span class="special">,</span> <span class="number">0.05</span><span class="special">,</span> <span class="number">0.01</span><span class="special">,</span> <span class="number">0.001</span><span class="special">,</span> <span class="number">0.0001</span><span class="special">,</span> <span class="number">0.00001</span> <span class="special">};</span></pre>
<p>
</p>
<p>
Confidence value as % is (1 - alpha) * 100, so alpha 0.05 == 95% confidence
that the desired number of failures will be observed.
</p>
<p>
Much of the rest of the program is pretty-printing, the important part
is in the calculation of minimum number of trials required for each
value of alpha using:
</p>
<pre class="programlisting"><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="identifier">ceil</span><span class="special">(</span><span class="identifier">negative_binomial</span><span class="special">::</span><span class="identifier">find_minimum_number_of_trials</span><span class="special">(</span><span class="identifier">failures</span><span class="special">,</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">alpha</span><span class="special">[</span><span class="identifier">i</span><span class="special">]);</span>
</pre>
<p>
</p>
find_minimum_number_of_trials returns a double, so ceil rounds this
up to ensure we have an integral minimum number of trials.
</p>
<p>
find_minimum_number_of_trials returns a double, so ceil rounds this
up to ensure we have an integral minimum number of trials.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting">
<span class="keyword">void</span> <span class="identifier">find_number_of_trials</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">failures</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">p</span><span class="special">)</span>
@ -123,17 +104,13 @@
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span> <span class="comment">// void find_number_of_trials(double failures, double p)</span></pre>
<p>
</p>
</p>
<p>
</p>
finally we can produce some tables of minimum trials for the chosen
confidence levels:
</p>
<p>
finally we can produce some tables of minimum trials for the chosen
confidence levels:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
@ -148,8 +125,6 @@
<span class="special">}</span> <span class="comment">// int main()
</span>
</pre>
<p>
</p>
<p>
</p>
<div class="note"><table border="0" summary="Note">

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.negative_binomial_example1"></a><a class="link" href="negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">
Negative Binomial Sales Quota Example.</a>
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.negative_binomial_example1"></a><a class="link" href="negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">Negative
Binomial Sales Quota Example.</a>
</h6></div></div></div>
<p>
This example program <a href="../../../../../../../../example/negative_binomial_example1.cpp" target="_top">negative_binomial_example1.cpp
@ -26,92 +26,69 @@
of meeting a sales quota.
</p>
<p>
</p>
Based on <a href="http://en.wikipedia.org/wiki/Negative_binomial_distribution" target="_top">a
problem by Dr. Diane Evans, Professor of Mathematics at Rose-Hulman
Institute of Technology</a>.
</p>
<p>
Based on <a href="http://en.wikipedia.org/wiki/Negative_binomial_distribution" target="_top">a
problem by Dr. Diane Evans, Professor of Mathematics at Rose-Hulman
Institute of Technology</a>.
</p>
Pat is required to sell candy bars to raise money for the 6th grade
field trip. There are thirty houses in the neighborhood, and Pat is
not supposed to return home until five candy bars have been sold. So
the child goes door to door, selling candy bars. At each house, there
is a 0.4 probability (40%) of selling one candy bar and a 0.6 probability
(60%) of selling nothing.
</p>
<p>
</p>
What is the probability mass (density) function (pdf) for selling the
last (fifth) candy bar at the nth house?
</p>
<p>
Pat is required to sell candy bars to raise money for the 6th grade
field trip. There are thirty houses in the neighborhood, and Pat
is not supposed to return home until five candy bars have been sold.
So the child goes door to door, selling candy bars. At each house,
there is a 0.4 probability (40%) of selling one candy bar and a 0.6
probability (60%) of selling nothing.
</p>
The Negative Binomial(r, p) distribution describes the probability
of k failures and r successes in k+r Bernoulli(p) trials with success
on the last trial. (A <a href="http://en.wikipedia.org/wiki/Bernoulli_distribution" target="_top">Bernoulli
trial</a> is one with only two possible outcomes, success of failure,
and p is the probability of success). See also <a href="../../../../../" target="_top">http://en.wikipedia.org/wiki/Bernoulli_distribution
Bernoulli distribution</a> and <a href="http://www.math.uah.edu/stat/bernoulli/Introduction.xhtml" target="_top">Bernoulli
applications</a>.
</p>
<p>
</p>
In this example, we will deliberately produce a variety of calculations
and outputs to demonstrate the ways that the negative binomial distribution
can be implemented with this library: it is also deliberately over-commented.
</p>
<p>
What is the probability mass (density) function (pdf) for selling
the last (fifth) candy bar at the nth house?
</p>
First we need to #define macros to control the error and discrete handling
policies. For this simple example, we want to avoid throwing an exception
(the default policy) and just return infinity. We want to treat the
distribution as if it was continuous, so we choose a discrete_quantile
policy of real, rather than the default policy integer_round_outwards.
</p>
<p>
</p>
<p>
The Negative Binomial(r, p) distribution describes the probability
of k failures and r successes in k+r Bernoulli(p) trials with success
on the last trial. (A <a href="http://en.wikipedia.org/wiki/Bernoulli_distribution" target="_top">Bernoulli
trial</a> is one with only two possible outcomes, success of
failure, and p is the probability of success). See also <a href="../../../../../" target="_top">http://en.wikipedia.org/wiki/Bernoulli_distribution
Bernoulli distribution</a> and <a href="http://www.math.uah.edu/stat/bernoulli/Introduction.xhtml" target="_top">Bernoulli
applications</a>.
</p>
<p>
</p>
<p>
In this example, we will deliberately produce a variety of calculations
and outputs to demonstrate the ways that the negative binomial distribution
can be implemented with this library: it is also deliberately over-commented.
</p>
<p>
</p>
<p>
First we need to #define macros to control the error and discrete
handling policies. For this simple example, we want to avoid throwing
an exception (the default policy) and just return infinity. We want
to treat the distribution as if it was continuous, so we choose a
discrete_quantile policy of real, rather than the default policy
integer_round_outwards.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_OVERFLOW_ERROR_POLICY</span> <span class="identifier">ignore_error</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DISCRETE_QUANTILE_POLICY</span> <span class="identifier">real</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
After that we need some includes to provide easy access to the negative
binomial distribution,
</p>
<p>
</p>
After that we need some includes to provide easy access to the negative
binomial distribution,
</p>
<div class="caution"><table border="0" summary="Caution">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../images/caution.png"></td>
<th align="left">Caution</th>
</tr>
<tr><td align="left" valign="top"><p>
It is vital to #include distributions etc <span class="bold"><strong>after</strong></span>
the above #defines
</p></td></tr>
It is vital to #include distributions etc <span class="bold"><strong>after</strong></span>
the above #defines
</p></td></tr>
</table></div>
<p>
</p>
and we need some std library iostream, of course.
</p>
<p>
and we need some std library iostream, of course.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">negative_binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="comment">// for negative_binomial_distribution
@ -130,91 +107,67 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<p>
</p>
It is always sensible to use try and catch blocks because defaults
policies are to throw an exception if anything goes wrong.
</p>
<p>
It is always sensible to use try and catch blocks because defaults
policies are to throw an exception if anything goes wrong.
</p>
A simple catch block (see below) will ensure that you get a helpful
error message instead of an abrupt program abort.
</p>
<p>
</p>
<p>
A simple catch block (see below) will ensure that you get a helpful
error message instead of an abrupt program abort.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">try</span>
<span class="special">{</span></pre>
<p>
</p>
</p>
<p>
</p>
Selling five candy bars means getting five successes, so successes
r = 5. The total number of trials (n, in this case, houses visited)
this takes is therefore = sucesses + failures or k + r = k + 5.
</p>
<p>
Selling five candy bars means getting five successes, so successes
r = 5. The total number of trials (n, in this case, houses visited)
this takes is therefore = sucesses + failures or k + r = k + 5.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">sales_quota</span> <span class="special">=</span> <span class="number">5</span><span class="special">;</span> <span class="comment">// Pat's sales quota - successes (r).</span></pre>
<p>
</p>
</p>
<p>
</p>
At each house, there is a 0.4 probability (40%) of selling one candy
bar and a 0.6 probability (60%) of selling nothing.
</p>
<p>
At each house, there is a 0.4 probability (40%) of selling one candy
bar and a 0.6 probability (60%) of selling nothing.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">success_fraction</span> <span class="special">=</span> <span class="number">0.4</span><span class="special">;</span> <span class="comment">// success_fraction (p) - so failure_fraction is 0.6.</span></pre>
<p>
</p>
</p>
<p>
</p>
The Negative Binomial(r, p) distribution describes the probability
of k failures and r successes in k+r Bernoulli(p) trials with success
on the last trial. (A <a href="http://en.wikipedia.org/wiki/Bernoulli_distribution" target="_top">Bernoulli
trial</a> is one with only two possible outcomes, success of failure,
and p is the probability of success).
</p>
<p>
The Negative Binomial(r, p) distribution describes the probability
of k failures and r successes in k+r Bernoulli(p) trials with success
on the last trial. (A <a href="http://en.wikipedia.org/wiki/Bernoulli_distribution" target="_top">Bernoulli
trial</a> is one with only two possible outcomes, success of
failure, and p is the probability of success).
</p>
We therefore start by constructing a negative binomial distribution
with parameters sales_quota (required successes) and probability of
success.
</p>
<p>
</p>
<p>
We therefore start by constructing a negative binomial distribution
with parameters sales_quota (required successes) and probability
of success.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">negative_binomial</span> <span class="identifier">nb</span><span class="special">(</span><span class="identifier">sales_quota</span><span class="special">,</span> <span class="identifier">success_fraction</span><span class="special">);</span> <span class="comment">// type double by default.</span></pre>
<p>
</p>
</p>
<p>
</p>
To confirm, display the success_fraction &amp; successes parameters
of the distribution.
</p>
<p>
To confirm, display the success_fraction &amp; successes parameters
of the distribution.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Pat has a sales per house success rate of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">success_fraction</span>
<span class="special">&lt;&lt;</span> <span class="string">".\nTherefore he would, on average, sell "</span> <span class="special">&lt;&lt;</span> <span class="identifier">nb</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">()</span> <span class="special">*</span> <span class="number">100</span>
@ -227,57 +180,42 @@
<span class="string">"to need to visit about "</span> <span class="special">&lt;&lt;</span> <span class="identifier">success_fraction</span> <span class="special">*</span> <span class="identifier">all_houses</span>
<span class="special">&lt;&lt;</span> <span class="string">" houses in order to sell all "</span> <span class="special">&lt;&lt;</span> <span class="identifier">nb</span><span class="special">.</span><span class="identifier">successes</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">" bars. "</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Pat has a sales per house success rate of 0.4.
Therefore he would, on average, sell 40 bars after trying 100 houses.
With a success rate of 0.4, he might expect, on average,
to need to visit about 12 houses in order to sell all 5 bars.
</pre>
<p>
</p>
The random variable of interest is the number of houses that must be
visited to sell five candy bars, so we substitute k = n - 5 into a
negative_binomial(5, 0.4) and obtain the <a class="link" href="../../../dist_ref/nmp.html#math.dist.pdf">probability
mass (density) function (pdf or pmf)</a> of the distribution of
houses visited. Obviously, the best possible case is that Pat makes
sales on all the first five houses.
</p>
<p>
The random variable of interest is the number of houses that must
be visited to sell five candy bars, so we substitute k = n - 5 into
a negative_binomial(5, 0.4) and obtain the <a class="link" href="../../../dist_ref/nmp.html#math.dist.pdf">probability
mass (density) function (pdf or pmf)</a> of the distribution of
houses visited. Obviously, the best possible case is that Pat makes
sales on all the first five houses.
</p>
We calculate this using the pdf function:
</p>
<p>
</p>
<p>
We calculate this using the pdf function:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes on the "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="string">"th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">5</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// == pdf(nb, 0)</span></pre>
<p>
</p>
</p>
<p>
</p>
Of course, he could not finish on fewer than 5 houses because he must
sell 5 candy bars. So the 5th house is the first that he could possibly
finish on.
</p>
<p>
Of course, he could not finish on fewer than 5 houses because he
must sell 5 candy bars. So the 5th house is the first that he could
possibly finish on.
</p>
To finish on or before the 8th house, Pat must finish at the 5th, 6th,
7th or 8th house. The probability that he will finish on <span class="bold"><strong>exactly</strong></span> ( == ) on any house is the Probability
Density Function (pdf).
</p>
<p>
</p>
<p>
To finish on or before the 8th house, Pat must finish at the 5th,
6th, 7th or 8th house. The probability that he will finish on <span class="bold"><strong>exactly</strong></span> ( == ) on any house is the Probability
Density Function (pdf).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes on the 6th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">6</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -286,24 +224,17 @@ to need to visit about 12 houses in order to sell all 5 bars.
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes on the 8th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">8</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability that Pat finishes on the 6th house is 0.03072
Probability that Pat finishes on the 7th house is 0.055296
Probability that Pat finishes on the 8th house is 0.077414
</pre>
<p>
</p>
The sum of the probabilities for these houses is the Cumulative Distribution
Function (cdf). We can calculate it by adding the individual probabilities.
</p>
<p>
The sum of the probabilities for these houses is the Cumulative Distribution
Function (cdf). We can calculate it by adding the individual probabilities.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes on or before the 8th house is sum "</span>
<span class="string">"\n"</span> <span class="special">&lt;&lt;</span> <span class="string">"pdf(sales_quota) + pdf(6) + pdf(7) + pdf(8) = "</span>
@ -314,37 +245,25 @@ Probability that Pat finishes on the 8th house is 0.077414
</span> <span class="special">+</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">8</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="comment">// 3 failures.
</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">pdf(sales_quota) + pdf(6) + pdf(7) + pdf(8) = 0.17367
</pre>
<p>
</p>
Or, usually better, by using the negative binomial <span class="bold"><strong>cumulative</strong></span>
distribution function.
</p>
<p>
Or, usually better, by using the negative binomial <span class="bold"><strong>cumulative</strong></span>
distribution function.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sales_quota</span>
<span class="special">&lt;&lt;</span> <span class="string">" bars\non or before the "</span> <span class="special">&lt;&lt;</span> <span class="number">8</span> <span class="special">&lt;&lt;</span> <span class="string">"th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">8</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of selling his quota of 5 bars on or before the 8th house is 0.17367
</pre>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\nProbability that Pat finishes exactly on the 10th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">10</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -352,17 +271,12 @@ Probability that Pat finishes on the 8th house is 0.077414
<span class="special">&lt;&lt;</span> <span class="string">" bars\non or before the "</span> <span class="special">&lt;&lt;</span> <span class="number">10</span> <span class="special">&lt;&lt;</span> <span class="string">"th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">10</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability that Pat finishes exactly on the 10th house is 0.10033
Probability of selling his quota of 5 bars on or before the 10th house is 0.3669
</pre>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes exactly on the 11th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">11</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -370,18 +284,13 @@ Probability of selling his quota of 5 bars on or before the 10th house is 0.3669
<span class="special">&lt;&lt;</span> <span class="string">" bars\non or before the "</span> <span class="special">&lt;&lt;</span> <span class="number">11</span> <span class="special">&lt;&lt;</span> <span class="string">"th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">11</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability that Pat finishes on the 11th house is 0.10033
Probability of selling his quota of 5 candy bars
on or before the 11th house is 0.46723
</pre>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes exactly on the 12th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">12</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -390,189 +299,135 @@ on or before the 11th house is 0.46723
<span class="special">&lt;&lt;</span> <span class="string">" bars\non or before the "</span> <span class="special">&lt;&lt;</span> <span class="number">12</span> <span class="special">&lt;&lt;</span> <span class="string">"th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">12</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability that Pat finishes on the 12th house is 0.094596
Probability of selling his quota of 5 candy bars
on or before the 12th house is 0.56182
</pre>
<p>
</p>
Finally consider the risk of Pat not selling his quota of 5 bars even
after visiting all the houses. Calculate the probability that he <span class="emphasis"><em>will</em></span>
sell on or before the last house: Calculate the probability that he
would sell all his quota on the very last house.
</p>
<p>
Finally consider the risk of Pat not selling his quota of 5 bars
even after visiting all the houses. Calculate the probability that
he <span class="emphasis"><em>will</em></span> sell on or before the last house: Calculate
the probability that he would sell all his quota on the very last
house.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability that Pat finishes on the "</span> <span class="special">&lt;&lt;</span> <span class="identifier">all_houses</span>
<span class="special">&lt;&lt;</span> <span class="string">" house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">all_houses</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Probability of selling his quota of 5 bars on the 30th house is
</p>
<p>
</p>
Probability of selling his quota of 5 bars on the 30th house is
</p>
<pre class="programlisting">Probability that Pat finishes on the 30 house is 0.00069145
</pre>
<p>
</p>
when he'd be very unlucky indeed!
</p>
<p>
when he'd be very unlucky indeed!
</p>
What is the probability that Pat exhausts all 30 houses in the neighborhood,
and <span class="bold"><strong>still</strong></span> doesn't sell the required
5 candy bars?
</p>
<p>
</p>
<p>
What is the probability that Pat exhausts all 30 houses in the neighborhood,
and <span class="bold"><strong>still</strong></span> doesn't sell the required
5 candy bars?
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sales_quota</span>
<span class="special">&lt;&lt;</span> <span class="string">" bars\non or before the "</span> <span class="special">&lt;&lt;</span> <span class="identifier">all_houses</span> <span class="special">&lt;&lt;</span> <span class="string">"th house is "</span>
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">all_houses</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of selling his quota of 5 bars
on or before the 30th house is 0.99849
</pre>
<p>
</p>
/*<code class="computeroutput"><span class="identifier">So</span> <span class="identifier">the</span>
<span class="identifier">risk</span> <span class="identifier">of</span>
<span class="identifier">failing</span> <span class="identifier">even</span>
<span class="identifier">after</span> <span class="identifier">visiting</span>
<span class="identifier">all</span> <span class="identifier">the</span>
<span class="identifier">houses</span> <span class="identifier">is</span>
<span class="number">1</span> <span class="special">-</span>
<span class="keyword">this</span> <span class="identifier">probability</span><span class="special">,</span> </code><code class="computeroutput"><span class="number">1</span>
<span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">all_houses</span>
<span class="special">-</span> <span class="identifier">sales_quota</span></code><code class="computeroutput">
<span class="identifier">But</span> <span class="keyword">using</span>
<span class="keyword">this</span> <span class="identifier">expression</span>
<span class="identifier">may</span> <span class="identifier">cause</span>
<span class="identifier">serious</span> <span class="identifier">inaccuracy</span><span class="special">,</span> <span class="identifier">so</span> <span class="identifier">it</span> <span class="identifier">would</span>
<span class="identifier">be</span> <span class="identifier">much</span>
<span class="identifier">better</span> <span class="identifier">to</span>
<span class="identifier">use</span> <span class="identifier">the</span>
<span class="identifier">complement</span> <span class="identifier">of</span>
<span class="identifier">the</span> <span class="identifier">cdf</span><span class="special">:</span> <span class="identifier">So</span> <span class="identifier">the</span> <span class="identifier">risk</span>
<span class="identifier">of</span> <span class="identifier">failing</span>
<span class="identifier">even</span> <span class="identifier">at</span><span class="special">,</span> <span class="keyword">or</span> <span class="identifier">after</span><span class="special">,</span>
<span class="identifier">the</span> <span class="number">31</span><span class="identifier">th</span> <span class="special">(</span><span class="identifier">non</span><span class="special">-</span><span class="identifier">existent</span><span class="special">)</span>
<span class="identifier">houses</span> <span class="identifier">is</span>
<span class="number">1</span> <span class="special">-</span>
<span class="keyword">this</span> <span class="identifier">probability</span><span class="special">,</span> </code><code class="computeroutput"><span class="number">1</span>
<span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">all_houses</span>
<span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span></code>` But using this expression may cause
serious inaccuracy. So it would be much better to use the complement
of the cdf. <a class="link" href="../../overview.html#why_complements">Why complements?</a>
</p>
<p>
/*<code class="computeroutput"><span class="identifier">So</span> <span class="identifier">the</span>
<span class="identifier">risk</span> <span class="identifier">of</span>
<span class="identifier">failing</span> <span class="identifier">even</span>
<span class="identifier">after</span> <span class="identifier">visiting</span>
<span class="identifier">all</span> <span class="identifier">the</span>
<span class="identifier">houses</span> <span class="identifier">is</span>
<span class="number">1</span> <span class="special">-</span>
<span class="keyword">this</span> <span class="identifier">probability</span><span class="special">,</span> </code><code class="computeroutput"><span class="number">1</span>
<span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">all_houses</span>
<span class="special">-</span> <span class="identifier">sales_quota</span></code><code class="computeroutput">
<span class="identifier">But</span> <span class="keyword">using</span>
<span class="keyword">this</span> <span class="identifier">expression</span>
<span class="identifier">may</span> <span class="identifier">cause</span>
<span class="identifier">serious</span> <span class="identifier">inaccuracy</span><span class="special">,</span> <span class="identifier">so</span>
<span class="identifier">it</span> <span class="identifier">would</span>
<span class="identifier">be</span> <span class="identifier">much</span>
<span class="identifier">better</span> <span class="identifier">to</span>
<span class="identifier">use</span> <span class="identifier">the</span>
<span class="identifier">complement</span> <span class="identifier">of</span>
<span class="identifier">the</span> <span class="identifier">cdf</span><span class="special">:</span> <span class="identifier">So</span>
<span class="identifier">the</span> <span class="identifier">risk</span>
<span class="identifier">of</span> <span class="identifier">failing</span>
<span class="identifier">even</span> <span class="identifier">at</span><span class="special">,</span> <span class="keyword">or</span> <span class="identifier">after</span><span class="special">,</span>
<span class="identifier">the</span> <span class="number">31</span><span class="identifier">th</span> <span class="special">(</span><span class="identifier">non</span><span class="special">-</span><span class="identifier">existent</span><span class="special">)</span>
<span class="identifier">houses</span> <span class="identifier">is</span>
<span class="number">1</span> <span class="special">-</span>
<span class="keyword">this</span> <span class="identifier">probability</span><span class="special">,</span> </code><code class="computeroutput"><span class="number">1</span>
<span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">all_houses</span>
<span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span></code>` But using this expression may cause
serious inaccuracy. So it would be much better to use the complement
of the cdf. <a class="link" href="../../overview.html#why_complements">Why complements?</a>
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\nProbability of failing to sell his quota of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sales_quota</span>
<span class="special">&lt;&lt;</span> <span class="string">" bars\neven after visiting all "</span> <span class="special">&lt;&lt;</span> <span class="identifier">all_houses</span> <span class="special">&lt;&lt;</span> <span class="string">" houses is "</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">nb</span><span class="special">,</span> <span class="identifier">all_houses</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of failing to sell his quota of 5 bars
even after visiting all 30 houses is 0.0015101
</pre>
<p>
</p>
We can also use the quantile (percentile), the inverse of the cdf,
to predict which house Pat will finish on. So for the 8th house:
</p>
<p>
We can also use the quantile (percentile), the inverse of the cdf,
to predict which house Pat will finish on. So for the 8th house:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="special">(</span><span class="number">8</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">));</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of meeting sales quota on or before 8th house is "</span><span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">Probability of meeting sales quota on or before 8th house is 0.174
</pre>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span>
<span class="special">&lt;&lt;</span> <span class="string">", then the finishing house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span><span class="special">&lt;&lt;</span> <span class="string">" quantile(nb, p) = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">If the confidence of meeting sales quota is 0.17367, then the finishing house is 8
</pre>
<p>
</p>
Demanding absolute certainty that all 5 will be sold, implies an infinite
number of trials. (Of course, there are only 30 houses on the estate,
so he can't ever be <span class="bold"><strong>certain</strong></span> of selling
his quota).
</p>
<p>
Demanding absolute certainty that all 5 will be sold, implies an
infinite number of trials. (Of course, there are only 30 houses on
the estate, so he can't ever be <span class="bold"><strong>certain</strong></span>
of selling his quota).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special">&lt;&lt;</span> <span class="number">1.</span>
<span class="special">&lt;&lt;</span> <span class="string">", then the finishing house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// 1.#INF == infinity.</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">If the confidence of meeting sales quota is 1, then the finishing house is 1.#INF
</pre>
<p>
</p>
And similarly for a few other probabilities:
</p>
<p>
And similarly for a few other probabilities:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special">&lt;&lt;</span> <span class="number">0.</span>
<span class="special">&lt;&lt;</span> <span class="string">", then the finishing house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">0.</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -583,51 +438,35 @@ even after visiting all 30 houses is 0.0015101
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special">&lt;&lt;</span> <span class="number">1</span> <span class="special">-</span> <span class="number">0.00151</span> <span class="comment">// 30 th
</span> <span class="special">&lt;&lt;</span> <span class="string">", then the finishing house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="number">1</span> <span class="special">-</span> <span class="number">0.00151</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">If the confidence of meeting sales quota is 0, then the finishing house is 5
If the confidence of meeting sales quota is 0.5, then the finishing house is 11.337
If the confidence of meeting sales quota is 0.99849, then the finishing house is 30
</pre>
<p>
</p>
Notice that because we chose a discrete quantile policy of real, the
result can be an 'unreal' fractional house.
</p>
<p>
Notice that because we chose a discrete quantile policy of real,
the result can be an 'unreal' fractional house.
</p>
If the opposite is true, we don't want to assume any confidence, then
this is tantamount to assuming that all the first sales_quota trials
will be successful sales.
</p>
<p>
</p>
<p>
If the opposite is true, we don't want to assume any confidence,
then this is tantamount to assuming that all the first sales_quota
trials will be successful sales.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If confidence of meeting quota is zero\n(we assume all houses are successful sales)"</span>
<span class="string">", then finishing house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">If confidence of meeting quota is zero (we assume all houses are successful sales), then finishing house is 5
If confidence of meeting quota is 0, then finishing house is 5
</pre>
<p>
</p>
We can list quantiles for a few probabilities:
</p>
<p>
We can list quantiles for a few probabilities:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="keyword">double</span> <span class="identifier">ps</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">0.</span><span class="special">,</span> <span class="number">0.001</span><span class="special">,</span> <span class="number">0.01</span><span class="special">,</span> <span class="number">0.05</span><span class="special">,</span> <span class="number">0.1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">,</span> <span class="number">0.9</span><span class="special">,</span> <span class="number">0.95</span><span class="special">,</span> <span class="number">0.99</span><span class="special">,</span> <span class="number">0.999</span><span class="special">,</span> <span class="number">1.</span><span class="special">};</span>
<span class="comment">// Confidence as fraction = 1-alpha, as percent = 100 * (1-alpha[i]) %
@ -639,10 +478,7 @@ If confidence of meeting quota is 0, then finishing house is 5
<span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">If confidence of meeting quota is 0, then finishing house is 5
If confidence of meeting quota is 0.001, then finishing house is 5
If confidence of meeting quota is 0.01, then finishing house is 5
@ -656,53 +492,38 @@ If confidence of meeting quota is 0.999, then finishing house is 31.1
If confidence of meeting quota is 1, then finishing house is 1.#INF
</pre>
<p>
</p>
<p>
We could have applied a ceil function to obtain a 'worst case' integer
value for house.
We could have applied a ceil function to obtain a 'worst case' integer
value for house.
</p>
<pre class="programlisting"><span class="identifier">ceil</span><span class="special">(</span><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">ps</span><span class="special">[</span><span class="identifier">i</span><span class="special">]))</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
Or, if we had used the default discrete quantile policy, integer_outside,
by omitting
Or, if we had used the default discrete quantile policy, integer_outside,
by omitting
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DISCRETE_QUANTILE_POLICY</span> <span class="identifier">real</span></pre>
<p>
we would have achieved the same effect.
</p>
we would have achieved the same effect.
</p>
<p>
</p>
<p>
The real result gives some suggestion which house is most likely.
For example, compare the real and integer_outside for 95% confidence.
</p>
<p>
</p>
The real result gives some suggestion which house is most likely. For
example, compare the real and integer_outside for 95% confidence.
</p>
<pre class="programlisting">If confidence of meeting quota is 0.95, then finishing house is 20.1
If confidence of meeting quota is 0.95, then finishing house is 21
</pre>
<p>
</p>
The real value 20.1 is much closer to 20 than 21, so integer_outside
is pessimistic. We could also use integer_round_nearest policy to suggest
that 20 is more likely.
</p>
<p>
The real value 20.1 is much closer to 20 than 21, so integer_outside
is pessimistic. We could also use integer_round_nearest policy to
suggest that 20 is more likely.
</p>
Finally, we can tabulate the probability for the last sale being exactly
on each house.
</p>
<p>
</p>
<p>
Finally, we can tabulate the probability for the last sale being
exactly on each house.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\nHouse for "</span> <span class="special">&lt;&lt;</span> <span class="identifier">sales_quota</span> <span class="special">&lt;&lt;</span> <span class="string">"th (last) sale. Probability (%)"</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="number">5</span><span class="special">);</span>
@ -712,10 +533,7 @@ If confidence of meeting quota is 0.95, then finishing house is 21
<span class="special">}</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
<p>
</p>
</p>
<pre class="programlisting">House for 5 th (last) sale. Probability (%)
5 0.01024
6 0.04096
@ -745,15 +563,11 @@ If confidence of meeting quota is 0.95, then finishing house is 21
30 0.99849
</pre>
<p>
</p>
As noted above, using a catch block is always a good idea, even if
you do not expect to use it.
</p>
<p>
As noted above, using a catch block is always a good idea, even if
you do not expect to use it.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="special">}</span>
<span class="keyword">catch</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">e</span><span class="special">)</span>
@ -761,26 +575,19 @@ If confidence of meeting quota is 0.95, then finishing house is 21
</span> <span class="comment">// an overflow exception should never be thrown.
</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\nMessage from thrown exception was:\n "</span> <span class="special">&lt;&lt;</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</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>
</p>
</p>
<p>
</p>
<p>
For example, without a ignore domain error policy, if we asked for
For example, without a ignore domain error policy, if we asked for
</p>
<pre class="programlisting"><span class="identifier">pdf</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span></pre>
<p>
for example, we would get:
</p>
<p>
</p>
for example, we would get:
</p>
<pre class="programlisting">Message from thrown exception was:
Error in function boost::math::pdf(const negative_binomial_distribution&lt;double&gt;&amp;, double):
Number of failures argument is -1, but must be &gt;= 0 !
</pre>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,17 +17,15 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.negative_binomial_example2"></a><a class="link" href="negative_binomial_example2.html" title="Negative Binomial Table Printing Example.">
Negative Binomial Table Printing Example.</a>
<a name="math_toolkit.dist.stat_tut.weg.neg_binom_eg.negative_binomial_example2"></a><a class="link" href="negative_binomial_example2.html" title="Negative Binomial Table Printing Example.">Negative
Binomial Table Printing Example.</a>
</h6></div></div></div>
<p>
Example program showing output of a table of values of cdf and pdf
for various k failures.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// Print a table of values that can be used to plot
</span><span class="comment">// using Excel, or some other superior graphical display tool.
@ -49,11 +47,9 @@
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
</p>
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">k</span> <span class="identifier">pdf</span> <span class="identifier">cdf</span>
<span class="number">0</span><span class="special">,</span> <span class="number">1.5258789062500000e-005</span> <span class="number">1.5258789062500003e-005</span>
@ -121,8 +117,6 @@
<span class="number">62</span><span class="special">,</span> <span class="number">0.00029532382517950324</span> <span class="number">0.99857863176306016</span>
<span class="number">63</span><span class="special">,</span> <span class="number">0.00024610318764958566</span> <span class="number">0.99882473495070978</span>
</pre>
<p>
</p>
<p>
</p>
</div>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.normal_example"></a><a class="link" href="normal_example.html" title="Normal Distribution Examples"> Normal
<a name="math_toolkit.dist.stat_tut.weg.normal_example"></a><a class="link" href="normal_example.html" title="Normal Distribution Examples">Normal
Distribution Examples</a>
</h5></div></div></div>
<div class="toc"><dl><dt><span class="section"><a href="normal_example/normal_misc.html">
Some Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></div>
<div class="toc"><dl><dt><span class="section"><a href="normal_example/normal_misc.html">Some
Miscellaneous Examples of the Normal (Gaussian) Distribution</a></span></dt></dl></div>
<p>
(See also the reference documentation for the <a class="link" href="../../dist_ref/dists/normal_dist.html" title="Normal (Gaussian) Distribution">Normal
Distribution</a>.)

View File

@ -17,28 +17,24 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc"></a><a class="link" href="normal_misc.html" title="Some Miscellaneous Examples of the Normal (Gaussian) Distribution">
Some Miscellaneous Examples of the Normal (Gaussian) Distribution</a>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc"></a><a class="link" href="normal_misc.html" title="Some Miscellaneous Examples of the Normal (Gaussian) Distribution">Some
Miscellaneous Examples of the Normal (Gaussian) Distribution</a>
</h6></div></div></div>
<p>
The sample program <a href="../../../../../../../../example/normal_misc_examples.cpp" target="_top">normal_misc_examples.cpp</a>
illustrates their use.
</p>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.traditional_tables"></a><h5>
<a name="id1049217"></a>
<a name="id1050101"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.traditional_tables">Traditional
Tables</a>
</h5>
<p>
</p>
First we need some includes to access the normal distribution (and
some std output of course).
</p>
<p>
First we need some includes to access the normal distribution (and
some std output of course).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for normal_distribution
</span> <span class="keyword">using</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="special">;</span> <span class="comment">// typedef provides default type is double.
@ -58,16 +54,12 @@
<span class="special">{</span>
<span class="special">{</span> <span class="comment">// Traditional tables and values.</span></pre>
<p>
</p>
</p>
<p>
</p>
Let's start by printing some traditional tables.
</p>
<p>
Let's start by printing some traditional tables.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">step</span> <span class="special">=</span> <span class="number">1.</span><span class="special">;</span> <span class="comment">// in z
</span><span class="keyword">double</span> <span class="identifier">range</span> <span class="special">=</span> <span class="number">4</span><span class="special">;</span> <span class="comment">// min and max z = -range to +range.
@ -78,16 +70,12 @@
</span> <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Standard normal distribution, mean = "</span><span class="special">&lt;&lt;</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()</span>
<span class="special">&lt;&lt;</span> <span class="string">", standard deviation = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
First the probability distribution function (pdf).
</p>
<p>
First the probability distribution function (pdf).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability distribution function values"</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">" z "</span> <span class="string">" pdf "</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -99,17 +87,13 @@
<span class="special">}</span>
<span class="identifier">cout</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="number">6</span><span class="special">);</span> <span class="comment">// default</span></pre>
<p>
</p>
</p>
<p>
</p>
And the area under the normal curve from -&#8734; up to z, the cumulative distribution
function (cdf).
</p>
<p>
And the area under the normal curve from -&#8734; up to z, the cumulative
distribution function (cdf).
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// For a standard normal distribution
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Standard normal mean = "</span><span class="special">&lt;&lt;</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()</span>
@ -123,116 +107,88 @@
<span class="special">}</span>
<span class="identifier">cout</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="number">6</span><span class="special">);</span> <span class="comment">// default</span></pre>
<p>
</p>
</p>
<p>
</p>
And all this you can do with a nanoscopic amount of work compared to
the team of <span class="bold"><strong>human computers</strong></span> toiling
with Milton Abramovitz and Irene Stegen at the US National Bureau of
Standards (now <a href="http://www.nist.gov" target="_top">NIST</a>). Starting
in 1938, their "Handbook of Mathematical Functions with Formulas,
Graphs and Mathematical Tables", was eventually published in 1964,
and has been reprinted numerous times since. (A major replacement is
planned at <a href="http://dlmf.nist.gov" target="_top">Digital Library of Mathematical
Functions</a>).
</p>
<p>
And all this you can do with a nanoscopic amount of work compared
to the team of <span class="bold"><strong>human computers</strong></span> toiling
with Milton Abramovitz and Irene Stegen at the US National Bureau
of Standards (now <a href="http://www.nist.gov" target="_top">NIST</a>).
Starting in 1938, their "Handbook of Mathematical Functions
with Formulas, Graphs and Mathematical Tables", was eventually
published in 1964, and has been reprinted numerous times since. (A
major replacement is planned at <a href="http://dlmf.nist.gov" target="_top">Digital
Library of Mathematical Functions</a>).
</p>
Pretty-printing a traditional 2-dimensional table is left as an exercise
for the student, but why bother now that the Math Toolkit lets you
write
</p>
<p>
</p>
<p>
Pretty-printing a traditional 2-dimensional table is left as an exercise
for the student, but why bother now that the Math Toolkit lets you
write
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">z</span> <span class="special">=</span> <span class="number">2.</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Area for z = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">z</span> <span class="special">&lt;&lt;</span> <span class="string">" is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">z</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// to get the area for z.</span></pre>
<p>
</p>
</p>
<p>
</p>
Correspondingly, we can obtain the traditional 'critical' values for
significance levels. For the 95% confidence level, the significance
level usually called alpha, is 0.05 = 1 - 0.95 (for a one-sided test),
so we can write
</p>
<p>
Correspondingly, we can obtain the traditional 'critical' values
for significance levels. For the 95% confidence level, the significance
level usually called alpha, is 0.05 = 1 - 0.95 (for a one-sided test),
so we can write
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"95% of area has a z below "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="number">0.95</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// 95% of area has a z below 1.64485</span></pre>
<p>
</p>
</p>
<p>
</p>
and a two-sided test (a comparison between two levels, rather than
a one-sided test)
</p>
<p>
and a two-sided test (a comparison between two levels, rather than
a one-sided test)
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"95% of area has a z between "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="number">0.975</span><span class="special">)</span>
<span class="special">&lt;&lt;</span> <span class="string">" and "</span> <span class="special">&lt;&lt;</span> <span class="special">-</span><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="number">0.975</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// 95% of area has a z between 1.95996 and -1.95996</span></pre>
<p>
</p>
</p>
<p>
</p>
First, define a table of significance levels: these are the probabilities
that the true occurrence frequency lies outside the calculated interval.
</p>
<p>
First, define a table of significance levels: these are the probabilities
that the true occurrence frequency lies outside the calculated interval.
</p>
It is convenient to have an alpha level for the probability that z
lies outside just one standard deviation. This will not be some nice
neat number like 0.05, but we can easily calculate it,
</p>
<p>
</p>
<p>
It is convenient to have an alpha level for the probability that
z lies outside just one standard deviation. This will not be some
nice neat number like 0.05, but we can easily calculate it,
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">alpha1</span> <span class="special">=</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="special">-</span><span class="number">1</span><span class="special">)</span> <span class="special">*</span> <span class="number">2</span><span class="special">;</span> <span class="comment">// 0.3173105078629142
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">17</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">"Significance level for z == 1 is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">alpha1</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
and place in our array of favorite alpha values.
</p>
<p>
and place in our array of favorite alpha values.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">alpha</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">0.3173105078629142</span><span class="special">,</span> <span class="comment">// z for 1 standard deviation.
</span> <span class="number">0.20</span><span class="special">,</span> <span class="number">0.1</span><span class="special">,</span> <span class="number">0.05</span><span class="special">,</span> <span class="number">0.01</span><span class="special">,</span> <span class="number">0.001</span><span class="special">,</span> <span class="number">0.0001</span><span class="special">,</span> <span class="number">0.00001</span> <span class="special">};</span></pre>
<p>
</p>
</p>
<p>
</p>
Confidence value as % is (1 - alpha) * 100 (so alpha 0.05 == 95% confidence)
that the true occurrence frequency lies <span class="bold"><strong>inside</strong></span>
the calculated interval.
</p>
<p>
Confidence value as % is (1 - alpha) * 100 (so alpha 0.05 == 95%
confidence) that the true occurrence frequency lies <span class="bold"><strong>inside</strong></span>
the calculated interval.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"level of significance (alpha)"</span> <span class="special">&lt;&lt;</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">4</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"2-sided 1 -sided z(alpha) "</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -243,49 +199,37 @@
</span><span class="special">}</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Notice the distinction between one-sided (also called one-tailed) where
we are using a &gt; <span class="bold"><strong>or</strong></span> &lt; test (and
not both) and considering the area of the tail (integral) from z up
to +&#8734;, and a two-sided test where we are using two &gt; <span class="bold"><strong>and</strong></span>
&lt; tests, and thus considering two tails, from -&#8734; up to z low and z
high up to +&#8734;.
</p>
<p>
Notice the distinction between one-sided (also called one-tailed)
where we are using a &gt; <span class="bold"><strong>or</strong></span> &lt;
test (and not both) and considering the area of the tail (integral)
from z up to +&#8734;, and a two-sided test where we are using two &gt;
<span class="bold"><strong>and</strong></span> &lt; tests, and thus considering
two tails, from -&#8734; up to z low and z high up to +&#8734;.
</p>
<p>
</p>
<p>
So the 2-sided values alpha[i] are calculated using alpha[i]/2.
</p>
<p>
</p>
<p>
If we consider a simple example of alpha = 0.05, then for a two-sided
test, the lower tail area from -&#8734; up to -1.96 is 0.025 (alpha/2) and
the upper tail area from +z up to +1.96 is also 0.025 (alpha/2),
and the area between -1.96 up to 12.96 is alpha = 0.95. and the sum
of the two tails is 0.025 + 0.025 = 0.05,
</p>
So the 2-sided values alpha[i] are calculated using alpha[i]/2.
</p>
<p>
If we consider a simple example of alpha = 0.05, then for a two-sided
test, the lower tail area from -&#8734; up to -1.96 is 0.025 (alpha/2) and
the upper tail area from +z up to +1.96 is also 0.025 (alpha/2), and
the area between -1.96 up to 12.96 is alpha = 0.95. and the sum of
the two tails is 0.025 + 0.025 = 0.05,
</p>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.standard_deviations_either_side_of_the_mean"></a><h5>
<a name="id1051542"></a>
<a name="id1052568"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.standard_deviations_either_side_of_the_mean">Standard
deviations either side of the Mean</a>
</h5>
<p>
</p>
Armed with the cumulative distribution function, we can easily calculate
the easy to remember proportion of values that lie within 1, 2 and
3 standard deviations from the mean.
</p>
<p>
Armed with the cumulative distribution function, we can easily calculate
the easy to remember proportion of values that lie within 1, 2 and
3 standard deviations from the mean.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">showpoint</span> <span class="special">&lt;&lt;</span> <span class="string">"cdf(s, s.standard_deviation()) = "</span>
@ -299,105 +243,77 @@
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Fraction 3 standard deviations within either side of mean is "</span>
<span class="special">&lt;&lt;</span> <span class="number">1</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">s</span><span class="special">,</span> <span class="number">3</span> <span class="special">*</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()))</span> <span class="special">*</span> <span class="number">2</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
<p>
To a useful precision, the 1, 2 &amp; 3 percentages are 68, 95 and
99.7, and these are worth memorising as useful 'rules of thumb',
as, for example, in <a href="http://en.wikipedia.org/wiki/Standard_deviation" target="_top">standard
deviation</a>:
</p>
<p>
</p>
To a useful precision, the 1, 2 &amp; 3 percentages are 68, 95 and
99.7, and these are worth memorising as useful 'rules of thumb', as,
for example, in <a href="http://en.wikipedia.org/wiki/Standard_deviation" target="_top">standard
deviation</a>:
</p>
<pre class="programlisting">Fraction 1 standard deviation within either side of mean is 0.683
Fraction 2 standard deviations within either side of mean is 0.954
Fraction 3 standard deviations within either side of mean is 0.997
</pre>
<p>
</p>
<p>
We could of course get some really accurate values for these <a href="http://en.wikipedia.org/wiki/Confidence_interval" target="_top">confidence
intervals</a> by using cout.precision(15);
</p>
<p>
</p>
We could of course get some really accurate values for these <a href="http://en.wikipedia.org/wiki/Confidence_interval" target="_top">confidence intervals</a>
by using cout.precision(15);
</p>
<pre class="programlisting">Fraction 1 standard deviation within either side of mean is 0.682689492137086
Fraction 2 standard deviations within either side of mean is 0.954499736103642
Fraction 3 standard deviations within either side of mean is 0.997300203936740
</pre>
<p>
</p>
<p>
But before you get too excited about this impressive precision, don't
forget that the <span class="bold"><strong>confidence intervals of the
standard deviation</strong></span> are surprisingly wide, especially if
you have estimated the standard deviation from only a few measurements.
</p>
<p>
But before you get too excited about this impressive precision, don't
forget that the <span class="bold"><strong>confidence intervals of the standard
deviation</strong></span> are surprisingly wide, especially if you have
estimated the standard deviation from only a few measurements.
</p>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.some_simple_examples"></a><h5>
<a name="id1052066"></a>
<a name="id1053089"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.some_simple_examples">Some
simple examples</a>
</h5>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.life_of_light_bulbs"></a><h5>
<a name="id1052079"></a>
<a name="id1053102"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.life_of_light_bulbs">Life
of light bulbs</a>
</h5>
<p>
</p>
Examples from K. Krishnamoorthy, Handbook of Statistical Distributions
with Applications, ISBN 1 58488 635 8, page 125... implemented using
the Math Toolkit library.
</p>
<p>
Examples from K. Krishnamoorthy, Handbook of Statistical Distributions
with Applications, ISBN 1 58488 635 8, page 125... implemented using
the Math Toolkit library.
</p>
A few very simple examples are shown here:
</p>
<p>
</p>
<p>
A few very simple examples are shown here:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="comment">// K. Krishnamoorthy, Handbook of Statistical Distributions with Applications,
</span> <span class="comment">// ISBN 1 58488 635 8, page 125, example 10.3.5</span></pre>
<p>
</p>
</p>
<p>
</p>
Mean lifespan of 100 W bulbs is 1100 h with standard deviation of 100
h. Assuming, perhaps with little evidence and much faith, that the
distribution is normal, we construct a normal distribution called
<span class="emphasis"><em>bulbs</em></span> with these values:
</p>
<p>
Mean lifespan of 100 W bulbs is 1100 h with standard deviation of
100 h. Assuming, perhaps with little evidence and much faith, that
the distribution is normal, we construct a normal distribution called
<span class="emphasis"><em>bulbs</em></span> with these values:
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">mean_life</span> <span class="special">=</span> <span class="number">1100.</span><span class="special">;</span>
<span class="keyword">double</span> <span class="identifier">life_standard_deviation</span> <span class="special">=</span> <span class="number">100.</span><span class="special">;</span>
<span class="identifier">normal</span> <span class="identifier">bulbs</span><span class="special">(</span><span class="identifier">mean_life</span><span class="special">,</span> <span class="identifier">life_standard_deviation</span><span class="special">);</span>
<span class="keyword">double</span> <span class="identifier">expected_life</span> <span class="special">=</span> <span class="number">1000.</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
The we can use the Cumulative distribution function to predict fractions
(or percentages, if * 100) that will last various lifetimes.
</p>
<p>
The we can use the Cumulative distribution function to predict fractions
(or percentages, if * 100) that will last various lifetimes.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Fraction of bulbs that will last at best (&lt;=) "</span> <span class="comment">// P(X &lt;= 1000)
</span> <span class="special">&lt;&lt;</span> <span class="identifier">expected_life</span> <span class="special">&lt;&lt;</span> <span class="string">" is "</span><span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">bulbs</span><span class="special">,</span> <span class="identifier">expected_life</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@ -410,38 +326,30 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">bulbs</span><span class="special">,</span> <span class="identifier">max_life</span><span class="special">)</span> <span class="comment">// P(X &lt;= 1200)
</span> <span class="special">-</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">bulbs</span><span class="special">,</span> <span class="identifier">min_life</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X &lt;= 900)</span></pre>
<p>
</p>
<p>
</p>
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
Real-life failures are often very ab-normal, with a significant
number that 'dead-on-arrival' or suffer failure very early in their
life: the lifetime of the survivors of 'early mortality' may be
well described by the normal distribution.
</p></td></tr>
Real-life failures are often very ab-normal, with a significant number
that 'dead-on-arrival' or suffer failure very early in their life:
the lifetime of the survivors of 'early mortality' may be well described
by the normal distribution.
</p></td></tr>
</table></div>
<p>
</p>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.how_many_onions_"></a><h5>
<a name="id1052590"></a>
<a name="id1053610"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.how_many_onions_">How
many onions?</a>
</h5>
<p>
</p>
Weekly demand for 5 lb sacks of onions at a store is normally distributed
with mean 140 sacks and standard deviation 10.
</p>
<p>
Weekly demand for 5 lb sacks of onions at a store is normally distributed
with mean 140 sacks and standard deviation 10.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">mean</span> <span class="special">=</span> <span class="number">140.</span><span class="special">;</span> <span class="comment">// sacks per week.
</span><span class="keyword">double</span> <span class="identifier">standard_deviation</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
@ -452,58 +360,44 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="special">&lt;&lt;</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">sacks</span><span class="special">,</span> <span class="identifier">stock</span><span class="special">)</span> <span class="special">*</span> <span class="number">100.</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X &lt;=160)
</span><span class="comment">// Percentage of weeks overstocked 97.7</span></pre>
<p>
</p>
</p>
<p>
</p>
So there will be lots of mouldy onions! So we should be able to say
what stock level will meet demand 95% of the weeks.
</p>
<p>
So there will be lots of mouldy onions! So we should be able to say
what stock level will meet demand 95% of the weeks.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">stock_95</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">sacks</span><span class="special">,</span> <span class="number">0.95</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Store should stock "</span> <span class="special">&lt;&lt;</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">stock_95</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" sacks to meet 95% of demands."</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
And it is easy to estimate how to meet 80% of demand, and waste even
less.
</p>
<p>
And it is easy to estimate how to meet 80% of demand, and waste even
less.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">stock_80</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">sacks</span><span class="special">,</span> <span class="number">0.80</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Store should stock "</span> <span class="special">&lt;&lt;</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">stock_80</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" sacks to meet 8 out of 10 demands."</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
</p>
<p>
</p>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.packing_beef"></a><h5>
<a name="id1054946"></a>
<a name="id1054025"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.packing_beef">Packing
beef</a>
</h5>
<p>
</p>
A machine is set to pack 3 kg of ground beef per pack. Over a long
period of time it is found that the average packed was 3 kg with a
standard deviation of 0.1 kg. Assuming the packing is normally distributed,
we can find the fraction (or %) of packages that weigh more than 3.1
kg.
</p>
<p>
A machine is set to pack 3 kg of ground beef per pack. Over a long
period of time it is found that the average packed was 3 kg with
a standard deviation of 0.1 kg. Assuming the packing is normally
distributed, we can find the fraction (or %) of packages that weigh
more than 3.1 kg.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">mean</span> <span class="special">=</span> <span class="number">3.</span><span class="special">;</span> <span class="comment">// kg
</span><span class="keyword">double</span> <span class="identifier">standard_deviation</span> <span class="special">=</span> <span class="number">0.1</span><span class="special">;</span> <span class="comment">// kg
@ -536,65 +430,47 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="special">&lt;&lt;</span> <span class="string">"fraction of packs &gt;= "</span> <span class="special">&lt;&lt;</span> <span class="identifier">under_weight</span>
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">nominal_packs</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Setting the packer to 3.06449 will mean that fraction of packs &gt;=
2.9 is 0.95.
</p>
<p>
Setting the packer to 3.06449 will mean that fraction of packs &gt;=
2.9 is 0.95.
</p>
Setting the packer to 3.13263 will mean that fraction of packs &gt;=
2.9 is 0.99, but will more than double the mean loss from 0.0644 to
0.133.
</p>
<p>
</p>
Alternatively, we could invest in a better (more precise) packer with
a lower standard deviation.
</p>
<p>
Setting the packer to 3.13263 will mean that fraction of packs &gt;=
2.9 is 0.99, but will more than double the mean loss from 0.0644
to 0.133.
</p>
To estimate how much better (how much smaller standard deviation) it
would have to be, we need to get the 5% quantile to be located at the
under_weight limit, 2.9
</p>
<p>
</p>
<p>
Alternatively, we could invest in a better (more precise) packer
with a lower standard deviation.
</p>
<p>
</p>
<p>
To estimate how much better (how much smaller standard deviation)
it would have to be, we need to get the 5% quantile to be located
at the under_weight limit, 2.9
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">0.05</span><span class="special">;</span> <span class="comment">// wanted p th quantile.
</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">packs</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span>
<span class="special">&lt;&lt;</span> <span class="string">", mean = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="string">", sd = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">//</span></pre>
<p>
</p>
</p>
<p>
</p>
Quantile of 0.05 = 2.83551, mean = 3, sd = 0.1
</p>
<p>
Quantile of 0.05 = 2.83551, mean = 3, sd = 0.1
</p>
With the current packer (mean = 3, sd = 0.1), the 5% quantile is at
2.8551 kg, a little below our target of 2.9 kg. So we know that the
standard deviation is going to have to be smaller.
</p>
<p>
</p>
Let's start by guessing that it (now 0.1) needs to be halved, to a
standard deviation of 0.05
</p>
<p>
With the current packer (mean = 3, sd = 0.1), the 5% quantile is
at 2.8551 kg, a little below our target of 2.9 kg. So we know that
the standard deviation is going to have to be smaller.
</p>
<p>
</p>
<p>
Let's start by guessing that it (now 0.1) needs to be halved, to
a standard deviation of 0.05
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">pack05</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="number">0.05</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">pack05</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span>
@ -605,24 +481,18 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">pack05</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">//</span></pre>
<p>
</p>
</p>
<p>
</p>
Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation
of 0.05 is 0.9772
</p>
<p>
Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation
of 0.05 is 0.9772
</p>
So 0.05 was quite a good guess, but we are a little over the 2.9 target,
so the standard deviation could be a tiny bit more. So we could do
some more guessing to get closer, say by increasing to 0.06
</p>
<p>
</p>
<p>
So 0.05 was quite a good guess, but we are a little over the 2.9
target, so the standard deviation could be a tiny bit more. So we
could do some more guessing to get closer, say by increasing to 0.06
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">pack06</span><span class="special">(</span><span class="identifier">mean</span><span class="special">,</span> <span class="number">0.06</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">p</span> <span class="special">&lt;&lt;</span> <span class="string">" = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">pack06</span><span class="special">,</span> <span class="identifier">p</span><span class="special">)</span>
@ -632,31 +502,23 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="special">&lt;&lt;</span> <span class="string">" and standard deviation of "</span> <span class="special">&lt;&lt;</span> <span class="identifier">pack06</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special">&lt;&lt;</span> <span class="string">" is "</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">pack06</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span></pre>
<p>
</p>
</p>
<p>
</p>
Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation
of 0.06 is 0.9522
</p>
<p>
Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation
of 0.06 is 0.9522
</p>
Now we are getting really close, but to do the job properly, we could
use root finding method, for example the tools provided, and used elsewhere,
in the Math Toolkit, see <a class="link" href="../../../../toolkit/internals1/roots2.html" title="Root Finding Without Derivatives">Root
Finding Without Derivatives</a>.
</p>
<p>
</p>
But in this normal distribution case, we could be even smarter and
make a direct calculation.
</p>
<p>
Now we are getting really close, but to do the job properly, we could
use root finding method, for example the tools provided, and used
elsewhere, in the Math Toolkit, see <a class="link" href="../../../../toolkit/internals1/roots2.html" title="Root Finding Without Derivatives">Root
Finding Without Derivatives</a>.
</p>
<p>
</p>
<p>
But in this normal distribution case, we could be even smarter and
make a direct calculation.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"><span class="identifier">normal</span> <span class="identifier">s</span><span class="special">;</span> <span class="comment">// For standard normal distribution,
</span><span class="keyword">double</span> <span class="identifier">sd</span> <span class="special">=</span> <span class="number">0.1</span><span class="special">;</span>
@ -682,37 +544,29 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="comment">// Fraction of packs &gt;= 2.9 with a mean of 3 and standard deviation of 0.0608 is 0.95</span></pre>
<p>
</p>
<p>
</p>
<p>
Notice that these two deceptively simple questions (do we over-fill
or measure better) are actually very common. The weight of beef might
be replaced by a measurement of more or less anything. But the calculations
rely on the accuracy of the standard deviation - something that is
almost always less good than we might wish, especially if based on
a few measurements.
</p>
</p>
<p>
Notice that these two deceptively simple questions (do we over-fill
or measure better) are actually very common. The weight of beef might
be replaced by a measurement of more or less anything. But the calculations
rely on the accuracy of the standard deviation - something that is
almost always less good than we might wish, especially if based on
a few measurements.
</p>
<a name="math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.length_of_bolts"></a><h5>
<a name="id1057291"></a>
<a name="id1057478"></a>
<a class="link" href="normal_misc.html#math_toolkit.dist.stat_tut.weg.normal_example.normal_misc.length_of_bolts">Length
of bolts</a>
</h5>
<p>
</p>
A bolt is usable if between 3.9 and 4.1 long. From a large batch of
bolts, a sample of 50 show a mean length of 3.95 with standard deviation
0.1. Assuming a normal distribution, what proportion is usable? The
true sample mean is unknown, but we can use the sample mean and standard
deviation to find approximate solutions.
</p>
<p>
A bolt is usable if between 3.9 and 4.1 long. From a large batch
of bolts, a sample of 50 show a mean length of 3.95 with standard
deviation 0.1. Assuming a normal distribution, what proportion is
usable? The true sample mean is unknown, but we can use the sample
mean and standard deviation to find approximate solutions.
</p>
<p>
</p>
<p>
</p>
<pre class="programlisting"> <span class="identifier">normal</span> <span class="identifier">bolts</span><span class="special">(</span><span class="number">3.95</span><span class="special">,</span> <span class="number">0.1</span><span class="special">);</span>
<span class="keyword">double</span> <span class="identifier">top</span> <span class="special">=</span> <span class="number">4.1</span><span class="special">;</span>
@ -730,8 +584,6 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"95% of bolts are shorter than "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">bolts</span><span class="special">,</span> <span class="number">0.95</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
</p>
<p>
</p>
</div>

View File

@ -17,21 +17,21 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="math_toolkit.dist.stat_tut.weg.st_eg"></a><a class="link" href="st_eg.html" title="Student's t Distribution Examples"> Student's
t Distribution Examples</a>
<a name="math_toolkit.dist.stat_tut.weg.st_eg"></a><a class="link" href="st_eg.html" title="Student's t Distribution Examples">Student's t
Distribution Examples</a>
</h5></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="st_eg/tut_mean_intervals.html">
Calculating confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="st_eg/tut_mean_test.html">
Testing a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="st_eg/tut_mean_size.html">
Estimating how large a sample size would have to become in order to give
a significant Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="st_eg/two_sample_students_t.html">
Comparing the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="st_eg/paired_st.html">
Comparing two paired samples with the Student's t distribution</a></span></dt>
<dt><span class="section"><a href="st_eg/tut_mean_intervals.html">Calculating
confidence intervals on the mean with the Students-t distribution</a></span></dt>
<dt><span class="section"><a href="st_eg/tut_mean_test.html">Testing
a sample mean for difference from a "true" mean</a></span></dt>
<dt><span class="section"><a href="st_eg/tut_mean_size.html">Estimating
how large a sample size would have to become in order to give a significant
Students-t test result with a single sample test</a></span></dt>
<dt><span class="section"><a href="st_eg/two_sample_students_t.html">Comparing
the means of two samples with the Students-t test</a></span></dt>
<dt><span class="section"><a href="st_eg/paired_st.html">Comparing
two paired samples with the Student's t distribution</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.st_eg.paired_st"></a><a class="link" href="paired_st.html" title="Comparing two paired samples with the Student's t distribution">
Comparing two paired samples with the Student's t distribution</a>
<a name="math_toolkit.dist.stat_tut.weg.st_eg.paired_st"></a><a class="link" href="paired_st.html" title="Comparing two paired samples with the Student's t distribution">Comparing
two paired samples with the Student's t distribution</a>
</h6></div></div></div>
<p>
Imagine that we have a before and after reading for each item in the

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.st_eg.tut_mean_intervals"></a><a class="link" href="tut_mean_intervals.html" title="Calculating confidence intervals on the mean with the Students-t distribution">
Calculating confidence intervals on the mean with the Students-t distribution</a>
<a name="math_toolkit.dist.stat_tut.weg.st_eg.tut_mean_intervals"></a><a class="link" href="tut_mean_intervals.html" title="Calculating confidence intervals on the mean with the Students-t distribution">Calculating
confidence intervals on the mean with the Students-t distribution</a>
</h6></div></div></div>
<p>
Let's say you have a sample mean, you may wish to know what confidence

View File

@ -17,9 +17,9 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.st_eg.tut_mean_size"></a><a class="link" href="tut_mean_size.html" title="Estimating how large a sample size would have to become in order to give a significant Students-t test result with a single sample test">
Estimating how large a sample size would have to become in order to give
a significant Students-t test result with a single sample test</a>
<a name="math_toolkit.dist.stat_tut.weg.st_eg.tut_mean_size"></a><a class="link" href="tut_mean_size.html" title="Estimating how large a sample size would have to become in order to give a significant Students-t test result with a single sample test">Estimating
how large a sample size would have to become in order to give a significant
Students-t test result with a single sample test</a>
</h6></div></div></div>
<p>
Imagine you have conducted a Students-t test on a single sample in

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.st_eg.tut_mean_test"></a><a class="link" href="tut_mean_test.html" title='Testing a sample mean for difference from a "true" mean'>
Testing a sample mean for difference from a "true" mean</a>
<a name="math_toolkit.dist.stat_tut.weg.st_eg.tut_mean_test"></a><a class="link" href="tut_mean_test.html" title='Testing a sample mean for difference from a "true" mean'>Testing
a sample mean for difference from a "true" mean</a>
</h6></div></div></div>
<p>
When calibrating or comparing a scientific instrument or measurement

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
<a name="math_toolkit.dist.stat_tut.weg.st_eg.two_sample_students_t"></a><a class="link" href="two_sample_students_t.html" title="Comparing the means of two samples with the Students-t test">
Comparing the means of two samples with the Students-t test</a>
<a name="math_toolkit.dist.stat_tut.weg.st_eg.two_sample_students_t"></a><a class="link" href="two_sample_students_t.html" title="Comparing the means of two samples with the Students-t test">Comparing
the means of two samples with the Students-t test</a>
</h6></div></div></div>
<p>
Imagine that we have two samples, and we wish to determine whether

View File

@ -17,34 +17,30 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="math_toolkit.main_overview"></a><a class="link" href="main_overview.html" title="Overview"> Overview</a>
<a name="math_toolkit.main_overview"></a><a class="link" href="main_overview.html" title="Overview">Overview</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="main_overview/intro.html"> About the Math Toolkit</a></span></dt>
<dt><span class="section"><a href="main_overview/navigation.html"> Navigation</a></span></dt>
<dt><span class="section"><a href="main_overview/directories.html"> Directory and
<dt><span class="section"><a href="main_overview/intro.html">About the Math Toolkit</a></span></dt>
<dt><span class="section"><a href="main_overview/navigation.html">Navigation</a></span></dt>
<dt><span class="section"><a href="main_overview/directories.html">Directory and
File Structure</a></span></dt>
<dt><span class="section"><a href="main_overview/namespaces.html"> Namespaces</a></span></dt>
<dt><span class="section"><a href="main_overview/result_type.html"> Calculation
of the Type of the Result</a></span></dt>
<dt><span class="section"><a href="main_overview/error_handling.html"> Error Handling</a></span></dt>
<dt><span class="section"><a href="main_overview/compilers_overview.html"> Compilers</a></span></dt>
<dt><span class="section"><a href="main_overview/pol_overview.html"> Configuration
<dt><span class="section"><a href="main_overview/namespaces.html">Namespaces</a></span></dt>
<dt><span class="section"><a href="main_overview/result_type.html">Calculation of
the Type of the Result</a></span></dt>
<dt><span class="section"><a href="main_overview/error_handling.html">Error Handling</a></span></dt>
<dt><span class="section"><a href="main_overview/compilers_overview.html">Compilers</a></span></dt>
<dt><span class="section"><a href="main_overview/pol_overview.html">Configuration
and Policies</a></span></dt>
<dt><span class="section"><a href="main_overview/threads.html"> Thread Safety</a></span></dt>
<dt><span class="section"><a href="main_overview/perf_over.html"> Performance</a></span></dt>
<dt><span class="section"><a href="main_overview/building.html"> If and How to Build
<dt><span class="section"><a href="main_overview/threads.html">Thread Safety</a></span></dt>
<dt><span class="section"><a href="main_overview/perf_over.html">Performance</a></span></dt>
<dt><span class="section"><a href="main_overview/building.html">If and How to Build
the Library and its Examples and Tests</a></span></dt>
<dt><span class="section"><a href="main_overview/history1.html"> History and What's
<dt><span class="section"><a href="main_overview/history1.html">History and What's
New</a></span></dt>
<dt><span class="section"><a href="main_overview/tr1.html"> C99 and TR1 C Functions</a></span></dt>
<dt><span class="section"><a href="main_overview/contact.html"> Contact Info and
<dt><span class="section"><a href="main_overview/tr1.html">C99 and TR1 C Functions</a></span></dt>
<dt><span class="section"><a href="main_overview/contact.html">Contact Info and
Support</a></span></dt>
</dl></div>
<p>
</p>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.building"></a><a class="link" href="building.html" title="If and How to Build the Library and its Examples and Tests"> If and How to Build
<a name="math_toolkit.main_overview.building"></a><a class="link" href="building.html" title="If and How to Build the Library and its Examples and Tests">If and How to Build
the Library and its Examples and Tests</a>
</h3></div></div></div>
<a name="math_toolkit.main_overview.building.building_the_library"></a><h5>
<a name="id984428"></a>
<a name="id986560"></a>
<a class="link" href="building.html#math_toolkit.main_overview.building.building_the_library">Building
the Library</a>
</h5>
@ -85,7 +85,7 @@
building the sources. Boost.Build will do this automatically when appropriate.
</p>
<a name="math_toolkit.main_overview.building.building_the_examples"></a><h5>
<a name="id984872"></a>
<a name="id987004"></a>
<a class="link" href="building.html#math_toolkit.main_overview.building.building_the_examples">Building
the Examples</a>
</h5>
@ -96,7 +96,7 @@
the Boost headers are in your compilers #include search path.
</p>
<a name="math_toolkit.main_overview.building.building_the_tests"></a><h5>
<a name="id984914"></a>
<a name="id987046"></a>
<a class="link" href="building.html#math_toolkit.main_overview.building.building_the_tests">Building
the Tests</a>
</h5>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.contact"></a><a class="link" href="contact.html" title="Contact Info and Support"> Contact Info and
<a name="math_toolkit.main_overview.contact"></a><a class="link" href="contact.html" title="Contact Info and Support">Contact Info and
Support</a>
</h3></div></div></div>
<p>

View File

@ -17,11 +17,11 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.directories"></a><a class="link" href="directories.html" title="Directory and File Structure"> Directory and
<a name="math_toolkit.main_overview.directories"></a><a class="link" href="directories.html" title="Directory and File Structure">Directory and
File Structure</a>
</h3></div></div></div>
<a name="math_toolkit.main_overview.directories.boost_math"></a><h5>
<a name="id969434"></a>
<a name="id970644"></a>
<a class="link" href="directories.html#math_toolkit.main_overview.directories.boost_math">boost/math</a>
</h5>
<div class="variablelist">
@ -66,7 +66,7 @@
</dl>
</div>
<a name="math_toolkit.main_overview.directories.boost_libs"></a><h5>
<a name="id977353"></a>
<a name="id979541"></a>
<a class="link" href="directories.html#math_toolkit.main_overview.directories.boost_libs">boost/libs</a>
</h5>
<div class="variablelist">

View File

@ -17,10 +17,10 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.error_handling"></a><a class="link" href="error_handling.html" title="Error Handling"> Error Handling</a>
<a name="math_toolkit.main_overview.error_handling"></a><a class="link" href="error_handling.html" title="Error Handling">Error Handling</a>
</h3></div></div></div>
<a name="math_toolkit.main_overview.error_handling.quick_reference"></a><h5>
<a name="id978287"></a>
<a name="id980471"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.quick_reference">Quick
Reference</a>
</h5>
@ -127,7 +127,7 @@
the default action for each error shown in bold:
</p>
<div class="table">
<a name="id978549"></a><p class="title"><b>Table&#160;1.&#160;Possible Actions for Domain Errors</b></p>
<a name="id980733"></a><p class="title"><b>Table&#160;1.&#160;Possible Actions for Domain Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Domain Errors">
<colgroup>
<col>
@ -202,7 +202,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id978795"></a><p class="title"><b>Table&#160;2.&#160;Possible Actions for Pole Errors</b></p>
<a name="id980979"></a><p class="title"><b>Table&#160;2.&#160;Possible Actions for Pole Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Pole Errors">
<colgroup>
<col>
@ -277,7 +277,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id979041"></a><p class="title"><b>Table&#160;3.&#160;Possible Actions for Overflow Errors</b></p>
<a name="id981225"></a><p class="title"><b>Table&#160;3.&#160;Possible Actions for Overflow Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Overflow Errors">
<colgroup>
<col>
@ -352,7 +352,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id979287"></a><p class="title"><b>Table&#160;4.&#160;Possible Actions for Underflow Errors</b></p>
<a name="id981471"></a><p class="title"><b>Table&#160;4.&#160;Possible Actions for Underflow Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Underflow Errors">
<colgroup>
<col>
@ -427,7 +427,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id979468"></a><p class="title"><b>Table&#160;5.&#160;Possible Actions for Denorm Errors</b></p>
<a name="id981652"></a><p class="title"><b>Table&#160;5.&#160;Possible Actions for Denorm Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Denorm Errors">
<colgroup>
<col>
@ -502,7 +502,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id979650"></a><p class="title"><b>Table&#160;6.&#160;Possible Actions for Rounding Errors</b></p>
<a name="id981834"></a><p class="title"><b>Table&#160;6.&#160;Possible Actions for Rounding Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Rounding Errors">
<colgroup>
<col>
@ -577,7 +577,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id979838"></a><p class="title"><b>Table&#160;7.&#160;Possible Actions for Internal Evaluation Errors</b></p>
<a name="id982022"></a><p class="title"><b>Table&#160;7.&#160;Possible Actions for Internal Evaluation Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Internal Evaluation Errors">
<colgroup>
<col>
@ -652,7 +652,7 @@
</table></div>
</div>
<br class="table-break"><div class="table">
<a name="id980025"></a><p class="title"><b>Table&#160;8.&#160;Possible Actions for Indeterminate Result Errors</b></p>
<a name="id982210"></a><p class="title"><b>Table&#160;8.&#160;Possible Actions for Indeterminate Result Errors</b></p>
<div class="table-contents"><table class="table" summary="Possible Actions for Indeterminate Result Errors">
<colgroup>
<col>
@ -728,7 +728,7 @@
</table></div>
</div>
<br class="table-break"><a name="math_toolkit.main_overview.error_handling.rationale"></a><h5>
<a name="id980217"></a>
<a name="id982402"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.rationale">Rationale</a>
</h5>
<p>
@ -747,7 +747,7 @@
</li>
</ul></div>
<a name="math_toolkit.main_overview.error_handling.finding_more_information"></a><h5>
<a name="id980252"></a>
<a name="id982436"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.finding_more_information">Finding
More Information</a>
</h5>
@ -768,10 +768,9 @@
<p>
The various kind of errors are described in more detail below.
</p>
<a name="domain_error"></a><a name="math_toolkit.main_overview.error_handling.domain_errors"></a><h5>
<a name="id980305"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.domain_errors">Domain
Errors</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__domain_error____domain_errors"></a><h5>
<a name="id982486"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__domain_error____domain_errors"><a name="domain_error"></a> Domain Errors</a>
</h5>
<p>
When a special function is passed an argument that is outside the range of
@ -840,10 +839,9 @@
<a href="../../../../../../format/index.html" target="_top">Boost.Format</a> documentation
for more details.
</p>
<a name="pole_error"></a><a name="math_toolkit.main_overview.error_handling.evaluation_at_a_pole"></a><h5>
<a name="id980552"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.evaluation_at_a_pole">Evaluation
at a pole</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__pole_error____evaluation_at_a_pole"></a><h5>
<a name="id982729"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__pole_error____evaluation_at_a_pole"><a name="pole_error"></a> Evaluation at a pole</a>
</h5>
<p>
When a special function is passed an argument that is at a pole without a
@ -879,10 +877,9 @@
<a href="../../../../../../format/index.html" target="_top">Boost.Format</a> documentation
for more details.
</p>
<a name="overflow_error"></a><a name="math_toolkit.main_overview.error_handling.numeric_overflow"></a><h5>
<a name="id980761"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.numeric_overflow">Numeric
Overflow</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__overflow_error____numeric_overflow"></a><h5>
<a name="id982931"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__overflow_error____numeric_overflow"><a name="overflow_error"></a> Numeric Overflow</a>
</h5>
<p>
When the result of a special function is too large to fit in the argument
@ -904,10 +901,9 @@
In this situation if the type <code class="computeroutput"><span class="identifier">T</span></code>
doesn't support infinities, the maximum value for the type is returned.
</p>
<a name="underflow_error"></a><a name="math_toolkit.main_overview.error_handling.numeric_underflow"></a><h5>
<a name="id980948"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.numeric_underflow">Numeric
Underflow</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__underflow_error____numeric_underflow"></a><h5>
<a name="id983112"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__underflow_error____numeric_underflow"><a name="underflow_error"></a> Numeric Underflow</a>
</h5>
<p>
If the result of a special function is known to be non-zero, but the calculated
@ -927,10 +923,9 @@
like <code class="computeroutput"><span class="identifier">throw_on_error</span></code>, throws
an <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">underflow_error</span></code> C++ exception.
</p>
<a name="denorm_error"></a><a name="math_toolkit.main_overview.error_handling.denormalisation_errors"></a><h5>
<a name="id981092"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.denormalisation_errors">Denormalisation
Errors</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__denorm_error____denormalisation_errors"></a><h5>
<a name="id983252"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__denorm_error____denormalisation_errors"><a name="denorm_error"></a> Denormalisation Errors</a>
</h5>
<p>
If the result of a special function is a denormalised value <span class="emphasis"><em>z</em></span>
@ -950,10 +945,9 @@
with another policy, like <code class="computeroutput"><span class="identifier">throw_on_error</span></code>
throws an <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">underflow_error</span></code> C++ exception.
</p>
<a name="evaluation_error"></a><a name="math_toolkit.main_overview.error_handling.evaluation_errors"></a><h5>
<a name="id981253"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.evaluation_errors">Evaluation
Errors</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__evaluation_error____evaluation_errors"></a><h5>
<a name="id983408"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__evaluation_error____evaluation_errors"><a name="evaluation_error"></a> Evaluation Errors</a>
</h5>
<p>
When a special function calculates a result that is known to be erroneous,
@ -987,10 +981,9 @@
<a href="../../../../../../format/index.html" target="_top">Boost.Format</a> documentation
for more details.
</p>
<a name="indeterminate_result_error"></a><a name="math_toolkit.main_overview.error_handling.indeterminate_result_errors"></a><h5>
<a name="id981466"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.indeterminate_result_errors">Indeterminate
Result Errors</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__indeterminate_result_error____indeterminate_result_errors"></a><h5>
<a name="id983618"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__indeterminate_result_error____indeterminate_result_errors"><a name="indeterminate_result_error"></a> Indeterminate Result Errors</a>
</h5>
<p>
When the result of a special function is indeterminate for the value that
@ -1014,10 +1007,9 @@
for what the result should be: for example the C99 standard specifies that
the result of 0<sup>0</sup> is 1, even though the result is actually mathematically indeterminate.
</p>
<a name="rounding_error"></a><a name="math_toolkit.main_overview.error_handling.rounding_errors"></a><h5>
<a name="id981615"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.rounding_errors">Rounding
Errors</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__rounding_error____rounding_errors"></a><h5>
<a name="id983764"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__rounding_error____rounding_errors"><a name="rounding_error"></a> Rounding Errors</a>
</h5>
<p>
When one of the rounding functions <a class="link" href="../special/rounding/round.html" title="Rounding Functions">round</a>,
@ -1053,10 +1045,9 @@
<a href="../../../../../../format/index.html" target="_top">Boost.Format</a> documentation
for more details.
</p>
<a name="checked_narrowing_cast"></a><a name="math_toolkit.main_overview.error_handling.errors_from_typecasts"></a><h5>
<a name="id983075"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling.errors_from_typecasts">Errors
from typecasts</a>
<a name="math_toolkit.main_overview.error_handling._anchor_id__checked_narrowing_cast____errors_from_typecasts"></a><h5>
<a name="id985217"></a>
<a class="link" href="error_handling.html#math_toolkit.main_overview.error_handling._anchor_id__checked_narrowing_cast____errors_from_typecasts"><a name="checked_narrowing_cast"></a> Errors from typecasts</a>
</h5>
<p>
Many special functions evaluate their results at a higher precision than

View File

@ -17,251 +17,204 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.history1"></a><a class="link" href="history1.html" title="History and What's New"> History and What's
<a name="math_toolkit.main_overview.history1"></a><a class="link" href="history1.html" title="History and What's New">History and What's
New</a>
</h3></div></div></div>
<p>
<a name="math_toolkit.main_overview.history1.boost_1_38_0"></a>
</p>
<h5>
<a name="id985774"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_38_0">Boost-1.38.0</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.boost_1_38_0"></a><h5>
<a name="id987714"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_38_0">Boost-1.38.0</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Added support for MPFR as a bignum type.
</li>
Added support for MPFR as a bignum type.
</li>
<li>
Added some full specializations of the policy classes to reduce compile
times.
</li>
Added some full specializations of the policy classes to reduce compile
times.
</li>
<li>
Added logistic distribution, from Gautam Sewani's Google Summer of
Code project.
</li>
Added logistic distribution, from Gautam Sewani's Google Summer of Code
project.
</li>
</ul></div>
<p>
<a name="math_toolkit.main_overview.history1.boost_1_37_0"></a>
</p>
<h5>
<a name="id985812"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_37_0">Boost-1.37.0</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.boost_1_37_0"></a><h5>
<a name="id987752"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_37_0">Boost-1.37.0</a>
</h5>
<div class="itemizedlist"><ul type="disc"><li>
Improved accuracy and testing of the inverse hypergeometric functions.
</li></ul></div>
<p>
<a name="math_toolkit.main_overview.history1.boost_1_36_0"></a>
</p>
<h5>
<a name="id985836"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_36_0">Boost-1.36.0</a>
</h5>
<p>
</p>
Improved accuracy and testing of the inverse hypergeometric functions.
</li></ul></div>
<a name="math_toolkit.main_overview.history1.boost_1_36_0"></a><h5>
<a name="id987776"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_36_0">Boost-1.36.0</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Added Noncentral Chi Squared Distribution.
</li>
Added Noncentral Chi Squared Distribution.
</li>
<li>
Added Noncentral Beta Distribution.
</li>
Added Noncentral Beta Distribution.
</li>
<li>
Added Noncentral F Distribution.
</li>
Added Noncentral F Distribution.
</li>
<li>
Added Noncentral T Distribution.
</li>
Added Noncentral T Distribution.
</li>
<li>
Added Exponential Integral Functions.
</li>
Added Exponential Integral Functions.
</li>
<li>
Added Zeta Function.
</li>
Added Zeta Function.
</li>
<li>
Added Rounding and Truncation functions.
</li>
Added Rounding and Truncation functions.
</li>
<li>
Added Compile time powers of runtime bases.
</li>
Added Compile time powers of runtime bases.
</li>
</ul></div>
<p>
<a name="math_toolkit.main_overview.history1.boost_1_35_0__post_review_first_official_release"></a>
</p>
<h5>
<a name="id985910"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_35_0__post_review_first_official_release">Boost-1.35.0:
Post Review First Official Release</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.boost_1_35_0__post_review_first_official_release"></a><h5>
<a name="id987851"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_35_0__post_review_first_official_release">Boost-1.35.0:
Post Review First Official Release</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Added Policy based framework that allows fine grained control over
function behaviour.
</li>
Added Policy based framework that allows fine grained control over function
behaviour.
</li>
<li>
<span class="bold"><strong>Breaking change:</strong></span> Changed default behaviour
for domain, pole and overflow errors to throw an exception (based on
review feedback), this behaviour can be customised using <a class="link" href="../policy.html" title="Policies">Policy</a>'s.
</li>
<span class="bold"><strong>Breaking change:</strong></span> Changed default behaviour
for domain, pole and overflow errors to throw an exception (based on
review feedback), this behaviour can be customised using <a class="link" href="../policy.html" title="Policies">Policy</a>'s.
</li>
<li>
<span class="bold"><strong>Breaking change:</strong></span> Changed exception
thrown when an internal evaluation error occurs to boost::math::evaluation_error.
</li>
<span class="bold"><strong>Breaking change:</strong></span> Changed exception thrown
when an internal evaluation error occurs to boost::math::evaluation_error.
</li>
<li>
<span class="bold"><strong>Breaking change:</strong></span> Changed discrete
quantiles to return an integer result: this is anything up to 20 times
faster than finding the true root, this behaviour can be customised
using <a class="link" href="../policy.html" title="Policies">Policy</a>'s.
</li>
<span class="bold"><strong>Breaking change:</strong></span> Changed discrete quantiles
to return an integer result: this is anything up to 20 times faster than
finding the true root, this behaviour can be customised using <a class="link" href="../policy.html" title="Policies">Policy</a>'s.
</li>
<li>
Polynomial/rational function evaluation is now customisable and hopefully
faster than before.
</li>
Polynomial/rational function evaluation is now customisable and hopefully
faster than before.
</li>
<li>
Added performance test program.
</li>
Added performance test program.
</li>
</ul></div>
<p>
<a name="math_toolkit.main_overview.history1.milestone_4__second_review_candidate__1st_march_2007_"></a>
</p>
<h5>
<a name="id985994"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_4__second_review_candidate__1st_march_2007_">Milestone
4: Second Review Candidate (1st March 2007)</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.milestone_4__second_review_candidate__1st_march_2007_"></a><h5>
<a name="id987935"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_4__second_review_candidate__1st_march_2007_">Milestone
4: Second Review Candidate (1st March 2007)</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Moved Xiaogang Zhang's Bessel Functions code into the library, and
brought them into line with the rest of the code.
</li>
Moved Xiaogang Zhang's Bessel Functions code into the library, and brought
them into line with the rest of the code.
</li>
<li>
Added C# "Distribution Explorer" demo application.
</li>
Added C# "Distribution Explorer" demo application.
</li>
</ul></div>
<p>
<a name="math_toolkit.main_overview.history1.milestone_3__first_review_candidate__31st_dec_2006_"></a>
</p>
<h5>
<a name="id986026"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_3__first_review_candidate__31st_dec_2006_">Milestone
3: First Review Candidate (31st Dec 2006)</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.milestone_3__first_review_candidate__31st_dec_2006_"></a><h5>
<a name="id987966"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_3__first_review_candidate__31st_dec_2006_">Milestone
3: First Review Candidate (31st Dec 2006)</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Implemented the main probability distribution and density functions.
</li>
Implemented the main probability distribution and density functions.
</li>
<li>
Implemented digamma.
</li>
Implemented digamma.
</li>
<li>
Added more factorial functions.
</li>
Added more factorial functions.
</li>
<li>
Implemented the Hermite, Legendre and Laguerre polynomials plus the
spherical harmonic functions from TR1.
</li>
Implemented the Hermite, Legendre and Laguerre polynomials plus the spherical
harmonic functions from TR1.
</li>
<li>
Moved Xiaogang Zhang's elliptic integral code into the library, and
brought them into line with the rest of the code.
</li>
Moved Xiaogang Zhang's elliptic integral code into the library, and brought
them into line with the rest of the code.
</li>
<li>
Moved Hubert Holin's existing Boost.Math special functions into this
library and brought them into line with the rest of the code.
</li>
Moved Hubert Holin's existing Boost.Math special functions into this
library and brought them into line with the rest of the code.
</li>
</ul></div>
<p>
<a name="math_toolkit.main_overview.history1.milestone_2__released_september_10th_2006"></a>
</p>
<h5>
<a name="id986086"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_2__released_september_10th_2006">Milestone
2: Released September 10th 2006</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.milestone_2__released_september_10th_2006"></a><h5>
<a name="id988026"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_2__released_september_10th_2006">Milestone
2: Released September 10th 2006</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Implement preview release of the statistical distributions.
</li>
Implement preview release of the statistical distributions.
</li>
<li>
Added statistical distributions tutorial.
</li>
Added statistical distributions tutorial.
</li>
<li>
Implemented root finding algorithms.
</li>
Implemented root finding algorithms.
</li>
<li>
Implemented the inverses of the incomplete gamma and beta functions.
</li>
Implemented the inverses of the incomplete gamma and beta functions.
</li>
<li>
Rewrite erf/erfc as rational approximations (valid to 128-bit precision).
</li>
Rewrite erf/erfc as rational approximations (valid to 128-bit precision).
</li>
<li>
Integrated the statistical results generated from the test data with
Boost.Test: uses a database of expected results, indexed by test, floating
point type, platform, and compiler.
</li>
Integrated the statistical results generated from the test data with
Boost.Test: uses a database of expected results, indexed by test, floating
point type, platform, and compiler.
</li>
<li>
Improved lgamma near 1 and 2 (rational approximations).
</li>
Improved lgamma near 1 and 2 (rational approximations).
</li>
<li>
Improved erf/erfc inverses (rational approximations).
</li>
Improved erf/erfc inverses (rational approximations).
</li>
<li>
Implemented Rational function generation (the Remez method).
</li>
Implemented Rational function generation (the Remez method).
</li>
</ul></div>
<p>
<a name="math_toolkit.main_overview.history1.milestone_1__released_march_31st_2006"></a>
</p>
<h5>
<a name="id986167"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_1__released_march_31st_2006">Milestone
1: Released March 31st 2006</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.history1.milestone_1__released_march_31st_2006"></a><h5>
<a name="id988107"></a>
<a class="link" href="history1.html#math_toolkit.main_overview.history1.milestone_1__released_march_31st_2006">Milestone
1: Released March 31st 2006</a>
</h5>
<div class="itemizedlist"><ul type="disc">
<li>
Implement gamma/beta/erf functions along with their incomplete counterparts.
</li>
Implement gamma/beta/erf functions along with their incomplete counterparts.
</li>
<li>
Generate high quality test data, against which future improvements
can be judged.
</li>
Generate high quality test data, against which future improvements can
be judged.
</li>
<li>
Provide tools for the evaluation of infinite series, continued fractions,
and rational functions.
</li>
Provide tools for the evaluation of infinite series, continued fractions,
and rational functions.
</li>
<li>
Provide tools for testing against tabulated test data, and collecting
statistics on error rates.
</li>
Provide tools for testing against tabulated test data, and collecting
statistics on error rates.
</li>
<li>
Provide sufficient docs for people to be able to find their way around
the library.
</li>
Provide sufficient docs for people to be able to find their way around
the library.
</li>
</ul></div>
<p>
</p>
<p>
SVN Revisions:
</p>
<p>
</p>
<p>
Sandbox and trunk last synchonised at revision: 48300.
</p>
SVN Revisions:
</p>
<p>
Sandbox and trunk last synchonised at revision: 48300.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,13 +17,13 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.intro"></a><a class="link" href="intro.html" title="About the Math Toolkit"> About the Math Toolkit</a>
<a name="math_toolkit.main_overview.intro"></a><a class="link" href="intro.html" title="About the Math Toolkit">About the Math Toolkit</a>
</h3></div></div></div>
<p>
This library is divided into three interconnected parts:
</p>
<a name="math_toolkit.main_overview.intro.statistical_distributions"></a><h5>
<a name="id968997"></a>
<a name="id970207"></a>
<a class="link" href="intro.html#math_toolkit.main_overview.intro.statistical_distributions">Statistical
Distributions</a>
</h5>
@ -49,7 +49,7 @@
tests.
</p>
<a name="math_toolkit.main_overview.intro.mathematical_special_functions"></a><h5>
<a name="id969081"></a>
<a name="id970291"></a>
<a class="link" href="intro.html#math_toolkit.main_overview.intro.mathematical_special_functions">Mathematical
Special Functions</a>
</h5>
@ -76,7 +76,7 @@
<span class="keyword">double</span></code>.
</p>
<a name="math_toolkit.main_overview.intro.implementation_toolkit"></a><h5>
<a name="id969148"></a>
<a name="id970358"></a>
<a class="link" href="intro.html#math_toolkit.main_overview.intro.implementation_toolkit">Implementation
Toolkit</a>
</h5>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.namespaces"></a><a class="link" href="namespaces.html" title="Namespaces"> Namespaces</a>
<a name="math_toolkit.main_overview.namespaces"></a><a class="link" href="namespaces.html" title="Namespaces">Namespaces</a>
</h3></div></div></div>
<p>
All math functions and distributions are in <code class="computeroutput"><span class="keyword">namespace</span>

View File

@ -17,14 +17,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.navigation"></a><a class="link" href="navigation.html" title="Navigation"> Navigation</a>
<a name="math_toolkit.main_overview.navigation"></a><a class="link" href="navigation.html" title="Navigation">Navigation</a>
</h3></div></div></div>
<p>
Used in combination with the configured browser key, the following keys act
as handy shortcuts for common navigation tasks.
</p>
<a name="math_toolkit.main_overview.navigation.shortcuts"></a><h6>
<a name="id969249"></a>
<a name="id970459"></a>
<a class="link" href="navigation.html#math_toolkit.main_overview.navigation.shortcuts">Shortcuts</a>
</h6>
<div class="blockquote"><blockquote class="blockquote">

View File

@ -17,56 +17,44 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.perf_over"></a><a class="link" href="perf_over.html" title="Performance"> Performance</a>
<a name="math_toolkit.main_overview.perf_over"></a><a class="link" href="perf_over.html" title="Performance">Performance</a>
</h3></div></div></div>
<p>
</p>
By and large the performance of this library should be acceptable for most
needs. However, you should note that the library's primary emphasis is on
accuracy and numerical stability, and <span class="emphasis"><em>not</em></span> speed.
</p>
<p>
By and large the performance of this library should be acceptable for most
needs. However, you should note that the library's primary emphasis is
on accuracy and numerical stability, and <span class="emphasis"><em>not</em></span> speed.
</p>
In terms of the algorithms used, this library aims to use the same "best
of breed" algorithms as many other libraries: the principle difference
is that this library is implemented in C++ - taking advantage of all the
abstraction mechanisms that C++ offers - where as most traditional numeric
libraries are implemented in C or FORTRAN. Traditionally languages such as
C or FORTRAN are perceived as easier to optimise than more complex languages
like C++, so in a sense this library provides a good test of current compiler
technology, and the "abstraction penalty" - if any - of C++ compared
to other languages.
</p>
<p>
</p>
<p>
In terms of the algorithms used, this library aims to use the same "best
of breed" algorithms as many other libraries: the principle difference
is that this library is implemented in C++ - taking advantage of all the
abstraction mechanisms that C++ offers - where as most traditional numeric
libraries are implemented in C or FORTRAN. Traditionally languages such
as C or FORTRAN are perceived as easier to optimise than more complex languages
like C++, so in a sense this library provides a good test of current compiler
technology, and the "abstraction penalty" - if any - of C++ compared
to other languages.
</p>
<p>
</p>
<p>
The two most important things you can do to ensure the best performance
from this library are:
</p>
<p>
</p>
The two most important things you can do to ensure the best performance from
this library are:
</p>
<div class="orderedlist"><ol type="1">
<li>
Turn on your compilers optimisations: the difference between "release"
and "debug" builds can easily be a <a class="link" href="../perf/getting_best.html" title="Getting the Best Performance from this Library">factor
of 20</a>.
</li>
Turn on your compilers optimisations: the difference between "release"
and "debug" builds can easily be a <a class="link" href="../perf/getting_best.html" title="Getting the Best Performance from this Library">factor
of 20</a>.
</li>
<li>
Pick your compiler carefully: <a class="link" href="../perf/comp_compilers.html" title="Comparing Compilers">performance
differences of up to 8 fold</a> have been found between some windows
compilers for example.
</li>
Pick your compiler carefully: <a class="link" href="../perf/comp_compilers.html" title="Comparing Compilers">performance
differences of up to 8 fold</a> have been found between some windows
compilers for example.
</li>
</ol></div>
<p>
</p>
<p>
The <a class="link" href="../perf.html" title="Performance">performance section</a> contains
more information on the performance of this library, what you can do to
fine tune it, and how this library compares to some other open source alternatives.
</p>
<p>
The <a class="link" href="../perf.html" title="Performance">performance section</a> contains
more information on the performance of this library, what you can do to fine
tune it, and how this library compares to some other open source alternatives.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

View File

@ -17,100 +17,82 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.pol_overview"></a><a class="link" href="pol_overview.html" title="Configuration and Policies"> Configuration
<a name="math_toolkit.main_overview.pol_overview"></a><a class="link" href="pol_overview.html" title="Configuration and Policies">Configuration
and Policies</a>
</h3></div></div></div>
<p>
</p>
<p>
Policies are a powerful fine-grain mechanism that allow you to customise
the behaviour of this library according to your needs. There is more information
available in the <a class="link" href="../policy/pol_tutorial.html" title="Policy Tutorial">policy
tutorial</a> and the <a class="link" href="../policy/pol_ref.html" title="Policy Reference">policy
reference</a>.
</p>
<p>
</p>
<p>
Generally speaking unless you find that the <a class="link" href="../policy/pol_tutorial/policy_tut_defaults.html" title="Policies Have Sensible Defaults">default
policy behaviour</a> when encountering 'bad' argument values does not
meet your needs, you should not need to worry about policies.
</p>
<p>
</p>
<p>
Policies are a compile-time mechanism that allow you to change error-handling
or calculation precision either program wide, or at the call site.
</p>
<p>
</p>
<p>
Although the policy mechanism itself is rather complicated, in practice
it is easy to use, and very flexible.
</p>
<p>
</p>
<p>
Using policies you can control:
</p>
<p>
</p>
<div class="itemizedlist"><ul type="disc">
<li>
<a class="link" href="../policy/pol_ref/error_handling_policies.html" title="Error Handling Policies">How
results from 'bad' arguments are handled</a>, including those that
cannot be fully evaluated.
</li>
<li>
How <a class="link" href="../policy/pol_ref/internal_promotion.html" title="Internal Promotion Policies">accuracy
is controlled by internal promotion</a> to use more precise types.
</li>
<li>
What working <a class="link" href="../policy/pol_ref/precision_pol.html" title="Precision Policies">precision</a>
should be used to calculate results.
</li>
<li>
What to do when a <a class="link" href="../policy/pol_ref/assert_undefined.html" title="Mathematically Undefined Function Policies">mathematically
undefined function</a> is used: Should this raise a run-time or
compile-time error?
</li>
<li>
Whether <a class="link" href="../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">discrete
functions</a>, like the binomial, should return real or only integral
values, and how they are rounded.
</li>
<li>
How many iterations a special function is permitted to perform in a
series evaluation or root finding algorithm before it gives up and
raises an <a class="link" href="error_handling.html#evaluation_error">evaluation_error</a>.
</li>
</ul></div>
<p>
</p>
<p>
You can control policies:
</p>
<p>
</p>
<div class="itemizedlist"><ul type="disc">
<li>
Using <a class="link" href="../policy/pol_ref/policy_defaults.html" title="Using macros to Change the Policy Defaults">macros</a>
to change any default policy: the is the prefered method for installation
wide policies.
</li>
<li>
At your chosen <a class="link" href="../policy/pol_ref/namespace_pol.html" title="Setting Polices at Namespace Scope">namespace
scope</a> for distributions and/or functions: this is the prefered
method for project, namespace, or translation unit scope policies.
</li>
<li>
In an ad-hoc manner <a class="link" href="../policy/pol_tutorial/ad_hoc_sf_policies.html" title="Changing the Policy on an Ad Hoc Basis for the Special Functions">by
passing a specific policy to a special function</a>, or to a <a class="link" href="../policy/pol_tutorial/ad_hoc_dist_policies.html" title="Setting Policies for Distributions on an Ad Hoc Basis">statistical
distribution</a>.
</li>
</ul></div>
<p>
Policies are a powerful fine-grain mechanism that allow you to customise
the behaviour of this library according to your needs. There is more information
available in the <a class="link" href="../policy/pol_tutorial.html" title="Policy Tutorial">policy
tutorial</a> and the <a class="link" href="../policy/pol_ref.html" title="Policy Reference">policy
reference</a>.
</p>
<p>
Generally speaking unless you find that the <a class="link" href="../policy/pol_tutorial/policy_tut_defaults.html" title="Policies Have Sensible Defaults">default
policy behaviour</a> when encountering 'bad' argument values does not
meet your needs, you should not need to worry about policies.
</p>
<p>
Policies are a compile-time mechanism that allow you to change error-handling
or calculation precision either program wide, or at the call site.
</p>
<p>
Although the policy mechanism itself is rather complicated, in practice it
is easy to use, and very flexible.
</p>
<p>
Using policies you can control:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
<a class="link" href="../policy/pol_ref/error_handling_policies.html" title="Error Handling Policies">How
results from 'bad' arguments are handled</a>, including those that
cannot be fully evaluated.
</li>
<li>
How <a class="link" href="../policy/pol_ref/internal_promotion.html" title="Internal Promotion Policies">accuracy
is controlled by internal promotion</a> to use more precise types.
</li>
<li>
What working <a class="link" href="../policy/pol_ref/precision_pol.html" title="Precision Policies">precision</a>
should be used to calculate results.
</li>
<li>
What to do when a <a class="link" href="../policy/pol_ref/assert_undefined.html" title="Mathematically Undefined Function Policies">mathematically
undefined function</a> is used: Should this raise a run-time or compile-time
error?
</li>
<li>
Whether <a class="link" href="../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">discrete
functions</a>, like the binomial, should return real or only integral
values, and how they are rounded.
</li>
<li>
How many iterations a special function is permitted to perform in a series
evaluation or root finding algorithm before it gives up and raises an
<a class="link" href="error_handling.html#evaluation_error">evaluation_error</a>.
</li>
</ul></div>
<p>
You can control policies:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
Using <a class="link" href="../policy/pol_ref/policy_defaults.html" title="Using macros to Change the Policy Defaults">macros</a>
to change any default policy: the is the prefered method for installation
wide policies.
</li>
<li>
At your chosen <a class="link" href="../policy/pol_ref/namespace_pol.html" title="Setting Polices at Namespace Scope">namespace
scope</a> for distributions and/or functions: this is the prefered
method for project, namespace, or translation unit scope policies.
</li>
<li>
In an ad-hoc manner <a class="link" href="../policy/pol_tutorial/ad_hoc_sf_policies.html" title="Changing the Policy on an Ad Hoc Basis for the Special Functions">by
passing a specific policy to a special function</a>, or to a <a class="link" href="../policy/pol_tutorial/ad_hoc_dist_policies.html" title="Setting Policies for Distributions on an Ad Hoc Basis">statistical
distribution</a>.
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,8 +17,8 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.result_type"></a><a class="link" href="result_type.html" title="Calculation of the Type of the Result"> Calculation
of the Type of the Result</a>
<a name="math_toolkit.main_overview.result_type"></a><a class="link" href="result_type.html" title="Calculation of the Type of the Result">Calculation of
the Type of the Result</a>
</h3></div></div></div>
<p>
The functions in this library are all overloaded to accept mixed floating

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.threads"></a><a class="link" href="threads.html" title="Thread Safety"> Thread Safety</a>
<a name="math_toolkit.main_overview.threads"></a><a class="link" href="threads.html" title="Thread Safety">Thread Safety</a>
</h3></div></div></div>
<p>
The library is fully thread safe and re-entrant provided the function and

View File

@ -17,85 +17,67 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.main_overview.tr1"></a><a class="link" href="tr1.html" title="C99 and TR1 C Functions"> C99 and TR1 C Functions</a>
<a name="math_toolkit.main_overview.tr1"></a><a class="link" href="tr1.html" title="C99 and TR1 C Functions">C99 and TR1 C Functions</a>
</h3></div></div></div>
<p>
</p>
Many of the special functions included in this library are also a part of
the either the C99 standard or the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
Report on C++ Library Extensions</a>. Therefore this library includes
a thin wrapper header <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">tr1</span><span class="special">.</span><span class="identifier">hpp</span></code>
that provides compatibility with these two standards.
</p>
<p>
Many of the special functions included in this library are also a part
of the either the C99 standard or the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
Report on C++ Library Extensions</a>. Therefore this library includes
a thin wrapper header <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">tr1</span><span class="special">.</span><span class="identifier">hpp</span></code>
that provides compatibility with these two standards.
</p>
There are various pros and cons to using the library in this way:
</p>
<p>
</p>
<p>
There are various pros and cons to using the library in this way:
</p>
<p>
</p>
<p>
Pros:
</p>
<p>
</p>
Pros:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
The header to include is lightweight (i.e. fast to compile).
</li>
The header to include is lightweight (i.e. fast to compile).
</li>
<li>
The functions have extern "C" linkage, and so are usable
from other languages.
</li>
The functions have extern "C" linkage, and so are usable from
other languages.
</li>
<li>
Standard compatibility.
</li>
Standard compatibility.
</li>
</ul></div>
<p>
</p>
<p>
Cons:
</p>
<p>
</p>
Cons:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
You will need to compile and link to the external Boost.Math libraries.
</li>
You will need to compile and link to the external Boost.Math libraries.
</li>
<li>
Limited to support for the types, <code class="computeroutput"><span class="keyword">float</span></code>,
<code class="computeroutput"><span class="keyword">double</span></code> and <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">double</span></code>.
</li>
Limited to support for the types, <code class="computeroutput"><span class="keyword">float</span></code>,
<code class="computeroutput"><span class="keyword">double</span></code> and <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">double</span></code>.
</li>
<li>
Error handling is handled via setting ::errno and returning NaN's and
infinities: this may be less flexible than an C++ exception based approach.
</li>
Error handling is handled via setting ::errno and returning NaN's and
infinities: this may be less flexible than an C++ exception based approach.
</li>
</ul></div>
<p>
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
The separate libraries are required <span class="bold"><strong>only</strong></span>
if you choose to use boost/math/tr1.hpp rather than some other Boost.Math
header, the rest of Boost.Math remains header-only.
</p></td></tr>
The separate libraries are required <span class="bold"><strong>only</strong></span>
if you choose to use boost/math/tr1.hpp rather than some other Boost.Math
header, the rest of Boost.Math remains header-only.
</p></td></tr>
</table></div>
<p>
</p>
<p>
The separate libraries required in order to use tr1.hpp can be compiled
using bjam from within the libs/math/build directory, or from the Boost
root directory using the usual Boost-wide install procedure. Alternatively
the source files are located in libs/math/src and each have the same name
as the function they implement. The various libraries are named as follows:
</p>
<p>
</p>
The separate libraries required in order to use tr1.hpp can be compiled using
bjam from within the libs/math/build directory, or from the Boost root directory
using the usual Boost-wide install procedure. Alternatively the source files
are located in libs/math/src and each have the same name as the function
they implement. The various libraries are named as follows:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@ -104,140 +86,136 @@
</colgroup>
<thead><tr>
<th>
<p>
Name
</p>
</th>
<p>
Name
</p>
</th>
<th>
<p>
Type
</p>
</th>
<p>
Type
</p>
</th>
<th>
<p>
Functions
</p>
</th>
<p>
Functions
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
boost_math_c99f-&lt;suffix&gt;
</p>
</td>
<p>
boost_math_c99f-&lt;suffix&gt;
</p>
</td>
<td>
<p>
float
</p>
</td>
<p>
float
</p>
</td>
<td>
<p>
C99 Functions
</p>
</td>
<p>
C99 Functions
</p>
</td>
</tr>
<tr>
<td>
<p>
boost_math_c99-&lt;suffix&gt;
</p>
</td>
<p>
boost_math_c99-&lt;suffix&gt;
</p>
</td>
<td>
<p>
double
</p>
</td>
<p>
double
</p>
</td>
<td>
<p>
C99 Functions
</p>
</td>
<p>
C99 Functions
</p>
</td>
</tr>
<tr>
<td>
<p>
boost_math_c99l-&lt;suffix&gt;
</p>
</td>
<p>
boost_math_c99l-&lt;suffix&gt;
</p>
</td>
<td>
<p>
long double
</p>
</td>
<p>
long double
</p>
</td>
<td>
<p>
C99 Functions
</p>
</td>
<p>
C99 Functions
</p>
</td>
</tr>
<tr>
<td>
<p>
boost_math_tr1f-&lt;suffix&gt;
</p>
</td>
<p>
boost_math_tr1f-&lt;suffix&gt;
</p>
</td>
<td>
<p>
float
</p>
</td>
<p>
float
</p>
</td>
<td>
<p>
TR1 Functions
</p>
</td>
<p>
TR1 Functions
</p>
</td>
</tr>
<tr>
<td>
<p>
boost_math_tr1-&lt;suffix&gt;
</p>
</td>
<p>
boost_math_tr1-&lt;suffix&gt;
</p>
</td>
<td>
<p>
double
</p>
</td>
<p>
double
</p>
</td>
<td>
<p>
TR1 Functions
</p>
</td>
<p>
TR1 Functions
</p>
</td>
</tr>
<tr>
<td>
<p>
boost_math_tr1l-&lt;suffix&gt;
</p>
</td>
<p>
boost_math_tr1l-&lt;suffix&gt;
</p>
</td>
<td>
<p>
long double
</p>
</td>
<p>
long double
</p>
</td>
<td>
<p>
TR1 Functions
</p>
</td>
<p>
TR1 Functions
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p>
Where <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">suffix</span><span class="special">&gt;</span></code> encodes the compiler and build options
used to build the libraries: for example "libboost_math_tr1-vc80-mt-gd.lib"
would be the statically linked TR1 library to use with Visual C++ 8.0,
in multithreading debug mode, with the DLL VC++ runtime, where as "boost_math_tr1-vc80-mt.lib"
would be import library for the TR1 DLL to be used with Visual C++ 8.0
with the release multithreaded DLL VC++ runtime. Refer to the getting started
guide for a <a href="http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html#library-naming" target="_top">full
explanation of the <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">suffix</span><span class="special">&gt;</span></code> meanings</a>.
</p>
<p>
</p>
Where <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">suffix</span><span class="special">&gt;</span></code> encodes the compiler and build options
used to build the libraries: for example "libboost_math_tr1-vc80-mt-gd.lib"
would be the statically linked TR1 library to use with Visual C++ 8.0, in
multithreading debug mode, with the DLL VC++ runtime, where as "boost_math_tr1-vc80-mt.lib"
would be import library for the TR1 DLL to be used with Visual C++ 8.0 with
the release multithreaded DLL VC++ runtime. Refer to the getting started
guide for a <a href="http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html#library-naming" target="_top">full
explanation of the <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">suffix</span><span class="special">&gt;</span></code> meanings</a>.
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../images/note.png"></td>
@ -245,103 +223,79 @@
</tr>
<tr><td align="left" valign="top">
<p>
Visual C++ users will typically have the correct library variant to link
against selected for them by boost/math/tr1.hpp based on your compiler
settings.
</p>
Visual C++ users will typically have the correct library variant to link
against selected for them by boost/math/tr1.hpp based on your compiler
settings.
</p>
<p>
Users will need to define BOOST_MATH_TR1_DYN_LINK when building their
code if they want to link against the DLL versions of these libraries
rather than the static versions.
</p>
Users will need to define BOOST_MATH_TR1_DYN_LINK when building their code
if they want to link against the DLL versions of these libraries rather
than the static versions.
</p>
<p>
Users can disable auto-linking by defining BOOST_MATH_TR1_NO_LIB when
building: this is typically only used when linking against a customised
build of the libraries.
</p>
Users can disable auto-linking by defining BOOST_MATH_TR1_NO_LIB when building:
this is typically only used when linking against a customised build of
the libraries.
</p>
</td></tr>
</table></div>
<p>
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
Linux and Unix users will generally only have one variant of these libraries
installed, and can generally just link against -lboost_math_tr1 etc.
</p></td></tr>
Linux and Unix users will generally only have one variant of these libraries
installed, and can generally just link against -lboost_math_tr1 etc.
</p></td></tr>
</table></div>
<a name="math_toolkit.main_overview.tr1.usage_recomendations"></a><h5>
<a name="id988572"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.usage_recomendations">Usage
Recomendations</a>
</h5>
<p>
<a name="math_toolkit.main_overview.tr1.usage_recomendations"></a>
</p>
<h5>
<a name="id986634"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.usage_recomendations">Usage
Recomendations</a>
</h5>
<p>
</p>
<p>
This library now presents the user with a choice:
</p>
<p>
</p>
This library now presents the user with a choice:
</p>
<div class="itemizedlist"><ul type="disc">
<li>
To include the header only versions of the functions and have an easier
time linking, but a longer compile time.
</li>
To include the header only versions of the functions and have an easier
time linking, but a longer compile time.
</li>
<li>
To include the TR1 headers and link against an external library.
</li>
To include the TR1 headers and link against an external library.
</li>
</ul></div>
<p>
</p>
Which option you choose depends largely on how you prefer to work and how
your system is set up.
</p>
<p>
Which option you choose depends largely on how you prefer to work and how
your system is set up.
</p>
For example a casual user who just needs the acosh function, would probably
be better off including <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">special_functions</span><span class="special">/</span><span class="identifier">acosh</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
and using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">acosh</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code> in their
code.
</p>
<p>
</p>
However, for large scale software development where compile times are significant,
and where the Boost libraries are already built and installed on the system,
then including <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">tr1</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> and using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">tr1</span><span class="special">::</span><span class="identifier">acosh</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code> will
speed up compile times, reduce object files sizes (since there are no templates
being instantiated any more), and also speed up debugging runtimes - since
the externally compiled libraries can be compiler optimised, rather than
built using full settings - the difference in performance between <a class="link" href="../perf/getting_best.html" title="Getting the Best Performance from this Library">release
and debug builds can be as much as 20 times</a>, so for complex applications
this can be a big win.
</p>
<a name="math_toolkit.main_overview.tr1.supported_c99_functions"></a><h5>
<a name="id988775"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.supported_c99_functions">Supported
C99 Functions</a>
</h5>
<p>
For example a casual user who just needs the acosh function, would probably
be better off including <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">special_functions</span><span class="special">/</span><span class="identifier">acosh</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
and using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">acosh</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code> in
their code.
</p>
<p>
</p>
<p>
However, for large scale software development where compile times are significant,
and where the Boost libraries are already built and installed on the system,
then including <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">tr1</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> and using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">tr1</span><span class="special">::</span><span class="identifier">acosh</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code>
will speed up compile times, reduce object files sizes (since there are
no templates being instantiated any more), and also speed up debugging
runtimes - since the externally compiled libraries can be compiler optimised,
rather than built using full settings - the difference in performance between
<a class="link" href="../perf/getting_best.html" title="Getting the Best Performance from this Library">release and debug builds
can be as much as 20 times</a>, so for complex applications this can
be a big win.
</p>
<p>
<a name="math_toolkit.main_overview.tr1.supported_c99_functions"></a>
</p>
<h5>
<a name="id986837"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.supported_c99_functions">Supported
C99 Functions</a>
</h5>
<p>
</p>
<p>
See also the <a class="link" href="../special/extern_c/c99.html" title="C99 C Functions">quick reference
guide for these functions</a>.
</p>
<p>
</p>
See also the <a class="link" href="../special/extern_c/c99.html" title="C99 C Functions">quick reference
guide for these functions</a>.
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">tr1</span><span class="special">{</span> <span class="keyword">extern</span> <span class="string">"C"</span><span class="special">{</span>
<span class="keyword">typedef</span> <span class="identifier">unspecified</span> <span class="identifier">float_t</span><span class="special">;</span>
@ -429,23 +383,15 @@
<span class="special">}}}}</span> <span class="comment">// namespaces
</span></pre>
<a name="math_toolkit.main_overview.tr1.supported_tr1_functions"></a><h5>
<a name="id991043"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.supported_tr1_functions">Supported
TR1 Functions</a>
</h5>
<p>
<a name="math_toolkit.main_overview.tr1.supported_tr1_functions"></a>
</p>
<h5>
<a name="id989750"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.supported_tr1_functions">Supported
TR1 Functions</a>
</h5>
<p>
</p>
<p>
See also the <a class="link" href="../special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">quick reference
guide for these functions</a>.
</p>
<p>
</p>
See also the <a class="link" href="../special/extern_c/tr1.html" title="C99 and TR1 C Functions Overview">quick reference
guide for these functions</a>.
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">tr1</span><span class="special">{</span> <span class="keyword">extern</span> <span class="string">"C"</span><span class="special">{</span>
<span class="comment">// [5.2.1.1] associated Laguerre polynomials:
@ -558,27 +504,19 @@
<span class="special">}}}}</span> <span class="comment">// namespaces
</span></pre>
<p>
</p>
<p>
In addition sufficient additional overloads of the <code class="computeroutput"><span class="keyword">double</span></code>
versions of the above functions are provided, so that calling the function
with any mixture of <code class="computeroutput"><span class="keyword">float</span></code>,
<code class="computeroutput"><span class="keyword">double</span></code>, <code class="computeroutput"><span class="keyword">long</span>
<span class="keyword">double</span></code>, or <span class="emphasis"><em>integer</em></span>
arguments is supported, with the return type determined by the <a class="link" href="result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
type calculation rules</em></span></a>.
</p>
<p>
<a name="math_toolkit.main_overview.tr1.currently_unsupported_c99_functions"></a>
</p>
<h5>
<a name="id993716"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.currently_unsupported_c99_functions">Currently
Unsupported C99 Functions</a>
</h5>
<p>
</p>
In addition sufficient additional overloads of the <code class="computeroutput"><span class="keyword">double</span></code>
versions of the above functions are provided, so that calling the function
with any mixture of <code class="computeroutput"><span class="keyword">float</span></code>,
<code class="computeroutput"><span class="keyword">double</span></code>, <code class="computeroutput"><span class="keyword">long</span>
<span class="keyword">double</span></code>, or <span class="emphasis"><em>integer</em></span>
arguments is supported, with the return type determined by the <a class="link" href="result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result
type calculation rules</em></span></a>.
</p>
<a name="math_toolkit.main_overview.tr1.currently_unsupported_c99_functions"></a><h5>
<a name="id995556"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.currently_unsupported_c99_functions">Currently
Unsupported C99 Functions</a>
</h5>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">exp2</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">x</span><span class="special">);</span>
<span class="keyword">float</span> <span class="identifier">exp2f</span><span class="special">(</span><span class="keyword">float</span> <span class="identifier">x</span><span class="special">);</span>
<span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">exp2l</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">x</span><span class="special">);</span>
@ -639,17 +577,11 @@
<span class="keyword">float</span> <span class="identifier">scalbnf</span><span class="special">(</span><span class="keyword">float</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">ex</span><span class="special">);</span>
<span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">scalbnl</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">ex</span><span class="special">);</span>
</pre>
<p>
<a name="math_toolkit.main_overview.tr1.currently_unsupported_tr1_functions"></a>
</p>
<h5>
<a name="id995383"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.currently_unsupported_tr1_functions">Currently
Unsupported TR1 Functions</a>
</h5>
<p>
</p>
<a name="math_toolkit.main_overview.tr1.currently_unsupported_tr1_functions"></a><h5>
<a name="id997223"></a>
<a class="link" href="tr1.html#math_toolkit.main_overview.tr1.currently_unsupported_tr1_functions">Currently
Unsupported TR1 Functions</a>
</h5>
<pre class="programlisting"><span class="comment">// [5.2.1.7] confluent hypergeometric functions:
</span><span class="keyword">double</span> <span class="identifier">conf_hyperg</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">c</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">x</span><span class="special">);</span>
<span class="keyword">float</span> <span class="identifier">conf_hypergf</span><span class="special">(</span><span class="keyword">float</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">float</span> <span class="identifier">c</span><span class="special">,</span> <span class="keyword">float</span> <span class="identifier">x</span><span class="special">);</span>
@ -661,8 +593,6 @@
<span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">hypergl</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">a</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">b</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">c</span><span class="special">,</span>
<span class="keyword">long</span> <span class="keyword">double</span> <span class="identifier">x</span><span class="special">);</span>
</pre>
<p>
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>

View File

@ -17,18 +17,18 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="math_toolkit.perf"></a><a class="link" href="perf.html" title="Performance"> Performance</a>
<a name="math_toolkit.perf"></a><a class="link" href="perf.html" title="Performance">Performance</a>
</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="section"><a href="perf/perf_over.html"> Performance Overview</a></span></dt>
<dt><span class="section"><a href="perf/interp.html"> Interpreting these Results</a></span></dt>
<dt><span class="section"><a href="perf/getting_best.html"> Getting the Best Performance
<dt><span class="section"><a href="perf/perf_over.html">Performance Overview</a></span></dt>
<dt><span class="section"><a href="perf/interp.html">Interpreting these Results</a></span></dt>
<dt><span class="section"><a href="perf/getting_best.html">Getting the Best Performance
from this Library</a></span></dt>
<dt><span class="section"><a href="perf/comp_compilers.html"> Comparing Compilers</a></span></dt>
<dt><span class="section"><a href="perf/tuning.html"> Performance Tuning Macros</a></span></dt>
<dt><span class="section"><a href="perf/comparisons.html"> Comparisons to Other
Open Source Libraries</a></span></dt>
<dt><span class="section"><a href="perf/perf_test_app.html"> The Performance Test
<dt><span class="section"><a href="perf/comp_compilers.html">Comparing Compilers</a></span></dt>
<dt><span class="section"><a href="perf/tuning.html">Performance Tuning Macros</a></span></dt>
<dt><span class="section"><a href="perf/comparisons.html">Comparisons to Other Open
Source Libraries</a></span></dt>
<dt><span class="section"><a href="perf/perf_test_app.html">The Performance Test
Application</a></span></dt>
</dl></div>
</div>

View File

@ -17,7 +17,7 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="math_toolkit.perf.comp_compilers"></a><a class="link" href="comp_compilers.html" title="Comparing Compilers"> Comparing Compilers</a>
<a name="math_toolkit.perf.comp_compilers"></a><a class="link" href="comp_compilers.html" title="Comparing Compilers">Comparing Compilers</a>
</h3></div></div></div>
<p>
After a good choice of build settings the next most important thing you can
@ -28,7 +28,7 @@
in this respect).
</p>
<div class="table">
<a name="id1346148"></a><p class="title"><b>Table&#160;48.&#160;Performance Comparison of Various Windows Compilers</b></p>
<a name="id1345899"></a><p class="title"><b>Table&#160;48.&#160;Performance Comparison of Various Windows Compilers</b></p>
<div class="table-contents"><table class="table" summary="Performance Comparison of Various Windows Compilers">
<colgroup>
<col>

Some files were not shown because too many files have changed in this diff Show More