|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r77513 - in trunk: boost/math/special_functions/detail libs/math/doc/sf_and_dist libs/math/doc/sf_and_dist/html libs/math/doc/sf_and_dist/html/index libs/math/doc/sf_and_dist/html/math_toolkit/constants libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/nccs_eg libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example libs/math/doc/sf_and_dist/html/math_toolkit/main_overview libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial libs/math/doc/sf_and_dist/html/math_toolkit/status libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets libs/math/test
From: john_at_[hidden]
Date: 2012-03-24 07:59:26
Author: johnmaddock
Date: 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
New Revision: 77513
URL: http://svn.boost.org/trac/boost/changeset/77513
Log:
Fix numeric error in bessel_jy.hpp.
Remove some dead code from bessel_jy.hpp.
Add additional test cases for above bug.
Update and regenerate docs to match.
Text files modified:
trunk/boost/math/special_functions/detail/bessel_jy.hpp | 16 +++++---
trunk/libs/math/doc/sf_and_dist/html/index.html | 2
trunk/libs/math/doc/sf_and_dist/html/index/s13.html | 4 +-
trunk/libs/math/doc/sf_and_dist/html/index/s14.html | 4 +-
trunk/libs/math/doc/sf_and_dist/html/index/s15.html | 4 +-
trunk/libs/math/doc/sf_and_dist/html/index/s16.html | 4 +-
trunk/libs/math/doc/sf_and_dist/html/index/s17.html | 4 +-
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/constants/new_const.html | 1
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_coinflip_example.html | 39 ++++++++++++++-------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html | 71 +++++++++++++++++++++++++-------------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html | 45 ++++++++++++++++--------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/error_eg.html | 6 ++-
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html | 22 +++++++----
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html | 66 ++++++++++++++++++++++++------------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html | 24 ++++++++----
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/geometric_eg.html | 66 ++++++++++++++++++++++++------------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/inverse_chi_squared_eg.html | 6 +-
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/nccs_eg/nccs_power_eg.html | 18 ++++++---
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_conf.html | 13 ++++--
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html | 13 +++---
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html | 72 ++++++++++++++++++++++++++-------------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html | 64 +++++++++++++++++++++++------------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html | 40 +++++++++++++--------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html | 4 --
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html | 1
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html | 2 -
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/namespace_pol.html | 2 -
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/precision_pol.html | 2 -
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_dist_policies.html | 1
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_sf_policies.html | 2 -
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/changing_policy_defaults.html | 6 ++-
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/namespace_policies.html | 29 ++++++++++------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html | 9 +++-
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html | 51 ++++++++++++++++++---------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/history1.html | 40 +++++++++++++--------
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/examples.html | 1
trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/intro.html | 1
trunk/libs/math/doc/sf_and_dist/roadmap.qbk | 4 ++
trunk/libs/math/test/pch.hpp | 7 +--
trunk/libs/math/test/test_bessel_j.cpp | 10 +++++
trunk/libs/math/test/test_bessel_j.hpp | 7 ++-
trunk/libs/math/test/test_bessel_y.cpp | 10 +++++
trunk/libs/math/test/test_bessel_y.hpp | 5 ++
43 files changed, 510 insertions(+), 288 deletions(-)
Modified: trunk/boost/math/special_functions/detail/bessel_jy.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/bessel_jy.hpp (original)
+++ trunk/boost/math/special_functions/detail/bessel_jy.hpp 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -215,8 +215,6 @@
Cr = br + a / temp;
Dr = br;
Di = bi;
- //std::cout << "C = " << Cr << " " << Ci << std::endl;
- //std::cout << "D = " << Dr << " " << Di << std::endl;
if (fabs(Cr) + fabs(Ci) < tiny) { Cr = tiny; }
if (fabs(Dr) + fabs(Di) < tiny) { Dr = tiny; }
temp = Dr * Dr + Di * Di;
@@ -227,7 +225,6 @@
temp = fr;
fr = temp * delta_r - fi * delta_i;
fi = temp * delta_i + fi * delta_r;
- //std::cout << fr << " " << fi << std::endl;
for (k = 2; k < policies::get_max_series_iterations<Policy>(); k++)
{
a = k - 0.5f;
@@ -239,8 +236,6 @@
Ci = bi - a * Ci / temp;
Dr = br + a * Dr;
Di = bi + a * Di;
- //std::cout << "C = " << Cr << " " << Ci << std::endl;
- //std::cout << "D = " << Dr << " " << Di << std::endl;
if (fabs(Cr) + fabs(Ci) < tiny) { Cr = tiny; }
if (fabs(Dr) + fabs(Di) < tiny) { Dr = tiny; }
temp = Dr * Dr + Di * Di;
@@ -253,7 +248,6 @@
fi = temp * delta_i + fi * delta_r;
if (fabs(delta_r - 1) + fabs(delta_i) < tolerance)
break;
- //std::cout << fr << " " << fi << std::endl;
}
policies::check_series_iterations<T>("boost::math::bessel_jy<%1%>(%1%,%1%) in CF2_jy", k, pol);
*p = fr;
@@ -491,6 +485,16 @@
CF2_jy(u, x, &p, &q, pol); // continued fraction CF2_jy
T t = u / x - fu; // t = J'/J
gamma = (p - t) / q;
+ //
+ // We can't allow gamma to cancel out to zero competely as it messes up
+ // the subsequent logic. So pretend that one bit didn't cancel out
+ // and set to a suitably small value. The only test case we've been able to
+ // find for this, is when v = 8.5 and x = 4*PI.
+ //
+ if(gamma == 0)
+ {
+ gamma = u * tools::epsilon<T>() / x;
+ }
Ju = sign(current) * sqrt(W / (q + gamma * (p - t)));
Jv = Ju * ratio; // normalization
Modified: trunk/libs/math/doc/sf_and_dist/html/index.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/index.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/index.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -527,7 +527,7 @@
</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: January 27, 2012 at 18:59:48 GMT</small></p></td>
+<td align="left"><p><small>Last revised: March 24, 2012 at 11:48:31 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: trunk/libs/math/doc/sf_and_dist/html/index/s13.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/index/s13.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/index/s13.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -22,9 +22,9 @@
<div class="spirit-nav">
<a accesskey="p" href="../math_toolkit/status/credits.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="s14.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
-<div class="section id1486091">
+<div class="section id1487367">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1486091"></a>Function Index</h2></div></div></div>
+<a name="id1487367"></a>Function Index</h2></div></div></div>
<p><a class="link" href="s13.html#idx_id_0">A</a> <a class="link" href="s13.html#idx_id_1">B</a> <a class="link" href="s13.html#idx_id_2">C</a> <a class="link" href="s13.html#idx_id_3">D</a> <a class="link" href="s13.html#idx_id_4">E</a> <a class="link" href="s13.html#idx_id_5">F</a> <a class="link" href="s13.html#idx_id_6">G</a> <a class="link" href="s13.html#idx_id_7">H</a> <a class="link" href="s13.html#idx_id_8">I</a> <a class="link" href="s13.html#idx_id_9">K</a> <a class="link" href="s13.html#idx_id_10">L</a> <a class="link" href="s13.html#idx_id_11">M</a> <a class="link" href="s13.html#idx_id_12">N</a> <a class="link" href="s13.html#idx_id_14">P</a> <a class="link" href="s13.html#idx_id_15">Q</a> <a class="link" href="s13.html#idx_id_16">R</a> <a class="link" href="s13.html#idx_id_17">S</a> <a class="link" href="s13.html#idx_id_18">T</a> <a class="link" href="s13.html#idx_id_19">U</a> <a class="link" href="s13.html#idx_id_20">V</a> <a class="link" href="s13.html#idx_id_21">W</a> <a class="link" href=
"s13.html#idx_id_22">Z</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/math/doc/sf_and_dist/html/index/s14.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/index/s14.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/index/s14.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -22,9 +22,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s13.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="s15.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
-<div class="section id1501215">
+<div class="section id1502492">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1501215"></a>Class Index</h2></div></div></div>
+<a name="id1502492"></a>Class Index</h2></div></div></div>
<p><a class="link" href="s14.html#idx_id_24">B</a> <a class="link" href="s14.html#idx_id_25">C</a> <a class="link" href="s14.html#idx_id_26">D</a> <a class="link" href="s14.html#idx_id_27">E</a> <a class="link" href="s14.html#idx_id_28">F</a> <a class="link" href="s14.html#idx_id_29">G</a> <a class="link" href="s14.html#idx_id_30">H</a> <a class="link" href="s14.html#idx_id_31">I</a> <a class="link" href="s14.html#idx_id_33">L</a> <a class="link" href="s14.html#idx_id_34">M</a> <a class="link" href="s14.html#idx_id_35">N</a> <a class="link" href="s14.html#idx_id_37">P</a> <a class="link" href="s14.html#idx_id_39">R</a> <a class="link" href="s14.html#idx_id_40">S</a> <a class="link" href="s14.html#idx_id_41">T</a> <a class="link" href="s14.html#idx_id_42">U</a> <a class="link" href="s14.html#idx_id_44">W</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/math/doc/sf_and_dist/html/index/s15.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/index/s15.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/index/s15.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -22,9 +22,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s14.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="s16.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
-<div class="section id1502148">
+<div class="section id1503424">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1502148"></a>Typedef Index</h2></div></div></div>
+<a name="id1503424"></a>Typedef Index</h2></div></div></div>
<p><a class="link" href="s15.html#idx_id_46">A</a> <a class="link" href="s15.html#idx_id_47">B</a> <a class="link" href="s15.html#idx_id_48">C</a> <a class="link" href="s15.html#idx_id_49">D</a> <a class="link" href="s15.html#idx_id_50">E</a> <a class="link" href="s15.html#idx_id_51">F</a> <a class="link" href="s15.html#idx_id_52">G</a> <a class="link" href="s15.html#idx_id_53">H</a> <a class="link" href="s15.html#idx_id_54">I</a> <a class="link" href="s15.html#idx_id_56">L</a> <a class="link" href="s15.html#idx_id_58">N</a> <a class="link" href="s15.html#idx_id_59">O</a> <a class="link" href="s15.html#idx_id_60">P</a> <a class="link" href="s15.html#idx_id_62">R</a> <a class="link" href="s15.html#idx_id_63">S</a> <a class="link" href="s15.html#idx_id_64">T</a> <a class="link" href="s15.html#idx_id_65">U</a> <a class="link" href="s15.html#idx_id_66">V</a> <a class="link" href="s15.html#idx_id_67">W</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/math/doc/sf_and_dist/html/index/s16.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/index/s16.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/index/s16.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -22,9 +22,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s15.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="s17.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
-<div class="section id1506551">
+<div class="section id1506991">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1506551"></a>Macro Index</h2></div></div></div>
+<a name="id1506991"></a>Macro Index</h2></div></div></div>
<p><a class="link" href="s16.html#idx_id_70">B</a> <a class="link" href="s16.html#idx_id_74">F</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/math/doc/sf_and_dist/html/index/s17.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/index/s17.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/index/s17.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -21,9 +21,9 @@
<div class="spirit-nav">
<a accesskey="p" href="s16.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a>
</div>
-<div class="section id1507777">
+<div class="section id1508218">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
-<a name="id1507777"></a>Index</h2></div></div></div>
+<a name="id1508218"></a>Index</h2></div></div></div>
<p><a class="link" href="s17.html#idx_id_92">A</a> <a class="link" href="s17.html#idx_id_93">B</a> <a class="link" href="s17.html#idx_id_94">C</a> <a class="link" href="s17.html#idx_id_95">D</a> <a class="link" href="s17.html#idx_id_96">E</a> <a class="link" href="s17.html#idx_id_97">F</a> <a class="link" href="s17.html#idx_id_98">G</a> <a class="link" href="s17.html#idx_id_99">H</a> <a class="link" href="s17.html#idx_id_100">I</a> <a class="link" href="s17.html#idx_id_101">K</a> <a class="link" href="s17.html#idx_id_102">L</a> <a class="link" href="s17.html#idx_id_103">M</a> <a class="link" href="s17.html#idx_id_104">N</a> <a class="link" href="s17.html#idx_id_105">O</a> <a class="link" href="s17.html#idx_id_106">P</a> <a class="link" href="s17.html#idx_id_107">Q</a> <a class="link" href="s17.html#idx_id_108">R</a> <a class="link" href="s17.html#idx_id_109">S</a> <a class="link" href="s17.html#idx_id_110">T</a> <a class="link" href="s17.html#idx_id_111">U</a> <a class="link" href="s17.html#idx_id_112">V</a
> <a class="link" href="s17.html#idx_id_113">W</a> <a class="link" href="s17.html#idx_id_114">Z</a></p>
<div class="variablelist"><dl>
<dt>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/constants/new_const.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/constants/new_const.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/constants/new_const.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -232,7 +232,6 @@
<span class="special">}</span> <span class="comment">// namespace constants</span>
<span class="special">}</span> <span class="comment">// namespace math</span>
<span class="special">}</span> <span class="comment">// namespace boost</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_coinflip_example.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_coinflip_example.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_coinflip_example.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -66,7 +66,8 @@
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Using Binomial distribution to predict how many heads and tails."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">try</span>
- <span class="special">{</span></pre>
+ <span class="special">{</span>
+</pre>
<p>
</p>
<p>
@@ -83,7 +84,8 @@
<span class="keyword">int</span> <span class="identifier">flips</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
<span class="identifier">binomial</span> <span class="identifier">flip</span><span class="special">(</span><span class="identifier">flips</span><span class="special">,</span> <span class="identifier">success_fraction</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">4</span><span class="special">);</span></pre>
+<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>
@@ -103,7 +105,8 @@
<span class="comment">// if success_fraction is exactly one half,</span>
<span class="comment">// for example, when flipping 'fair' coins.</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Skewness if success_fraction is "</span> <span class="special"><<</span> <span class="identifier">flip</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">()</span>
- <span class="special"><<</span> <span class="string">" is "</span> <span class="special"><<</span> <span class="identifier">skewness</span><span class="special">(</span><span class="identifier">flip</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Expect zero for a 'fair' coin.</span></pre>
+ <span class="special"><<</span> <span class="string">" is "</span> <span class="special"><<</span> <span class="identifier">skewness</span><span class="special">(</span><span class="identifier">flip</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Expect zero for a 'fair' coin.</span>
+</pre>
<p>
</p>
<p>
@@ -113,7 +116,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"For "</span> <span class="special"><<</span> <span class="identifier">flip</span><span class="special">.</span><span class="identifier">trials</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" coin flips: "</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting no heads is "</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting at least one head is "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting at least one head is "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -123,7 +127,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 0 or 1 heads is "</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">+</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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// sum of exactly == probabilities</span></pre>
+ <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">+</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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// sum of exactly == probabilities</span>
+</pre>
<p>
</p>
<p>
@@ -132,7 +137,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 0 or 1 (<= 1) heads is "</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">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 9 or 10 heads is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 9 or 10 heads is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -140,7 +146,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 9 or 10 heads is "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 9 or 10 heads is "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -148,7 +155,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 9 or 10 heads is "</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">flip</span><span class="special">,</span> <span class="number">8</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting 9 or 10 heads is "</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">flip</span><span class="special">,</span> <span class="number">8</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -165,7 +173,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</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"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -175,7 +184,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of between 4 and 6 heads (4 or 5 or 6) is "</span>
<span class="comment">// P(X <= 6) - P(X <= 3) == P(X < 4)</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -186,7 +196,8 @@
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of between 3 and 7 heads (3, 4, 5, 6 or 7) is "</span>
<span class="comment">// P(X <= 7) - P(X <= 2) == P(X < 3)</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -215,7 +226,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">2</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">successes</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">10</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">left</span>
<span class="special"><<</span> <span class="identifier">probability</span> <span class="special"><<</span> <span class="string">" or 1 in "</span> <span class="special"><<</span> <span class="number">1.</span> <span class="special">/</span> <span class="identifier">probability</span> <span class="special"><<</span> <span class="string">", or "</span>
<span class="special"><<</span> <span class="identifier">probability</span> <span class="special">*</span> <span class="number">100.</span> <span class="special"><<</span> <span class="string">"%"</span><span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span> <span class="comment">// for i</span></pre>
+<span class="special">}</span> <span class="comment">// for i</span>
+</pre>
<p>
</p>
<p>
@@ -226,7 +238,8 @@
<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">&</span> <span class="identifier">e</span><span class="special">)</span>
<span class="special">{</span>
- <span class="comment">//</span></pre>
+ <span class="comment">//</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -55,8 +55,6 @@
<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>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">exception</span><span class="special">></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>
@@ -70,7 +68,8 @@
<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.</span>
<span class="keyword">double</span> <span class="identifier">success_fraction</span> <span class="special">=</span> <span class="number">1.</span> <span class="special">/</span> <span class="identifier">answers</span><span class="special">;</span> <span class="comment">// If a random guess, p = 1/4 = 0.25.</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>
+<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>
@@ -81,7 +80,8 @@
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"In a quiz with "</span> <span class="special"><<</span> <span class="identifier">quiz</span><span class="special">.</span><span class="identifier">trials</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" questions and with a probability of guessing right of "</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">*</span> <span class="number">100</span> <span class="special"><<</span> <span class="string">" %"</span>
- <span class="special"><<</span> <span class="string">" or 1 in "</span> <span class="special"><<</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">int</span><span class="special">>(</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" or 1 in "</span> <span class="special"><<</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">int</span><span class="special">>(</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -96,7 +96,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting exactly "</span> <span class="special"><<</span> <span class="identifier">pass_score</span> <span class="special"><<</span> <span class="string">" answers right by chance is "</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="identifier">pass_score</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting all "</span> <span class="special"><<</span> <span class="identifier">questions</span> <span class="special"><<</span> <span class="string">" answers right by chance is "</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="identifier">questions</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting none right is 0.0100226
@@ -119,7 +120,8 @@
<span class="keyword">double</span> <span class="identifier">probability</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="identifier">successes</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">2</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">successes</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">probability</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Guessed Probability
@@ -146,7 +148,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting none or one right is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting none or one right is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting none or one right is 0.0634764
@@ -158,7 +161,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting none or one right is "</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">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting none or one right is "</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">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting none or one right is 0.0634764
@@ -169,7 +173,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting <= 10 right (to fail) is "</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">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting <= 10 right (to fail) is "</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">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting <= 10 right (to fail) is 0.999715
@@ -184,7 +189,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting > 10 right (to pass) is "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting > 10 right (to pass) is "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting > 10 right (to pass) is 0.000285239
@@ -195,7 +201,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting > 10 right (to pass) is "</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="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting > 10 right (to pass) is "</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="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting > 10 right (to pass) is 0.000285239
@@ -205,7 +212,8 @@
</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>
+<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>
@@ -216,7 +224,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting less than "</span> <span class="special"><<</span> <span class="identifier">pass_score</span>
<span class="special"><<</span> <span class="string">" (< "</span> <span class="special"><<</span> <span class="identifier">pass_score</span> <span class="special"><<</span> <span class="string">") answers right by guessing is "</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">endl</span><span class="special">;</span></pre>
+ <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">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting less than 11 (< 11) answers right by guessing is 0.999715
@@ -235,7 +244,8 @@
<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="string">", only 1 in "</span> <span class="special"><<</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">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">endl</span><span class="special">;</span>
-<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>
+<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>
<pre class="programlisting">Probability of getting at least 11 (>= 11) answers right by guessing is 0.000285239, only 1 in 3505.83
@@ -251,7 +261,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">2</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">score</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">setprecision</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">quiz</span><span class="special">,</span> <span class="identifier">score</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">At most (<=)
@@ -281,7 +292,8 @@
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">2</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">score</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">setprecision</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="identifier">score</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<pre class="programlisting">At least (>)
@@ -324,7 +336,8 @@
<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>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting between "</span>
<span class="special"><<</span> <span class="identifier">low</span> <span class="special"><<</span> <span class="string">" and "</span> <span class="special"><<</span> <span class="identifier">high</span> <span class="special"><<</span> <span class="string">" answers right by guessing is "</span>
- <span class="special"><<</span> <span class="identifier">sum</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.61323</span></pre>
+ <span class="special"><<</span> <span class="identifier">sum</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.61323</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting between 3 and 5 answers right by guessing is 0.6132
@@ -335,7 +348,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting between "</span> <span class="special"><<</span> <span class="identifier">low</span> <span class="special"><<</span> <span class="string">" and "</span> <span class="special"><<</span> <span class="identifier">high</span> <span class="special"><<</span> <span class="string">" answers right by guessing is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.61323</span></pre>
+ <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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.61323</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting between 3 and 5 answers right by guessing is 0.6132
@@ -353,7 +367,8 @@
<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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 1 <= x 8 P = 0.9825</span>
<span class="identifier">low</span> <span class="special">=</span> <span class="number">4</span><span class="special">;</span> <span class="identifier">high</span> <span class="special">=</span> <span class="number">4</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of getting between "</span> <span class="special"><<</span> <span class="identifier">low</span> <span class="special"><<</span> <span class="string">" and "</span> <span class="special"><<</span> <span class="identifier">high</span> <span class="special"><<</span> <span class="string">" answers right by guessing is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 4 <= x 4 P = 0.22520</span></pre>
+ <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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 4 <= x 4 P = 0.22520</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of getting between 1 and 6 answers right by guessing is 0.9104
@@ -377,7 +392,8 @@
<span class="special"><<</span> <span class="identifier">ceil</span><span class="special">(</span><span class="identifier">mean</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special">-</span> <span class="identifier">standard_deviation</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" and "</span>
<span class="special"><<</span> <span class="identifier">floor</span><span class="special">(</span><span class="identifier">mean</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">standard_deviation</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" correct."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Mode (the most frequent) is "</span> <span class="special"><<</span> <span class="identifier">mode</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Skewness is "</span> <span class="special"><<</span> <span class="identifier">skewness</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Skewness is "</span> <span class="special"><<</span> <span class="identifier">skewness</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">By guessing, on average, one can expect to get 4 correct answers.
@@ -410,7 +426,8 @@
<span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0.02</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 2 to 98%</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"If guessing then percentiles 1 to 99% will get "</span> <span class="special"><<</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"><<</span> <span class="string">" to "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" right."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" to "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">quiz</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" right."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -457,7 +474,8 @@
<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>
<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">real</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">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"><</span><span class="identifier">discrete_quantile</span><span class="special"><</span><span class="identifier">real</span><span class="special">></span> <span class="special">></span> <span class="identifier">real_quantile_policy</span><span class="special">;</span></pre>
+<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"><</span><span class="identifier">discrete_quantile</span><span class="special"><</span><span class="identifier">real</span><span class="special">></span> <span class="special">></span> <span class="identifier">real_quantile_policy</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -473,7 +491,8 @@
<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"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">real_quantile_policy</span><span class="special">></span> <span class="identifier">real_quantile_binomial</span><span class="special">;</span></pre>
+<span class="keyword">typedef</span> <span class="identifier">binomial_distribution</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">real_quantile_policy</span><span class="special">></span> <span class="identifier">real_quantile_binomial</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -481,7 +500,8 @@
</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>
+<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>
@@ -504,7 +524,8 @@
<span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">quiz_real</span><span class="special">,</span> <span class="number">0.02</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 2 to 98% 0.31311 7.7880</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"If guessing, then percentiles 1 to 99% will get "</span> <span class="special"><<</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"><<</span> <span class="string">" to "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">quiz_real</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" right."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" to "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">quiz_real</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" right."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Real Quantiles
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/dist_construct_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -52,7 +52,8 @@
<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// for binomial_distribution.</span>
<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">beta</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// for beta_distribution.</span>
<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">gamma</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// for gamma_distribution.</span>
-<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// for normal_distribution.</span></pre>
+<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> <span class="comment">// for normal_distribution.</span>
+</pre>
<p>
</p>
<p>
@@ -64,7 +65,8 @@
</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"><</span><span class="keyword">double</span><span class="special">></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>
+<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"><</span><span class="keyword">double</span><span class="special">></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>
@@ -72,7 +74,8 @@
</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>
+<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>
@@ -81,7 +84,8 @@
</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>
+<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>
@@ -94,7 +98,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special"><></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>
+<pre class="programlisting"><span class="identifier">negative_binomial_distribution</span><span class="special"><></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>
@@ -120,7 +125,8 @@
</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>
+<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>
@@ -128,7 +134,8 @@
</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>
+<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>
@@ -136,7 +143,8 @@
</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>
+<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>
@@ -144,7 +152,8 @@
</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>
+<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>
@@ -153,7 +162,8 @@
<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>
+<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>
@@ -162,7 +172,8 @@
<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"><></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>
+<span class="identifier">binomial_distribution</span><span class="special"><></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>
@@ -187,7 +198,8 @@
<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"><></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>
+<span class="identifier">beta_distribution</span><span class="special"><></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>
@@ -195,7 +207,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">gamma_distribution</span><span class="special"><></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>
+<pre class="programlisting"><span class="identifier">gamma_distribution</span><span class="special"><></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>
@@ -222,7 +235,8 @@
<span class="identifier">negative_binomial_distribution</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">mydist6</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">// Explicit long double precision:</span>
-<span class="identifier">negative_binomial_distribution</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">></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>
+<span class="identifier">negative_binomial_distribution</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">></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>
@@ -265,7 +279,8 @@
<span class="identifier">normal</span> <span class="identifier">norm3</span><span class="special">(</span><span class="number">2</span><span class="special">,</span> <span class="number">3</span><span class="special">);</span> <span class="comment">// Mean = 2, std deviation = 3.</span>
<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>
+<span class="special">}</span> <span class="comment">// int main()</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/error_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/error_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/error_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -93,7 +93,8 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">;</span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cstddef</span><span class="special">></span>
- <span class="comment">// using ::errno</span></pre>
+ <span class="comment">// using ::errno</span>
+</pre>
<p>
</p>
<p>
@@ -135,7 +136,8 @@
<span class="string">"\n"</span><span class="string">"Message from thrown exception was:\n "</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<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>
+<span class="special">}</span> <span class="comment">// int main()</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -50,7 +50,6 @@
<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>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">limits</span><span class="special">></span>
<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>
@@ -62,7 +61,8 @@
<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>
+<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>
@@ -82,7 +82,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Normal distribution with mean = "</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="special"><<</span> <span class="string">", standard deviation "</span> <span class="special"><<</span> <span class="identifier">N01</span><span class="special">.</span><span class="identifier">scale</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">", has "</span> <span class="special"><<</span> <span class="string">"fraction > "</span> <span class="special"><<</span> <span class="identifier">z</span>
- <span class="special"><<</span> <span class="string">", p = "</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">N01</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Note: uses complement.</span></pre>
+ <span class="special"><<</span> <span class="string">", p = "</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">N01</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Note: uses complement.</span>
+</pre>
<p>
</p>
<pre class="programlisting">Normal distribution with mean = 0, standard deviation 1, has fraction <= -2, p = 0.0227501
@@ -94,7 +95,8 @@
<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"><</span><span class="identifier">normal</span><span class="special">>(</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"><<</span> <span class="string">"offset location (mean) = "</span> <span class="special"><<</span> <span class="identifier">l</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"offset location (mean) = "</span> <span class="special"><<</span> <span class="identifier">l</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -112,7 +114,8 @@
</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>
+<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>
@@ -125,7 +128,8 @@
<span class="special"><<</span> <span class="string">", p = "</span> <span class="special"><<</span> <span class="identifier">cdf</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Normal distribution with mean = "</span> <span class="special"><<</span> <span class="identifier">l</span>
<span class="special"><<</span> <span class="string">" has "</span> <span class="special"><<</span> <span class="string">"fraction > "</span> <span class="special"><<</span> <span class="identifier">z</span>
- <span class="special"><<</span> <span class="string">", p = "</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">np001pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">", p = "</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">np001pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Normal distribution with mean = 1.09023 has fraction <= -2, p = 0.001
@@ -148,7 +152,8 @@
</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>
+<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>
@@ -165,7 +170,8 @@
<span class="comment">// Default policy, fully specified.</span>
<span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_location</span><span class="special"><</span><span class="identifier">normal</span><span class="special">>(</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">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="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"><</span><span class="identifier">normal</span><span class="special">>(</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"><</span><span class="identifier">domain_error</span><span class="special"><</span><span class="identifier">ignore_error</span><span class="special">></span> <span class="special">>());</span></pre>
+<span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_location</span><span class="special"><</span><span class="identifier">normal</span><span class="special">>(</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"><</span><span class="identifier">domain_error</span><span class="special"><</span><span class="identifier">ignore_error</span><span class="special">></span> <span class="special">>());</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -77,7 +77,8 @@
</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>
+<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>
@@ -88,7 +89,8 @@
</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"><<</span> <span class="string">"Percentage of packs > "</span> <span class="special"><<</span> <span class="identifier">max_weight</span> <span class="special"><<</span> <span class="string">" is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X > 3.1)</span></pre>
+<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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X > 3.1)</span>
+</pre>
<p>
</p>
<p>
@@ -105,7 +107,8 @@
<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"><<</span><span class="string">"Fraction of packs <= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" is "</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">packs</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// fraction of packs <= 2.9 with a mean of 3 is 0.841345</span></pre>
+<span class="comment">// fraction of packs <= 2.9 with a mean of 3 is 0.841345</span>
+</pre>
<p>
</p>
<p>
@@ -128,7 +131,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span>
<span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">xpacks</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">xpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// fraction of packs >= 2.9 with a mean of 3.06449 is 0.950005</span></pre>
+<span class="comment">// fraction of packs >= 2.9 with a mean of 3.06449 is 0.950005</span>
+</pre>
<p>
</p>
<p>
@@ -147,7 +151,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Setting the packer to "</span> <span class="special"><<</span> <span class="identifier">nominal_mean</span> <span class="special"><<</span> <span class="string">" will mean that "</span>
<span class="special"><<</span> <span class="string">"fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span>
<span class="special"><<</span> <span class="string">" is "</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">nominal_packs</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</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 >= 2.9 is 0.95</span></pre>
+<span class="comment">// Setting the packer to 3.06449 will mean that fraction of packs >= 2.9 is 0.95</span>
+</pre>
<p>
</p>
<p>
@@ -159,7 +164,8 @@
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">find_location</span><span class="special">.</span><span class="identifier">hpp</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">find_location</span><span class="special">;</span></pre>
+ <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>
@@ -169,7 +175,8 @@
<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"><</span><span class="identifier">normal</span><span class="special">>(</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>
+<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>
@@ -180,7 +187,8 @@
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Setting the packer to "</span> <span class="special"><<</span> <span class="identifier">nominal_mean</span> <span class="special"><<</span> <span class="string">" will mean that "</span>
<span class="special"><<</span> <span class="string">"fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span>
<span class="special"><<</span> <span class="string">" is "</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">good_packs</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</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 >= 2.9 is 0.95</span></pre>
+<span class="comment">// Setting the packer to 3.06449 will mean that fraction of packs >= 2.9 is 0.95</span>
+</pre>
<p>
</p>
<h5>
@@ -213,7 +221,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Cauchy Setting the packer to "</span> <span class="special"><<</span> <span class="identifier">mean</span> <span class="special"><<</span> <span class="string">" will mean that "</span>
<span class="special"><<</span> <span class="string">"fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span>
<span class="special"><<</span> <span class="string">" is "</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">cpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</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 >= 2.9 is 0.75</span></pre>
+<span class="comment">// Cauchy Setting the packer to 3 will mean that fraction of packs >= 2.9 is 0.75</span>
+</pre>
<p>
</p>
<p>
@@ -225,7 +234,8 @@
</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"><</span><span class="identifier">cauchy</span><span class="special">>(</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"><<</span> <span class="string">"find_location<cauchy>(minimum_weight, over fraction, standard_deviation); "</span> <span class="special"><<</span> <span class="identifier">lc</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// find_location<cauchy>(minimum_weight, over fraction, packs.standard_deviation()); 3.53138</span></pre>
+<span class="comment">// find_location<cauchy>(minimum_weight, over fraction, packs.standard_deviation()); 3.53138</span>
+</pre>
<p>
</p>
<p>
@@ -241,7 +251,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Cauchy Setting the packer to "</span> <span class="special"><<</span> <span class="identifier">lc</span> <span class="special"><<</span> <span class="string">" will mean that "</span>
<span class="special"><<</span> <span class="string">"fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span>
<span class="special"><<</span> <span class="string">" is "</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">goodcpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</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 >= 2.9 is 0.95</span></pre>
+<span class="comment">// Cauchy Setting the packer to 3.53138 will mean that fraction of packs >= 2.9 is 0.95</span>
+</pre>
<p>
</p>
<p>
@@ -254,7 +265,8 @@
<span class="special"><<</span> <span class="identifier">find_location</span><span class="special"><</span><span class="identifier">cauchy</span><span class="special">>(</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>
<span class="special"><<</span> <span class="string">" will mean that "</span>
<span class="special"><<</span> <span class="string">"fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span>
- <span class="special"><<</span> <span class="string">" is "</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">goodcpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" is "</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">goodcpacks</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -313,7 +325,8 @@
</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"><<</span> <span class="string">"Quantile of "</span> <span class="special"><<</span> <span class="identifier">p</span> <span class="special"><<</span> <span class="string">" = "</span> <span class="special"><<</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"><<</span> <span class="string">", mean = "</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="special"><<</span> <span class="string">", sd = "</span> <span class="special"><<</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">", mean = "</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="special"><<</span> <span class="string">", sd = "</span> <span class="special"><<</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -338,7 +351,8 @@
<span class="identifier">cout</span> <span class="special"><<</span><span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack05</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">pack05</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.05 is 0.97725</span></pre>
+<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.05 is 0.97725</span>
+</pre>
<p>
</p>
<p>
@@ -357,7 +371,8 @@
<span class="identifier">cout</span> <span class="special"><<</span><span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack06</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">pack06</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.06 is 0.95221</span></pre>
+<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.06 is 0.95221</span>
+</pre>
<p>
</p>
<p>
@@ -394,7 +409,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"For the "</span><span class="special"><<</span> <span class="identifier">p</span> <span class="special"><<</span> <span class="string">"th quantile to be located at "</span>
<span class="special"><<</span> <span class="identifier">minimum_weight</span> <span class="special"><<</span> <span class="string">", would need a standard deviation of "</span> <span class="special"><<</span> <span class="identifier">sd95</span> <span class="special"><<</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>
+<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>
@@ -407,7 +423,8 @@
<span class="identifier">cout</span> <span class="special"><<</span><span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack95</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">pack95</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.0607957 is 0.95</span></pre>
+<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.0607957 is 0.95</span>
+</pre>
<p>
</p>
<p>
@@ -418,7 +435,8 @@
</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"><</span><span class="identifier">normal</span><span class="special">>(</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"><<</span> <span class="string">"find_scale<normal>(minimum_weight, under_fraction, packs.mean()); "</span> <span class="special"><<</span> <span class="identifier">ss</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// find_scale<normal>(minimum_weight, under_fraction, packs.mean()); 0.0607957</span></pre>
+<span class="comment">// find_scale<normal>(minimum_weight, under_fraction, packs.mean()); 0.0607957</span>
+</pre>
<p>
</p>
<p>
@@ -426,7 +444,8 @@
</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>
+<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>
@@ -450,7 +469,8 @@
</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"><</span><span class="identifier">normal</span><span class="special">>(</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"><<</span> <span class="string">"find_scale<normal>(minimum_weight, under_fraction, packs.mean()); "</span> <span class="special"><<</span> <span class="identifier">ss1o</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// find_scale<normal>(minimum_weight, under_fraction, packs.mean()); 0.0607957</span></pre>
+<span class="comment">// find_scale<normal>(minimum_weight, under_fraction, packs.mean()); 0.0607957</span>
+</pre>
<p>
</p>
<p>
@@ -463,7 +483,8 @@
</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"><</span><span class="identifier">normal</span><span class="special">>(</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"><<</span> <span class="string">"find_scale<normal>(complement(minimum_weight, over_fraction, packs.mean())); "</span> <span class="special"><<</span> <span class="identifier">ssc</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// find_scale<normal>(complement(minimum_weight, over_fraction, packs.mean())); 0.0607957</span></pre>
+<span class="comment">// find_scale<normal>(complement(minimum_weight, over_fraction, packs.mean())); 0.0607957</span>
+</pre>
<p>
</p>
<p>
@@ -478,7 +499,8 @@
<span class="identifier">cout</span> <span class="special"><<</span><span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">minimum_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack95c</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">pack95c</span><span class="special">,</span> <span class="identifier">minimum_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.0607957 is 0.95</span></pre>
+<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.0607957 is 0.95</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -59,7 +59,8 @@
<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>
+<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>
@@ -79,7 +80,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Normal distribution with mean = "</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="special"><<</span> <span class="string">", standard deviation "</span> <span class="special"><<</span> <span class="identifier">N01</span><span class="special">.</span><span class="identifier">scale</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">", has "</span> <span class="special"><<</span> <span class="string">"fraction > "</span> <span class="special"><<</span> <span class="identifier">z</span>
- <span class="special"><<</span> <span class="string">", p = "</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">N01</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Note: uses complement.</span></pre>
+ <span class="special"><<</span> <span class="string">", p = "</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">N01</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Note: uses complement.</span>
+</pre>
<p>
</p>
<pre class="programlisting">Normal distribution with mean = 0 has fraction <= -2, p = 0.0227501
@@ -94,7 +96,8 @@
</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"><</span><span class="identifier">normal</span><span class="special">>(</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"><<</span> <span class="string">"scale (standard deviation) = "</span> <span class="special"><<</span> <span class="identifier">s</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"scale (standard deviation) = "</span> <span class="special"><<</span> <span class="identifier">s</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -111,7 +114,8 @@
</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>
+<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>
@@ -124,7 +128,8 @@
<span class="special"><<</span> <span class="string">", p = "</span> <span class="special"><<</span> <span class="identifier">cdf</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Normal distribution with mean = "</span> <span class="special"><<</span> <span class="identifier">l</span>
<span class="special"><<</span> <span class="string">" has "</span> <span class="special"><<</span> <span class="string">"fraction > "</span> <span class="special"><<</span> <span class="identifier">z</span>
- <span class="special"><<</span> <span class="string">", p = "</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">np001pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">", p = "</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">np001pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Normal distribution with mean = 0 has fraction <= -2, p = 0.001
@@ -147,7 +152,8 @@
</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>
+<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>
@@ -165,7 +171,8 @@
<span class="comment">// Default policy, fully specified.</span>
<span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special"><</span><span class="identifier">normal</span><span class="special">>(</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">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="comment">// New policy, without typedef.</span>
-<span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special"><</span><span class="identifier">normal</span><span class="special">>(</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"><</span><span class="identifier">domain_error</span><span class="special"><</span><span class="identifier">ignore_error</span><span class="special">></span> <span class="special">>());</span></pre>
+<span class="identifier">l</span> <span class="special">=</span> <span class="identifier">find_scale</span><span class="special"><</span><span class="identifier">normal</span><span class="special">>(</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"><</span><span class="identifier">domain_error</span><span class="special"><</span><span class="identifier">ignore_error</span><span class="special">></span> <span class="special">>());</span>
+</pre>
<p>
</p>
<p>
@@ -185,7 +192,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Normal distribution with mean = "</span> <span class="special"><<</span> <span class="identifier">l</span> <span class="special"><<</span> <span class="string">" has "</span>
<span class="special"><<</span> <span class="string">"fraction <= "</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" = "</span> <span class="special"><<</span> <span class="identifier">cdf</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Normal distribution with mean = "</span> <span class="special"><<</span> <span class="identifier">l</span> <span class="special"><<</span> <span class="string">" has "</span>
- <span class="special"><<</span> <span class="string">"fraction > "</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" = "</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">np95pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">"fraction > "</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" = "</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">np95pc</span><span class="special">,</span> <span class="identifier">z</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/geometric_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/geometric_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/geometric_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -37,7 +37,8 @@
<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>
+<span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DISCRETE_QUANTILE_POLICY</span> <span class="identifier">real</span>
+</pre>
<p>
</p>
<div class="caution"><table border="0" summary="Caution">
@@ -109,7 +110,8 @@
<p>
</p>
<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">success_fraction</span> <span class="special">=</span> <span class="number">1.</span><span class="special">/</span><span class="number">6</span><span class="special">;</span> <span class="comment">// success_fraction (p) = 0.1666</span>
-<span class="comment">// (so failure_fraction is 1 - success_fraction = 5./6 = 1- 0.1666 = 0.8333)</span></pre>
+<span class="comment">// (so failure_fraction is 1 - success_fraction = 5./6 = 1- 0.1666 = 0.8333)</span>
+</pre>
<p>
</p>
<p>
@@ -126,7 +128,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">geometric</span> <span class="identifier">g6</span><span class="special">(</span><span class="identifier">success_fraction</span><span class="special">);</span> <span class="comment">// type double by default.</span></pre>
+<pre class="programlisting"><span class="identifier">geometric</span> <span class="identifier">g6</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>
@@ -134,7 +137,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"success fraction of a six-sided dice is "</span> <span class="special"><<</span> <span class="identifier">g6</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"success fraction of a six-sided dice is "</span> <span class="special"><<</span> <span class="identifier">g6</span><span class="special">.</span><span class="identifier">success_fraction</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -144,7 +148,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.1667</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.1667</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.1667</span>
+</pre>
<p>
</p>
<p>
@@ -154,7 +159,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.1389</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.1389</span>
+</pre>
<p>
</p>
<p>
@@ -163,7 +169,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"pdf(g6, 0) + pdf(g6, 1) = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">g6</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">g6</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"pdf(g6, 0) + pdf(g6, 1) = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">g6</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">g6</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -172,7 +179,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"cdf(g6, 1) = "</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.3056</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"cdf(g6, 1) = "</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.3056</span>
+</pre>
<p>
</p>
<p>
@@ -181,7 +189,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"cdf(g6, 12) = "</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">12</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.9065 or 90% probability.</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"cdf(g6, 12) = "</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">12</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.9065 or 90% probability.</span>
+</pre>
<p>
</p>
<p>
@@ -190,7 +199,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"quantile(g6, 0.99) = "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0.99</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 24.26</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"quantile(g6, 0.99) = "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0.99</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 24.26</span>
+</pre>
<p>
</p>
<p>
@@ -210,7 +220,8 @@
</p>
<pre class="programlisting"><span class="identifier">negative_binomial</span> <span class="identifier">nb</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="identifier">success_fraction</span><span class="special">);</span>
<span class="identifier">cout</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">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.1389</span>
-<span class="identifier">cout</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="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.3056</span></pre>
+<span class="identifier">cout</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="number">1</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.3056</span>
+</pre>
<p>
</p>
<p>
@@ -219,7 +230,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"quantile(complement(g6, 1 - p)) "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 24.26</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"quantile(complement(g6, 1 - p)) "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">g6</span><span class="special">,</span> <span class="number">0.01</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 24.26</span>
+</pre>
<p>
</p>
<p>
@@ -251,7 +263,8 @@
<span class="special"><<</span> <span class="identifier">max_digits10</span> <span class="special"><<</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="identifier">max_digits10</span><span class="special">);</span> <span class="comment">// </span>
- <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g05</span><span class="special">,</span> <span class="number">0.0001</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// returns 0.5000346561579232, not exact 0.5.</span></pre>
+ <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g05</span><span class="special">,</span> <span class="number">0.0001</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// returns 0.5000346561579232, not exact 0.5.</span>
+</pre>
<p>
</p>
<p>
@@ -260,7 +273,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g05</span><span class="special">,</span> <span class="identifier">floor</span><span class="special">(</span><span class="number">0.0001</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// returns exactly 0.5</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">g05</span><span class="special">,</span> <span class="identifier">floor</span><span class="special">(</span><span class="number">0.0001</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// returns exactly 0.5</span>
+</pre>
<p>
</p>
<pre class="programlisting"><code class="computeroutput"><span class="special">></span> <span class="identifier">formatC</span><span class="special">(</span><span class="identifier">pgeom</span><span class="special">(</span><span class="number">0.9999999</span><span class="special">,</span><span class="number">0.5</span><span class="special">,</span> <span class="identifier">FALSE</span><span class="special">),</span> <span class="identifier">digits</span><span class="special">=</span><span class="number">17</span><span class="special">)</span> <span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="string">" 0.25"</span></code>
@@ -313,7 +327,8 @@
<span class="identifier">c</span> <span class="special">=</span> <span class="number">0.80</span><span class="special">;</span> <span class="comment">// Only reasonably confident.</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"To be "</span> <span class="special"><<</span> <span class="identifier">c</span> <span class="special">*</span> <span class="number">100</span>
<span class="special"><<</span> <span class="string">"% confident of finding we customer with a fault, need to survey "</span>
- <span class="special"><<</span> <span class="identifier">ceil</span><span class="special">(</span><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">g</span><span class="special">,</span> <span class="identifier">c</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" customers."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 79</span></pre>
+ <span class="special"><<</span> <span class="identifier">ceil</span><span class="special">(</span><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">g</span><span class="special">,</span> <span class="identifier">c</span><span class="special">))</span> <span class="special"><<</span> <span class="string">" customers."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 79</span>
+</pre>
<p>
</p>
<h6>
@@ -332,7 +347,8 @@
<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">2</span><span class="special">);</span>
-<span class="identifier">geometric</span> <span class="identifier">gav</span><span class="special">(</span><span class="number">0.75</span><span class="special">);</span> <span class="comment">// Shooter averages 7.5 out of 10 in the basket.</span></pre>
+<span class="identifier">geometric</span> <span class="identifier">gav</span><span class="special">(</span><span class="number">0.75</span><span class="special">);</span> <span class="comment">// Shooter averages 7.5 out of 10 in the basket.</span>
+</pre>
<p>
</p>
<p>
@@ -341,7 +357,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 1st try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gav</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.75</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 1st try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gav</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.75</span>
+</pre>
<p>
</p>
<p>
@@ -351,7 +368,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 5th try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gav</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.0029</span></pre>
+<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 5th try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gav</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.0029</span>
+</pre>
<p>
</p>
<p>
@@ -365,7 +383,8 @@
<pre class="programlisting"><span class="identifier">geometric</span> <span class="identifier">gbest</span><span class="special">(</span><span class="number">0.95</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 5th try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gbest</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 5.9e-6</span>
<span class="identifier">geometric</span> <span class="identifier">gmediocre</span><span class="special">(</span><span class="number">0.50</span><span class="special">);</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 5th try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gmediocre</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.031</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of score on 5th try = "</span> <span class="special"><<</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">gmediocre</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.031</span>
+</pre>
<p>
</p>
<p>
@@ -408,7 +427,8 @@
<span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.00025</span>
<span class="identifier">t</span> <span class="special">=</span> <span class="identifier">geometric</span><span class="special">::</span><span class="identifier">find_upper_bound_on_p</span><span class="special">(</span><span class="identifier">k</span><span class="special">,</span> <span class="identifier">alpha</span><span class="special">/</span><span class="number">2</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"geometric::find_upper_bound_on_p("</span> <span class="special"><<</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">k</span><span class="special">)</span> <span class="special"><<</span> <span class="string">", "</span> <span class="special"><<</span> <span class="identifier">alpha</span><span class="special">/</span><span class="number">2</span> <span class="special"><<</span> <span class="string">") = "</span>
- <span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.037</span></pre>
+ <span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.037</span>
+</pre>
<p>
</p>
<p>
@@ -433,7 +453,8 @@
<span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 5e-005</span>
<span class="identifier">t</span> <span class="special">=</span> <span class="identifier">geometric</span><span class="special">::</span><span class="identifier">find_upper_bound_on_p</span><span class="special">(</span><span class="identifier">k</span><span class="special">,</span> <span class="identifier">alpha</span><span class="special">/</span><span class="number">2</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"geometric::find_upper_bound_on_p("</span> <span class="special"><<</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">k</span><span class="special">)</span> <span class="special"><<</span> <span class="string">", "</span> <span class="special"><<</span> <span class="identifier">alpha</span><span class="special">/</span><span class="number">2</span> <span class="special"><<</span> <span class="string">") = "</span>
- <span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.052</span></pre>
+ <span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// 0.052</span>
+</pre>
<p>
</p>
<p>
@@ -451,7 +472,8 @@
<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">&</span> <span class="identifier">e</span><span class="special">)</span>
<span class="special">{</span> <span class="comment">// Since we have set an overflow policy of ignore_error,</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"><<</span> <span class="string">"\nMessage from thrown exception was:\n "</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nMessage from thrown exception was:\n "</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/inverse_chi_squared_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/inverse_chi_squared_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/inverse_chi_squared_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -130,7 +130,6 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" 2.5% quantile: "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">prior</span><span class="special">,</span> <span class="number">0.025</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" 50% quantile: "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">prior</span><span class="special">,</span> <span class="number">0.5</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" 97.5% quantile: "</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">prior</span><span class="special">,</span> <span class="number">0.975</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-
</pre>
<p>
</p>
@@ -244,7 +243,8 @@
<span class="keyword">double</span> <span class="identifier">posteriorScale</span> <span class="special">=</span>
<span class="special">(</span><span class="identifier">priorDF</span> <span class="special">*</span> <span class="identifier">priorScale</span> <span class="special">+</span> <span class="special">(</span><span class="identifier">ballsSampleVariance</span> <span class="special">*</span> <span class="special">(</span><span class="identifier">ballsSampleSize</span> <span class="special">-</span> <span class="number">1</span><span class="special">)))</span> <span class="special">/</span> <span class="identifier">posteriorDF</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"prior scale: "</span> <span class="special"><<</span> <span class="identifier">priorScale</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"posterior scale: "</span> <span class="special"><<</span> <span class="identifier">posteriorScale</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"posterior scale: "</span> <span class="special"><<</span> <span class="identifier">posteriorScale</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -262,6 +262,7 @@
<span class="identifier">posterior</span> <span class="identifier">degrees</span><span class="special">-</span><span class="identifier">of</span><span class="special">-</span><span class="identifier">freedom</span><span class="special">:</span> <span class="number">120</span>
<span class="identifier">prior</span> <span class="identifier">scale</span><span class="special">:</span> <span class="number">25</span>
<span class="identifier">posterior</span> <span class="identifier">scale</span><span class="special">:</span> <span class="number">49.5</span>
+
</pre>
<p>
To compare the generic machinery performance with our suspect machine,
@@ -284,7 +285,6 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" probability variance <= 25: "</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">cdf</span><span class="special">(</span><span class="identifier">posterior</span><span class="special">,</span> <span class="number">25.0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" probability variance > 50: "</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">cdf</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">complement</span><span class="special">(</span><span class="identifier">posterior</span><span class="special">,</span> <span class="number">50.0</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/nccs_eg/nccs_power_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/nccs_eg/nccs_power_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/nccs_eg/nccs_power_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -50,7 +50,8 @@
<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">int</span> <span class="identifier">main</span><span class="special">()</span>
-<span class="special">{</span></pre>
+<span class="special">{</span>
+</pre>
<p>
</p>
<p>
@@ -64,7 +65,8 @@
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"[[lambda]="</span> <span class="special"><<</span> <span class="identifier">lam</span> <span class="special"><<</span> <span class="string">"]"</span><span class="special">;</span>
<span class="special">}</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"]\n"</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"]\n"</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -80,7 +82,8 @@
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"[["</span> <span class="special"><<</span> <span class="identifier">n</span> <span class="special"><<</span> <span class="string">"]"</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">lam</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span> <span class="identifier">lam</span> <span class="special"><=</span> <span class="number">20</span><span class="special">;</span> <span class="identifier">lam</span> <span class="special">+=</span> <span class="number">2</span><span class="special">)</span>
- <span class="special">{</span></pre>
+ <span class="special">{</span>
+</pre>
<p>
</p>
<p>
@@ -88,7 +91,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">cs</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">chi_squared</span><span class="special">(</span><span class="identifier">n</span><span class="special">),</span> <span class="number">0.05</span><span class="special">));</span></pre>
+<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">cs</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">chi_squared</span><span class="special">(</span><span class="identifier">n</span><span class="special">),</span> <span class="number">0.05</span><span class="special">));</span>
+</pre>
<p>
</p>
<p>
@@ -97,7 +101,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">beta</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">non_central_chi_squared</span><span class="special">(</span><span class="identifier">n</span><span class="special">,</span> <span class="identifier">lam</span><span class="special">),</span> <span class="identifier">cs</span><span class="special">));</span></pre>
+<pre class="programlisting"><span class="keyword">double</span> <span class="identifier">beta</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">non_central_chi_squared</span><span class="special">(</span><span class="identifier">n</span><span class="special">,</span> <span class="identifier">lam</span><span class="special">),</span> <span class="identifier">cs</span><span class="special">));</span>
+</pre>
<p>
</p>
<p>
@@ -110,7 +115,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"]"</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"]"</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_conf.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_conf.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_conf.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -67,7 +67,8 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">;</span> <span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iomanip</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>
-<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>
+<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>
@@ -76,7 +77,8 @@
</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>
+<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>
@@ -112,7 +114,8 @@
<span class="string">"___________________________________________\n"</span>
<span class="string">"Confidence Lower Upper\n"</span>
<span class="string">" Value (%) Limit Limit\n"</span>
- <span class="string">"___________________________________________\n"</span><span class="special">;</span></pre>
+ <span class="string">"___________________________________________\n"</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -142,7 +145,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">fixed</span> <span class="special"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">5</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">15</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">right</span> <span class="special"><<</span> <span class="identifier">upper</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<span class="identifier">cout</span> <span class="special"><<</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>
+<span class="special">}</span> <span class="comment">// void confidence_limits_on_frequency(unsigned trials, unsigned successes)</span>
+</pre>
<p>
</p>
<p>
@@ -159,7 +163,6 @@
<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>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/neg_binom_size_eg.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -48,7 +48,8 @@
</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>
+<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>
@@ -58,7 +59,8 @@
</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>
+<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>
@@ -80,8 +82,7 @@
</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 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>
<span class="special">{</span>
<span class="comment">// trials = number of trials</span>
<span class="comment">// failures = number of failures before achieving required success(es).</span>
@@ -107,7 +108,8 @@
<span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<span class="identifier">cout</span> <span class="special"><<</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>
+<span class="special">}</span> <span class="comment">// void find_number_of_trials(double failures, double p)</span>
+</pre>
<p>
</p>
<p>
@@ -127,7 +129,6 @@
<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>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -73,7 +73,8 @@
<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>
+<span class="preprocessor">#define</span> <span class="identifier">BOOST_MATH_DISCRETE_QUANTILE_POLICY</span> <span class="identifier">real</span>
+</pre>
<p>
</p>
<p>
@@ -124,7 +125,8 @@
<p>
</p>
<pre class="programlisting"><span class="keyword">try</span>
-<span class="special">{</span></pre>
+<span class="special">{</span>
+</pre>
<p>
</p>
<p>
@@ -134,7 +136,8 @@
</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>
+<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>
@@ -143,7 +146,8 @@
</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>
+<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>
@@ -160,7 +164,8 @@
</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>
+<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>
@@ -178,7 +183,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"With a success rate of "</span> <span class="special"><<</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="string">", he might expect, on average,\n"</span>
<span class="string">"to need to visit about "</span> <span class="special"><<</span> <span class="identifier">success_fraction</span> <span class="special">*</span> <span class="identifier">all_houses</span>
- <span class="special"><<</span> <span class="string">" houses in order to sell all "</span> <span class="special"><<</span> <span class="identifier">nb</span><span class="special">.</span><span class="identifier">successes</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" bars. "</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" houses in order to sell all "</span> <span class="special"><<</span> <span class="identifier">nb</span><span class="special">.</span><span class="identifier">successes</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" bars. "</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Pat has a sales per house success rate of 0.4.
@@ -200,7 +206,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability that Pat finishes on the "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span> <span class="special"><<</span> <span class="string">"th house is "</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">5</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// == pdf(nb, 0)</span></pre>
+ <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">5</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// == pdf(nb, 0)</span>
+</pre>
<p>
</p>
<p>
@@ -220,7 +227,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability that Pat finishes on the 7th house is "</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">7</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability that Pat finishes on the 8th house is "</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="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <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="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability that Pat finishes on the 6th house is 0.03072
@@ -240,7 +248,8 @@
<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">6</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="comment">// 1 failure.</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">7</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="comment">// 2 failures.</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">pdf(sales_quota) + pdf(6) + pdf(7) + pdf(8) = 0.17367
@@ -253,7 +262,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="string">" bars\non or before the "</span> <span class="special"><<</span> <span class="number">8</span> <span class="special"><<</span> <span class="string">"th house is "</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="number">8</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of selling his quota of 5 bars on or before the 8th house is 0.17367
@@ -264,7 +274,8 @@
<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">10</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="string">" bars\non or before the "</span> <span class="special"><<</span> <span class="number">10</span> <span class="special"><<</span> <span class="string">"th house is "</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="number">10</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability that Pat finishes exactly on the 10th house is 0.10033
@@ -276,7 +287,8 @@
<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">11</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="string">" bars\non or before the "</span> <span class="special"><<</span> <span class="number">11</span> <span class="special"><<</span> <span class="string">"th house is "</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="number">11</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability that Pat finishes on the 11th house is 0.10033
@@ -290,7 +302,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="string">" bars\non or before the "</span> <span class="special"><<</span> <span class="number">12</span> <span class="special"><<</span> <span class="string">"th house is "</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="number">12</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability that Pat finishes on the 12th house is 0.094596
@@ -306,7 +319,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability that Pat finishes on the "</span> <span class="special"><<</span> <span class="identifier">all_houses</span>
- <span class="special"><<</span> <span class="string">" house is "</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="identifier">all_houses</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" house is "</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="identifier">all_houses</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -326,7 +340,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nProbability of selling his quota of "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="string">" bars\non or before the "</span> <span class="special"><<</span> <span class="identifier">all_houses</span> <span class="special"><<</span> <span class="string">"th house is "</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> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <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> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of selling his quota of 5 bars
@@ -367,7 +382,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nProbability of failing to sell his quota of "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="string">" bars\neven after visiting all "</span> <span class="special"><<</span> <span class="identifier">all_houses</span> <span class="special"><<</span> <span class="string">" houses is "</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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <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">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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of failing to sell his quota of 5 bars
@@ -380,7 +396,8 @@
<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"><<</span> <span class="string">"Probability of meeting sales quota on or before 8th house is "</span><span class="special"><<</span> <span class="identifier">p</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Probability of meeting sales quota on or before 8th house is "</span><span class="special"><<</span> <span class="identifier">p</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">Probability of meeting sales quota on or before 8th house is 0.174
@@ -390,7 +407,8 @@
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special"><<</span> <span class="identifier">p</span>
<span class="special"><<</span> <span class="string">", then the finishing house is "</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">p</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="identifier">cout</span><span class="special"><<</span> <span class="string">" quantile(nb, p) = "</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">p</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span><span class="special"><<</span> <span class="string">" quantile(nb, p) = "</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">p</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">If the confidence of meeting sales quota is 0.17367, then the finishing house is 8
@@ -405,7 +423,8 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special"><<</span> <span class="number">1.</span>
<span class="special"><<</span> <span class="string">", then the finishing house is "</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="number">1</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// 1.#INF == infinity.</span></pre>
+<span class="comment">// 1.#INF == infinity.</span>
+</pre>
<p>
</p>
<pre class="programlisting">If the confidence of meeting sales quota is 1, then the finishing house is 1.#INF
@@ -422,7 +441,8 @@
<span class="special"><<</span> <span class="string">", then the finishing house is "</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="number">0.5</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">sales_quota</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"If the confidence of meeting sales quota is "</span> <span class="special"><<</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"><<</span> <span class="string">", then the finishing house is "</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="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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">", then the finishing house is "</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="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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">If the confidence of meeting sales quota is 0, then the finishing house is 5
@@ -441,7 +461,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special"><<</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"><<</span> <span class="identifier">sales_quota</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="string">", then finishing house is "</span> <span class="special"><<</span> <span class="identifier">sales_quota</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">If confidence of meeting quota is zero (we assume all houses are successful sales), then finishing house is 5
@@ -460,7 +481,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"If confidence of meeting quota is "</span> <span class="special"><<</span> <span class="identifier">ps</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span>
<span class="special"><<</span> <span class="string">", then finishing house is "</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> <span class="special">+</span> <span class="identifier">sales_quota</span>
<span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<pre class="programlisting">If confidence of meeting quota is 0, then finishing house is 5
@@ -514,7 +536,8 @@
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">left</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">i</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">8</span><span class="special">)</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">i</span> <span class="special">-</span> <span class="identifier">sales_quota</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</spa
n>
<span class="special">}</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<pre class="programlisting">House for 5 th (last) sale. Probability (%)
@@ -555,7 +578,8 @@
<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">&</span> <span class="identifier">e</span><span class="special">)</span>
<span class="special">{</span> <span class="comment">// Since we have set an overflow policy of ignore_error,</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"><<</span> <span class="string">"\nMessage from thrown exception was:\n "</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"\nMessage from thrown exception was:\n "</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/normal_example/normal_misc.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -58,7 +58,8 @@
<span class="keyword">try</span>
<span class="special">{</span>
- <span class="special">{</span> <span class="comment">// Traditional tables and values.</span></pre>
+ <span class="special">{</span> <span class="comment">// Traditional tables and values.</span>
+</pre>
<p>
</p>
<p>
@@ -77,7 +78,8 @@
<span class="comment">// Construct a standard normal distribution s</span>
<span class="identifier">normal</span> <span class="identifier">s</span><span class="special">;</span> <span class="comment">// (default mean = zero, and standard deviation = unity)</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Standard normal distribution, mean = "</span><span class="special"><<</span> <span class="identifier">s</span><span class="special">.</span><span class="identifier">mean</span><span class="special">()</span>
- <span class="special"><<</span> <span class="string">", standard deviation = "</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="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">", standard deviation = "</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="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -93,7 +95,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">left</span> <span class="special"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">6</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" "</span>
<span class="special"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="identifier">precision</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">12</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">pdf</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"><<</span> <span class="identifier">endl</span><span class="special">;</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">6</span><span class="special">);</span> <span class="comment">// default</span></pre>
+<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>
@@ -112,7 +115,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">left</span> <span class="special"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">6</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" "</span>
<span class="special"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="identifier">precision</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">12</span><span class="special">)</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="identifier">z</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</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">6</span><span class="special">);</span> <span class="comment">// default</span></pre>
+<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>
@@ -134,7 +138,8 @@
<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"><<</span> <span class="string">"Area for z = "</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" is "</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="identifier">z</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// to get the area for z.</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Area for z = "</span> <span class="special"><<</span> <span class="identifier">z</span> <span class="special"><<</span> <span class="string">" is "</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="identifier">z</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// to get the area for z.</span>
+</pre>
<p>
</p>
<p>
@@ -146,7 +151,8 @@
<p>
</p>
<pre class="programlisting"> <span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"95% of area has a z below "</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.95</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// 95% of area has a z below 1.64485</span></pre>
+<span class="comment">// 95% of area has a z below 1.64485</span>
+</pre>
<p>
</p>
<p>
@@ -157,7 +163,8 @@
</p>
<pre class="programlisting"> <span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"95% of area has a z between "</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"><<</span> <span class="string">" and "</span> <span class="special"><<</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"><<</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>
+<span class="comment">// 95% of area has a z between 1.95996 and -1.95996</span>
+</pre>
<p>
</p>
<p>
@@ -172,7 +179,8 @@
<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"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">17</span><span class="special">)</span> <span class="special"><<</span> <span class="string">"Significance level for z == 1 is "</span> <span class="special"><<</span> <span class="identifier">alpha1</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">17</span><span class="special">)</span> <span class="special"><<</span> <span class="string">"Significance level for z == 1 is "</span> <span class="special"><<</span> <span class="identifier">alpha1</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -181,7 +189,8 @@
<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>
+ <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>
@@ -198,7 +207,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">15</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">alpha</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">15</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">alpha</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">/</span><span class="number">2</span> <span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">10</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">quantile</span><span class=
"special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">alpha</span><span class="special">[</span><span class="identifier">i</span><span class="special">]/</span><span class="number">2</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Use quantile(complement(s, alpha[i]/2)) to avoid potential loss of accuracy from quantile(s, 1 - alpha[i]/2) </span>
<span class="special">}</span>
-<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -241,7 +251,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Fraction 2 standard deviations within either side of mean is "</span>
<span class="special"><<</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">2</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Fraction 3 standard deviations within either side of mean is "</span>
- <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -289,7 +300,8 @@
<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>
+ <span class="comment">// ISBN 1 58488 635 8, page 125, example 10.3.5</span>
+</pre>
<p>
</p>
<p>
@@ -303,7 +315,8 @@
<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>
+<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>
@@ -321,7 +334,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Fraction of bulbs that will last between "</span>
<span class="special"><<</span> <span class="identifier">min_life</span> <span class="special"><<</span> <span class="string">" and "</span> <span class="special"><<</span> <span class="identifier">max_life</span> <span class="special"><<</span> <span class="string">" is "</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">max_life</span><span class="special">)</span> <span class="comment">// P(X <= 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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X <= 900)</span></pre>
+ <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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X <= 900)</span>
+</pre>
<p>
</p>
<div class="note"><table border="0" summary="Note">
@@ -354,7 +368,8 @@
<span class="keyword">double</span> <span class="identifier">stock</span> <span class="special">=</span> <span class="number">160.</span><span class="special">;</span> <span class="comment">// per week.</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Percentage of weeks overstocked "</span>
<span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// P(X <=160)</span>
-<span class="comment">// Percentage of weeks overstocked 97.7</span></pre>
+<span class="comment">// Percentage of weeks overstocked 97.7</span>
+</pre>
<p>
</p>
<p>
@@ -364,7 +379,8 @@
<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"><<</span> <span class="string">"Store should stock "</span> <span class="special"><<</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">stock_95</span><span class="special">)</span> <span class="special"><<</span> <span class="string">" sacks to meet 95% of demands."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Store should stock "</span> <span class="special"><<</span> <span class="keyword">int</span><span class="special">(</span><span class="identifier">stock_95</span><span class="special">)</span> <span class="special"><<</span> <span class="string">" sacks to meet 95% of demands."</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -421,7 +437,8 @@
<span class="identifier">normal</span> <span class="identifier">nominal_packs</span><span class="special">(</span><span class="identifier">nominal_mean</span><span class="special">,</span> <span class="identifier">standard_deviation</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Setting the packer to "</span> <span class="special"><<</span> <span class="identifier">nominal_mean</span> <span class="special"><<</span> <span class="string">" will mean that "</span>
<span class="special"><<</span> <span class="string">"fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">under_weight</span>
- <span class="special"><<</span> <span class="string">" is "</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">nominal_packs</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" is "</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">nominal_packs</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -446,7 +463,8 @@
</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"><<</span> <span class="string">"Quantile of "</span> <span class="special"><<</span> <span class="identifier">p</span> <span class="special"><<</span> <span class="string">" = "</span> <span class="special"><<</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"><<</span> <span class="string">", mean = "</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="special"><<</span> <span class="string">", sd = "</span> <span class="special"><<</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">//</span></pre>
+ <span class="special"><<</span> <span class="string">", mean = "</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="special"><<</span> <span class="string">", sd = "</span> <span class="special"><<</span> <span class="identifier">packs</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">//</span>
+</pre>
<p>
</p>
<p>
@@ -470,7 +488,8 @@
<span class="identifier">cout</span> <span class="special"><<</span><span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">under_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack05</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">pack05</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">//</span></pre>
+<span class="comment">//</span>
+</pre>
<p>
</p>
<p>
@@ -490,7 +509,8 @@
<span class="identifier">cout</span> <span class="special"><<</span><span class="string">"Fraction of packs >= "</span> <span class="special"><<</span> <span class="identifier">under_weight</span> <span class="special"><<</span> <span class="string">" with a mean of "</span> <span class="special"><<</span> <span class="identifier">mean</span>
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack06</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
- <span class="special"><<</span> <span class="string">" is "</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">pack06</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span></pre>
+ <span class="special"><<</span> <span class="string">" is "</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">pack06</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -531,7 +551,8 @@
<span class="special"><<</span> <span class="string">" and standard deviation of "</span> <span class="special"><<</span> <span class="identifier">pack95</span><span class="special">.</span><span class="identifier">standard_deviation</span><span class="special">()</span>
<span class="special"><<</span> <span class="string">" is "</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">pack95</span><span class="special">,</span> <span class="identifier">under_weight</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.0608 is 0.95</span></pre>
+<span class="comment">// Fraction of packs >= 2.9 with a mean of 3 and standard deviation of 0.0608 is 0.95</span>
+</pre>
<p>
</p>
<p>
@@ -570,7 +591,6 @@
<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">bolts</span><span class="special">,</span> <span class="identifier">top</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"95% of bolts are shorter than "</span> <span class="special"><<</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"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -29,6 +29,14 @@
</h3></div></div></div>
<h5>
<a name="math_toolkit.main_overview.history1.h0"></a>
+ <span><a name="math_toolkit.main_overview.history1.boost_1_50"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_50">Boost-1.50</a>
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ Fixed issue in <code class="computeroutput"><span class="identifier">bessel_jy</span></code>
+ which causes Y<sub>8.5</sub>(4π) to yield a NaN.
+ </li></ul></div>
+<h5>
+<a name="math_toolkit.main_overview.history1.h1"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_49"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_49">Boost-1.49</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -72,7 +80,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h1"></a>
+<a name="math_toolkit.main_overview.history1.h2"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_48"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_48">Boost-1.48</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -123,7 +131,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h2"></a>
+<a name="math_toolkit.main_overview.history1.h3"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_47"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_47">Boost-1.47</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -140,7 +148,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h3"></a>
+<a name="math_toolkit.main_overview.history1.h4"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_46_1"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_46_1">Boost-1.46.1</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
@@ -148,7 +156,7 @@
<a href="https://svn.boost.org/trac/boost/ticket/5095" target="_top">#5113</a>.
</li></ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h4"></a>
+<a name="math_toolkit.main_overview.history1.h5"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_46_0"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_46_0">Boost-1.46.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -163,7 +171,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h5"></a>
+<a name="math_toolkit.main_overview.history1.h6"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_45_0"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_45_0">Boost-1.45.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -180,7 +188,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h6"></a>
+<a name="math_toolkit.main_overview.history1.h7"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_44_0"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_44_0">Boost-1.44.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -194,7 +202,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h7"></a>
+<a name="math_toolkit.main_overview.history1.h8"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_41_0"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_41_0">Boost-1.41.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
@@ -202,7 +210,7 @@
and its inverse.
</li></ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h8"></a>
+<a name="math_toolkit.main_overview.history1.h9"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_40_0"></a></span><a class="link" href="history1.html#math_toolkit.main_overview.history1.boost_1_40_0">Boost-1.40.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -239,7 +247,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h9"></a>
+<a name="math_toolkit.main_overview.history1.h10"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_38_0"></a></span><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 class="itemizedlist" type="disc">
@@ -251,14 +259,14 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h10"></a>
+<a name="math_toolkit.main_overview.history1.h11"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_37_0"></a></span><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 class="itemizedlist" type="disc"><li class="listitem">
Improved accuracy and testing of the inverse hypergeometric functions.
</li></ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h11"></a>
+<a name="math_toolkit.main_overview.history1.h12"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_36_0"></a></span><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 class="itemizedlist" type="disc">
@@ -291,7 +299,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h12"></a>
+<a name="math_toolkit.main_overview.history1.h13"></a>
<span><a name="math_toolkit.main_overview.history1.boost_1_35_0__post_review_first_official_release"></a></span><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>
@@ -323,7 +331,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h13"></a>
+<a name="math_toolkit.main_overview.history1.h14"></a>
<span><a name="math_toolkit.main_overview.history1.milestone_4__second_review_candidate__1st_march_2007_"></a></span><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>
@@ -337,7 +345,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h14"></a>
+<a name="math_toolkit.main_overview.history1.h15"></a>
<span><a name="math_toolkit.main_overview.history1.milestone_3__first_review_candidate__31st_dec_2006_"></a></span><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>
@@ -365,7 +373,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h15"></a>
+<a name="math_toolkit.main_overview.history1.h16"></a>
<span><a name="math_toolkit.main_overview.history1.milestone_2__released_september_10th_2006"></a></span><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>
@@ -401,7 +409,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.main_overview.history1.h16"></a>
+<a name="math_toolkit.main_overview.history1.h17"></a>
<span><a name="math_toolkit.main_overview.history1.milestone_1__released_march_31st_2006"></a></span><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>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/discrete_quant_ref.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -78,7 +78,6 @@
<span class="keyword">double</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">dist_type</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">);</span>
<span class="comment">// Upper 95% quantile:</span>
<span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist_type</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">));</span>
-
</pre>
<p>
</p>
@@ -119,7 +118,6 @@
<span class="keyword">double</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">negative_binomial</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">);</span> <span class="comment">// rounded up 27 from 27.3898</span>
<span class="comment">// Upper quantile rounded up:</span>
<span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">negative_binomial</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">));</span> <span class="comment">// rounded down to 69 from 68.1584</span>
-
</pre>
<p>
</p>
@@ -177,7 +175,6 @@
<span class="keyword">double</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">dist_type</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">);</span> <span class="comment">// 28 rounded up from 27.3898</span>
<span class="comment">// Upper quantile rounded down:</span>
<span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist_type</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">));</span> <span class="comment">// 68 rounded down from 68.1584</span>
-
</pre>
<p>
</p>
@@ -244,7 +241,6 @@
<span class="keyword">double</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">dist_type</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">);</span> <span class="comment">// 27</span>
<span class="comment">// Upper quantile rounded (down) to nearest:</span>
<span class="keyword">double</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist_type</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">),</span> <span class="number">0.05</span><span class="special">));</span> <span class="comment">// 68</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -760,7 +760,6 @@
<span class="comment">// Construct a my_norm distribution, using default mean and standard deviation,</span>
<span class="comment">// and get a 0.05 or 5% quantile:</span>
<span class="keyword">double</span> <span class="identifier">q</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">my_norm</span><span class="special">(),</span> <span class="number">0.05</span><span class="special">);</span> <span class="comment">// = -1.64485</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/internal_promotion.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -111,7 +111,6 @@
<span class="comment">// Alternatively we could use helper function make_policy,</span>
<span class="comment">// and concisely define everything at the call site:</span>
<span class="keyword">double</span> <span class="identifier">t2</span> <span class="special">=</span> <span class="identifier">tgamma</span><span class="special">(</span><span class="identifier">some_value</span><span class="special">,</span> <span class="identifier">make_policy</span><span class="special">(</span><span class="identifier">promote_double</span><span class="special"><</span><span class="keyword">false</span><span class="special">>()));</span>
-
</pre>
<p>
</p>
@@ -136,7 +135,6 @@
<span class="comment">// Get a quantile:</span>
<span class="keyword">float</span> <span class="identifier">q</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">my_norm</span><span class="special">(),</span> <span class="number">0.05f</span><span class="special">);</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/namespace_pol.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/namespace_pol.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/namespace_pol.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -68,7 +68,6 @@
<span class="keyword">double</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">myspace</span><span class="special">::</span><span class="identifier">tgamma</span><span class="special">(</span><span class="number">30.0</span><span class="special">);</span> <span class="comment">// Will *not* throw on overflow,</span>
<span class="comment">// despite the large value of factorial 30 = 265252859812191058636308480000000</span>
<span class="comment">// unlike default policy boost::math::tgamma;</span>
-
</pre>
<p>
</p>
@@ -133,7 +132,6 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/precision_pol.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/precision_pol.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/precision_pol.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -82,7 +82,6 @@
<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><span class="identifier">policies</span><span class="special">;</span>
<span class="keyword">double</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">tgamma</span><span class="special">(</span><span class="number">12</span><span class="special">,</span> <span class="identifier">policy</span><span class="special"><</span><span class="identifier">digits10</span><span class="special"><</span><span class="number">5</span><span class="special">></span> <span class="special">>());</span> <span class="comment">// Concise make_policy.</span>
-
</pre>
<p>
</p>
@@ -101,7 +100,6 @@
<span class="keyword">double</span> <span class="identifier">q</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span>
<span class="identifier">normal_distribution</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">policy</span><span class="special"><</span><span class="identifier">digits2</span><span class="special"><</span><span class="identifier">bits</span><span class="special">></span> <span class="special">></span> <span class="special">>(),</span>
<span class="number">0.05</span><span class="special">);</span> <span class="comment">// 5% quantile.</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_dist_policies.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_dist_policies.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_dist_policies.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -83,7 +83,6 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"quantile(mybinom(200, 0.25), 0.05) is: "</span> <span class="special"><<</span>
<span class="identifier">quantile</span><span class="special">(</span><span class="identifier">mybinom</span><span class="special">(</span><span class="number">200</span><span class="special">,</span> <span class="number">0.25</span><span class="special">),</span> <span class="number">0.05</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_sf_policies.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_sf_policies.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/ad_hoc_sf_policies.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -101,7 +101,6 @@
<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">tgamma</span><span class="special">(-</span><span class="number">10</span><span class="special">,</span> <span class="identifier">c_policy</span><span class="special">())</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Negative parameter.</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"errno = "</span> <span class="special"><<</span> <span class="identifier">errno</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// error 33 Numerical argument out of domain.</span>
<span class="special">}</span> <span class="comment">// int main()</span>
-
</pre>
<p>
</p>
@@ -160,7 +159,6 @@
<span class="comment">// Check errno was set:</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"errno = "</span> <span class="special"><<</span> <span class="identifier">errno</span> <span class="special"><<</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>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/changing_policy_defaults.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/changing_policy_defaults.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/changing_policy_defaults.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -175,7 +175,8 @@
<span class="keyword">using</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">;</span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cstddef</span><span class="special">></span>
- <span class="comment">// using ::errno</span></pre>
+ <span class="comment">// using ::errno</span>
+</pre>
<p>
</p>
<p>
@@ -217,7 +218,8 @@
<span class="string">"\n"</span><span class="string">"Message from thrown exception was:\n "</span> <span class="special"><<</span> <span class="identifier">e</span><span class="special">.</span><span class="identifier">what</span><span class="special">()</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<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>
+<span class="special">}</span> <span class="comment">// int main()</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/namespace_policies.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/namespace_policies.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/namespace_policies.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -53,7 +53,8 @@
<p>
</p>
<pre class="programlisting"><span class="preprocessor">#include</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">special_functions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="comment">//using boost::math::tgamma; // Not needed because using C::tgamma.</span></pre>
+<span class="comment">//using boost::math::tgamma; // Not needed because using C::tgamma.</span>
+</pre>
<p>
</p>
<p>
@@ -82,7 +83,8 @@
<span class="identifier">pole_error</span><span class="special"><</span><span class="identifier">errno_on_error</span><span class="special">>,</span>
<span class="identifier">overflow_error</span><span class="special"><</span><span class="identifier">errno_on_error</span><span class="special">>,</span>
<span class="identifier">evaluation_error</span><span class="special"><</span><span class="identifier">errno_on_error</span><span class="special">></span>
- <span class="special">></span> <span class="identifier">c_policy</span><span class="special">;</span></pre>
+ <span class="special">></span> <span class="identifier">c_policy</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -93,7 +95,8 @@
</p>
<pre class="programlisting"><span class="identifier">BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS</span><span class="special">(</span><span class="identifier">c_policy</span><span class="special">)</span>
-<span class="special">}</span> <span class="comment">// close namespace C</span></pre>
+<span class="special">}</span> <span class="comment">// close namespace C</span>
+</pre>
<p>
</p>
<p>
@@ -127,7 +130,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Result of tgamma(-10) is: "</span>
<span class="special"><<</span> <span class="identifier">C</span><span class="special">::</span><span class="identifier">tgamma</span><span class="special">(-</span><span class="number">10</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"errno = "</span> <span class="special"><<</span> <span class="identifier">errno</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// errno = 33, overwriting previous value of 34.</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -167,7 +171,8 @@
<span class="identifier">evaluation_error</span><span class="special"><</span><span class="identifier">errno_on_error</span><span class="special">></span>
<span class="special">></span> <span class="identifier">c_policy</span><span class="special">;</span>
-<span class="identifier">BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS</span><span class="special">(</span><span class="identifier">c_policy</span><span class="special">)</span></pre>
+<span class="identifier">BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS</span><span class="special">(</span><span class="identifier">c_policy</span><span class="special">)</span>
+</pre>
<p>
</p>
<p>
@@ -191,7 +196,6 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"errno = "</span> <span class="special"><<</span> <span class="identifier">errno</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Default tgamma policy would throw an exception, and abort.</span>
<span class="special">}</span>
-
</pre>
<p>
</p>
@@ -230,7 +234,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="preprocessor">#include</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">distributions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
+<pre class="programlisting"><span class="preprocessor">#include</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">distributions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
<p>
</p>
<p>
@@ -252,7 +257,8 @@
<span class="identifier">promote_double</span><span class="special"><</span><span class="keyword">false</span><span class="special">>,</span>
<span class="comment">// Return the closest integer result for discrete quantiles:</span>
<span class="identifier">discrete_quantile</span><span class="special"><</span><span class="identifier">integer_round_nearest</span><span class="special">></span>
- <span class="special">></span> <span class="identifier">my_policy</span><span class="special">;</span></pre>
+ <span class="special">></span> <span class="identifier">my_policy</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -265,7 +271,8 @@
</p>
<pre class="programlisting"><span class="identifier">BOOST_MATH_DECLARE_DISTRIBUTIONS</span><span class="special">(</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">my_policy</span><span class="special">)</span>
-<span class="special">}</span> <span class="comment">// close namespace my_namespace</span></pre>
+<span class="special">}</span> <span class="comment">// close namespace my_namespace</span>
+</pre>
<p>
</p>
<p>
@@ -307,7 +314,8 @@
<span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">binom</span><span class="special">,</span> <span class="number">0.05</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span> <span class="comment">// To check we get integer results.</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Result of quantile(complement(binom, 0.05)) is: "</span>
<span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">binom</span><span class="special">,</span> <span class="number">0.05</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -387,7 +395,6 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Result of quantile(complement(binom, 0.05)) is: "</span>
<span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">binom</span><span class="special">,</span> <span class="number">0.05</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/understand_dis_quant.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -256,7 +256,8 @@
<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>
-<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
+<span class="preprocessor">#include</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">distributions</span><span class="special">/</span><span class="identifier">binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
<p>
</p>
<p>
@@ -313,7 +314,8 @@
<span class="keyword">typedef</span> <span class="identifier">binomial_distribution</span><span class="special"><</span>
<span class="keyword">double</span><span class="special">,</span>
<span class="identifier">policy</span><span class="special"><</span><span class="identifier">discrete_quantile</span><span class="special"><</span><span class="identifier">real</span><span class="special">></span> <span class="special">></span> <span class="special">></span>
- <span class="identifier">binom_real_quantile</span><span class="special">;</span></pre>
+ <span class="identifier">binom_real_quantile</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -387,7 +389,8 @@
<span class="special"><<</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">18</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">right</span>
<span class="special"><<</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">binom_real_quantile</span><span class="special">(</span><span class="number">50</span><span class="special">,</span> <span class="number">0.5</span><span class="special">),</span> <span class="number">0.95</span><span class="special">)</span>
<span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span> <span class="comment">// int main()</span></pre>
+<span class="special">}</span> <span class="comment">// int main()</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_tutorial/user_def_err_pol.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -84,7 +84,8 @@
<span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">quiet_NaN</span><span class="special">();</span>
<span class="special">}</span>
<span class="special">}</span> <span class="comment">// namespace policies</span>
-<span class="special">}}</span> <span class="comment">// namespace boost{ namespace math</span></pre>
+<span class="special">}}</span> <span class="comment">// namespace boost{ namespace math</span>
+</pre>
<p>
</p>
<p>
@@ -104,7 +105,8 @@
<span class="identifier">BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS</span><span class="special">(</span><span class="identifier">user_error_policy</span><span class="special">)</span>
-<span class="special">}</span> <span class="comment">// close unnamed namespace</span></pre>
+<span class="special">}</span> <span class="comment">// close unnamed namespace</span>
+</pre>
<p>
</p>
<p>
@@ -136,7 +138,8 @@
<span class="special"><<</span> <span class="identifier">erf_inv</span><span class="special">(-</span><span class="number">10</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Result of tgamma(-10) is: "</span>
<span class="special"><<</span> <span class="identifier">tgamma</span><span class="special">(-</span><span class="number">10</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -196,7 +199,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="preprocessor">#include</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">special_functions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
+<pre class="programlisting"><span class="preprocessor">#include</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">special_functions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
<p>
</p>
<p>
@@ -211,7 +215,8 @@
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
<span class="identifier">T</span> <span class="identifier">user_domain_error</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">function</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">message</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">val</span><span class="special">)</span>
-<span class="special">{</span></pre>
+<span class="special">{</span>
+</pre>
<p>
</p>
<p>
@@ -223,7 +228,8 @@
<pre class="programlisting"><span class="keyword">if</span><span class="special">(</span><span class="identifier">function</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span>
<span class="identifier">function</span> <span class="special">=</span> <span class="string">"Unknown function with arguments of type %1%"</span><span class="special">;</span>
<span class="keyword">if</span><span class="special">(</span><span class="identifier">message</span> <span class="special">==</span> <span class="number">0</span><span class="special">)</span>
- <span class="identifier">message</span> <span class="special">=</span> <span class="string">"Cause unknown with bad argument %1%"</span><span class="special">;</span></pre>
+ <span class="identifier">message</span> <span class="special">=</span> <span class="string">"Cause unknown with bad argument %1%"</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -233,7 +239,8 @@
<p>
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">msg</span><span class="special">(</span><span class="string">"Error in function "</span><span class="special">);</span>
-<span class="identifier">msg</span> <span class="special">+=</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">format</span><span class="special">(</span><span class="identifier">function</span><span class="special">)</span> <span class="special">%</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">).</span><span class="identifier">name</span><span class="special">()).</span><span class="identifier">str</span><span class="special">();</span></pre>
+<span class="identifier">msg</span> <span class="special">+=</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">format</span><span class="special">(</span><span class="identifier">function</span><span class="special">)</span> <span class="special">%</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">).</span><span class="identifier">name</span><span class="special">()).</span><span class="identifier">str</span><span class="special">();</span>
+</pre>
<p>
</p>
<p>
@@ -245,7 +252,8 @@
<pre class="programlisting"><span class="identifier">msg</span> <span class="special">+=</span> <span class="string">": \n"</span><span class="special">;</span>
<span class="keyword">int</span> <span class="identifier">prec</span> <span class="special">=</span> <span class="number">2</span> <span class="special">+</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">digits</span> <span class="special">*</span> <span class="number">30103UL</span><span class="special">)</span> <span class="special">/</span> <span class="number">100000UL</span><span class="special">;</span>
<span class="comment">// int prec = std::numeric_limits<T>::max_digits10; // For C++0X Standard Library</span>
-<span class="identifier">msg</span> <span class="special">+=</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">format</span><span class="special">(</span><span class="identifier">message</span><span class="special">)</span> <span class="special">%</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">io</span><span class="special">::</span><span class="identifier">group</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">setprecision</span><span class="special">(</span><span class="identifier">prec</span><span class="special">),</span> <span class="identifier">val</span><span class="special">)).</span><span class="identifier">str</span><span class="special">();</span></pre>
+<span class="identifier">msg</span> <span class="special">+=</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">format</span><span class="special">(</span><span class="identifier">message</span><span class="special">)</span> <span class="special">%</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">io</span><span class="special">::</span><span class="identifier">group</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">setprecision</span><span class="special">(</span><span class="identifier">prec</span><span class="special">),</span> <span class="identifier">val</span><span class="special">)).</span><span class="identifier">str</span><span class="special">();</span>
+</pre>
<p>
</p>
<p>
@@ -254,7 +262,8 @@
</p>
<p>
</p>
-<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cerr</span> <span class="special"><<</span> <span class="identifier">msg</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span></pre>
+<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cerr</span> <span class="special"><<</span> <span class="identifier">msg</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre>
<p>
</p>
<p>
@@ -264,7 +273,8 @@
<p>
</p>
<pre class="programlisting"> <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">quiet_NaN</span><span class="special">();</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -277,7 +287,8 @@
<span class="identifier">T</span> <span class="identifier">user_pole_error</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">function</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">message</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">val</span><span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">user_domain_error</span><span class="special">(</span><span class="identifier">function</span><span class="special">,</span> <span class="identifier">message</span><span class="special">,</span> <span class="identifier">val</span><span class="special">);</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -304,7 +315,8 @@
<span class="comment">// Value passed to the function is an infinity, just return it:</span>
<span class="keyword">return</span> <span class="identifier">val</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -330,7 +342,8 @@
<span class="comment">// Value passed to the function is zero, just return it:</span>
<span class="keyword">return</span> <span class="identifier">val</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -356,7 +369,8 @@
<span class="comment">// Value passed to the function is denormalised, just return it:</span>
<span class="keyword">return</span> <span class="identifier">val</span><span class="special">;</span>
-<span class="special">}</span></pre>
+<span class="special">}</span>
+</pre>
<p>
</p>
<p>
@@ -392,7 +406,8 @@
<span class="special">}</span>
<span class="special">}</span> <span class="comment">// policies</span>
-<span class="special">}}</span> <span class="comment">// boost::math</span></pre>
+<span class="special">}}</span> <span class="comment">// boost::math</span>
+</pre>
<p>
</p>
<p>
@@ -417,7 +432,8 @@
<span class="identifier">BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS</span><span class="special">(</span><span class="identifier">user_error_policy</span><span class="special">)</span>
-<span class="special">}</span> <span class="comment">// unnamed namespace</span></pre>
+<span class="special">}</span> <span class="comment">// unnamed namespace</span>
+</pre>
<p>
</p>
<p>
@@ -460,7 +476,8 @@
<span class="comment">// Unfortunately we can't predicably raise a denormalised</span>
<span class="comment">// result, nor can we raise an evaluation error in this example</span>
<span class="comment">// since these should never really occur!</span>
-<span class="special">}</span> <span class="comment">// int main()</span></pre>
+<span class="special">}</span> <span class="comment">// int main()</span>
+</pre>
<p>
</p>
<p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/history1.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/history1.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/history1.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -28,6 +28,14 @@
</h3></div></div></div>
<h5>
<a name="math_toolkit.status.history1.h0"></a>
+ <span><a name="math_toolkit.status.history1.boost_1_50"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_50">Boost-1.50</a>
+ </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ Fixed issue in <code class="computeroutput"><span class="identifier">bessel_jy</span></code>
+ which causes Y<sub>8.5</sub>(4π) to yield a NaN.
+ </li></ul></div>
+<h5>
+<a name="math_toolkit.status.history1.h1"></a>
<span><a name="math_toolkit.status.history1.boost_1_49"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_49">Boost-1.49</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -71,7 +79,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h1"></a>
+<a name="math_toolkit.status.history1.h2"></a>
<span><a name="math_toolkit.status.history1.boost_1_48"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_48">Boost-1.48</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -122,7 +130,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h2"></a>
+<a name="math_toolkit.status.history1.h3"></a>
<span><a name="math_toolkit.status.history1.boost_1_47"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_47">Boost-1.47</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -139,7 +147,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h3"></a>
+<a name="math_toolkit.status.history1.h4"></a>
<span><a name="math_toolkit.status.history1.boost_1_46_1"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_46_1">Boost-1.46.1</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
@@ -147,7 +155,7 @@
<a href="https://svn.boost.org/trac/boost/ticket/5095" target="_top">#5113</a>.
</li></ul></div>
<h5>
-<a name="math_toolkit.status.history1.h4"></a>
+<a name="math_toolkit.status.history1.h5"></a>
<span><a name="math_toolkit.status.history1.boost_1_46_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_46_0">Boost-1.46.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -162,7 +170,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h5"></a>
+<a name="math_toolkit.status.history1.h6"></a>
<span><a name="math_toolkit.status.history1.boost_1_45_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_45_0">Boost-1.45.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -179,7 +187,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h6"></a>
+<a name="math_toolkit.status.history1.h7"></a>
<span><a name="math_toolkit.status.history1.boost_1_44_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_44_0">Boost-1.44.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -193,7 +201,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h7"></a>
+<a name="math_toolkit.status.history1.h8"></a>
<span><a name="math_toolkit.status.history1.boost_1_41_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_41_0">Boost-1.41.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
@@ -201,7 +209,7 @@
and its inverse.
</li></ul></div>
<h5>
-<a name="math_toolkit.status.history1.h8"></a>
+<a name="math_toolkit.status.history1.h9"></a>
<span><a name="math_toolkit.status.history1.boost_1_40_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_40_0">Boost-1.40.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -238,7 +246,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h9"></a>
+<a name="math_toolkit.status.history1.h10"></a>
<span><a name="math_toolkit.status.history1.boost_1_38_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_38_0">Boost-1.38.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -250,14 +258,14 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h10"></a>
+<a name="math_toolkit.status.history1.h11"></a>
<span><a name="math_toolkit.status.history1.boost_1_37_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_37_0">Boost-1.37.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
Improved accuracy and testing of the inverse hypergeometric functions.
</li></ul></div>
<h5>
-<a name="math_toolkit.status.history1.h11"></a>
+<a name="math_toolkit.status.history1.h12"></a>
<span><a name="math_toolkit.status.history1.boost_1_36_0"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_36_0">Boost-1.36.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -290,7 +298,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h12"></a>
+<a name="math_toolkit.status.history1.h13"></a>
<span><a name="math_toolkit.status.history1.boost_1_35_0__post_review_first_official_release"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.boost_1_35_0__post_review_first_official_release">Boost-1.35.0:
Post Review First Official Release</a>
</h5>
@@ -322,7 +330,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h13"></a>
+<a name="math_toolkit.status.history1.h14"></a>
<span><a name="math_toolkit.status.history1.milestone_4__second_review_candidate__1st_march_2007_"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.milestone_4__second_review_candidate__1st_march_2007_">Milestone
4: Second Review Candidate (1st March 2007)</a>
</h5>
@@ -336,7 +344,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h14"></a>
+<a name="math_toolkit.status.history1.h15"></a>
<span><a name="math_toolkit.status.history1.milestone_3__first_review_candidate__31st_dec_2006_"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.milestone_3__first_review_candidate__31st_dec_2006_">Milestone
3: First Review Candidate (31st Dec 2006)</a>
</h5>
@@ -364,7 +372,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h15"></a>
+<a name="math_toolkit.status.history1.h16"></a>
<span><a name="math_toolkit.status.history1.milestone_2__released_september_10th_2006"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.milestone_2__released_september_10th_2006">Milestone
2: Released September 10th 2006</a>
</h5>
@@ -400,7 +408,7 @@
</li>
</ul></div>
<h5>
-<a name="math_toolkit.status.history1.h16"></a>
+<a name="math_toolkit.status.history1.h17"></a>
<span><a name="math_toolkit.status.history1.milestone_1__released_march_31st_2006"></a></span><a class="link" href="history1.html#math_toolkit.status.history1.milestone_1__released_march_31st_2006">Milestone
1: Released March 31st 2006</a>
</h5>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/examples.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/examples.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/examples.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -57,7 +57,6 @@
<span class="comment">// with the new locale containing the nonfinite_numput facet.</span>
<span class="comment">// So the cout output will be "1.#INF on MS platforms</span>
<span class="comment">// and may be "inf" or other string representation on other platforms.</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/intro.html
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/intro.html (original)
+++ trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fp_facets/intro.html 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -124,7 +124,6 @@
<span class="comment">// with the new locale containing the nonfinite_numput facet.</span>
<span class="comment">// So the cout output will be "1.#INF on MS platforms</span>
<span class="comment">// and may be "inf" or other string representation on other platforms.</span>
-
</pre>
<p>
</p>
Modified: trunk/libs/math/doc/sf_and_dist/roadmap.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/roadmap.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/roadmap.qbk 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -1,5 +1,9 @@
[template history[]
+[h4 Boost-1.50]
+
+* Fixed issue in `bessel_jy` which causes Y[sub 8.5](4[pi]) to yield a NaN.
+
[h4 Boost-1.49]
* Deprecated wrongly named `twothirds` math constant in favour of `two_thirds` (with underscore separator).
Modified: trunk/libs/math/test/pch.hpp
==============================================================================
--- trunk/libs/math/test/pch.hpp (original)
+++ trunk/libs/math/test/pch.hpp 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -5,14 +5,11 @@
#ifdef BOOST_BUILD_PCH_ENABLED
-#define ONE <boost/math/special_functions.hpp>
-#define TWO <boost/math/distributions.hpp>
-
#define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
#include <boost/test/test_exec_monitor.hpp>
#include <boost/test/floating_point_comparison.hpp>
-#include ONE
-#include TWO
+#include <boost/math/special_functions.hpp>
+#include <boost/math/distributions.hpp>
#include <boost/math/tools/test.hpp>
#include <boost/math/tools/stats.hpp>
#include <boost/type_traits.hpp>
Modified: trunk/libs/math/test/test_bessel_j.cpp
==============================================================================
--- trunk/libs/math/test/test_bessel_j.cpp (original)
+++ trunk/libs/math/test/test_bessel_j.cpp 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -271,6 +271,16 @@
".*", // test data group
".*", 40, 20); // test function
//
+ // One set of float tests has inexact input values, so there is a slight error:
+ //
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ ".*", // platform
+ "float", // test type(s)
+ "Bessel J: Mathworld Data", // test data group
+ ".*", 20, 20); // test function
+ //
// Finish off by printing out the compiler/stdlib/platform names,
// we do this to make it easier to mark up expected error rates.
//
Modified: trunk/libs/math/test/test_bessel_j.hpp
==============================================================================
--- trunk/libs/math/test/test_bessel_j.hpp (original)
+++ trunk/libs/math/test/test_bessel_j.hpp 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -8,6 +8,7 @@
#include <boost/test/test_exec_monitor.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
+#include <boost/math/constants/constants.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/array.hpp>
#include "functor.hpp"
@@ -215,7 +216,7 @@
do_test_cyl_bessel_j_int<T>(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases) (Integer Version)");
do_test_cyl_bessel_j_int<T>(jn_data, name, "Bessel JN: Mathworld Data (Integer Version)");
- static const boost::array<boost::array<T, 3>, 18> jv_data = {{
+ static const boost::array<boost::array<T, 3>, 20> jv_data = {{
//SC_(-2.4), {{ SC_(0), std::numeric_limits<T>::infinity() }},
{{ T(2457)/1024, T(1)/1024, SC_(3.80739920118603335646474073457326714709615200130620574875292e-9) }},
{{ SC_(5.5), T(3217)/1024, SC_(0.0281933076257506091621579544064767140470089107926550720453038) }},
@@ -236,6 +237,8 @@
{{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547613660316806551338637153942604550779513947674222863858713) }},
// Bug report https://svn.boost.org/trac/boost/ticket/4812:
{{ SC_(1.5), T(8034)/1024, SC_(0.0339477646369710610146236955872928005087352629422508823945264) }},
+ {{ SC_(8.5), boost::math::constants::pi<T>() * 4, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
+ {{ SC_(-8.5), boost::math::constants::pi<T>() * 4, SC_(-0.257086543428224355151772807588810984369026142375675714560864) }},
}};
do_test_cyl_bessel_j<T>(jv_data, name, "Bessel J: Mathworld Data");
static const boost::array<boost::array<T, 3>, 4> jv_large_data = {{
@@ -246,7 +249,7 @@
{{ SC_(-2.5), SC_(4), SC_(-0.0145679476685218007666785535204236327832335803441449596297004) }},
}};
if(jv_large_data[0][1] != 0)
- do_test_cyl_bessel_j<T>(jv_data, name, "Bessel J: Mathworld Data (large values)");
+ do_test_cyl_bessel_j<T>(jv_large_data, name, "Bessel J: Mathworld Data (large values)");
#include "bessel_j_int_data.ipp"
do_test_cyl_bessel_j<T>(bessel_j_int_data, name, "Bessel JN: Random Data");
Modified: trunk/libs/math/test/test_bessel_y.cpp
==============================================================================
--- trunk/libs/math/test/test_bessel_y.cpp (original)
+++ trunk/libs/math/test/test_bessel_y.cpp 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -229,6 +229,16 @@
".*", // test data group
".*", 80, 40); // test function
//
+ // One set of float tests has inexact input values, so there is a slight error:
+ //
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ ".*", // platform
+ "float", // test type(s)
+ "Yv: Mathworld Data", // test data group
+ ".*", 20, 20); // test function
+ //
// Finish off by printing out the compiler/stdlib/platform names,
// we do this to make it easier to mark up expected error rates.
//
Modified: trunk/libs/math/test/test_bessel_y.hpp
==============================================================================
--- trunk/libs/math/test/test_bessel_y.hpp (original)
+++ trunk/libs/math/test/test_bessel_y.hpp 2012-03-24 07:59:21 EDT (Sat, 24 Mar 2012)
@@ -8,6 +8,7 @@
#include <boost/test/test_exec_monitor.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
+#include <boost/math/constants/constants.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/array.hpp>
#include "functor.hpp"
@@ -176,7 +177,7 @@
{{ SC_(-1e+03), SC_(7e+02), SC_(-1.88753109980945889960843803284345261796244752396992106755091e77) }},
{{ SC_(-25), SC_(8), SC_(3.45113613777297661997458045843868931827873456761831907587263e8) }}
}};
- static const boost::array<boost::array<T, 3>, 9> yv_data = {{
+ static const boost::array<boost::array<T, 3>, 11> yv_data = {{
//SC_(2.25), {{ SC_(1) / 1024, SC_(-1.01759203636941035147948317764932151601257765988969544340275e7) }},
{{ SC_(0.5), T(1) / (1024*1024), SC_(-817.033790261762580469303126467917092806755460418223776544122) }},
{{ SC_(5.5), SC_(3.125), SC_(-2.61489440328417468776474188539366752698192046890955453259866) }},
@@ -187,6 +188,8 @@
{{ SC_(141.75), SC_(1e+02), SC_(-5.38829231428696507293191118661269920130838607482708483122068e9) }},
{{ SC_(141.75), SC_(2e+04), SC_(-0.00376577888677186194728129112270988602876597726657372330194186) }},
{{ SC_(-141.75), SC_(1e+02), SC_(-3.81009803444766877495905954105669819951653361036342457919021e9) }},
+ {{ SC_(8.5), boost::math::constants::pi<T>() * 4, SC_(0.257086543428224355151772807588810984369026142375675714560864) }},
+ {{ SC_(-8.5), boost::math::constants::pi<T>() * 4, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
}};
static const boost::array<boost::array<T, 3>, 7> yv_large_data = {{
// Bug report https://svn.boost.org/trac/boost/ticket/5560:
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk