[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Binomial Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="f_eg.html" title="F Distribution Examples">
<link rel="next" href="binom_eg/binomial_coinflip_example.html" title="Binomial Coin-Flipping Example">
@@ -44,11 +44,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calculating Confidence Limits on the Frequency of Occurrence for a Binomial Distribution</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../binom_eg.html" title="Binomial Distribution Examples">
<link rel="prev" href="binomial_quiz_example.html" title="Binomial Quiz Example">
<link rel="next" href="binom_size_eg.html" title="Estimating Sample Sizes for a Binomial Distribution.">
@@ -99,24 +99,24 @@
</p>
<p>
Please note that calculating two separate <span class="emphasis"><em>single sided bounds</em></span>,
each with risk level &#945; &#160;is not the same thing as calculating a two sided
each with risk level α is not the same thing as calculating a two sided
interval. Had we calculate two single-sided intervals each with a risk
that the true value is outside the interval of &#945;, then:
that the true value is outside the interval of α, then:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
The risk that it is less than the lower bound is &#945;.
The risk that it is less than the lower bound is α.
</li></ul></div>
<p>
and
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
The risk that it is greater than the upper bound is also &#945;.
The risk that it is greater than the upper bound is also α.
</li></ul></div>
<p>
So the risk it is outside <span class="bold"><strong>upper or lower bound</strong></span>,
is <span class="bold"><strong>twice</strong></span> alpha, and the probability
that it is inside the bounds is therefore not nearly as high as one might
have thought. This is why &#945;/2 must be used in the calculations below.
have thought. This is why α/2 must be used in the calculations below.
</p>
<p>
In contrast, had we been calculating a single-sided interval, for example:
@@ -224,11 +224,11 @@ _______________________________________________________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Estimating Sample Sizes for a Binomial Distribution.</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../binom_eg.html" title="Binomial Distribution Examples">
<link rel="prev" href="binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for a Binomial Distribution">
<link rel="next" href="../geometric_eg.html" title="Geometric Distribution Examples">
@@ -143,11 +143,11 @@ ____________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Binomial Coin-Flipping Example</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../binom_eg.html" title="Binomial Distribution Examples">
<link rel="prev" href="../binom_eg.html" title="Binomial Distribution Examples">
<link rel="next" href="binomial_quiz_example.html" title="Binomial Quiz Example">
@@ -171,8 +171,8 @@
<span class="special">}</span> <span class="comment">// for i</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Tabulate the probability of getting between zero heads and 0 upto 10 heads.</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting upto (&lt;=) heads"</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="comment">// Tabulate the probability of getting between zero heads and 0 up to 10 heads.</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Probability of getting up to (&lt;=) heads"</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">successes</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">successes</span> <span class="special">&lt;=</span> <span class="identifier">flips</span><span class="special">;</span> <span class="identifier">successes</span><span class="special">++)</span>
<span class="special">{</span> <span class="comment">// Say success means getting a head</span>
<span class="comment">// (equally success could mean getting a tail).</span>
@@ -185,7 +185,13 @@
<p>
The last (0 to 10 heads) must, of course, be 100% probability.
</p>
<pre class="programlisting"><span class="special">}</span>
<pre class="programlisting"> <span class="keyword">double</span> <span class="identifier">probability</span> <span class="special">=</span> <span class="number">0.3</span><span class="special">;</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">flip</span><span class="special">,</span> <span class="identifier">probability</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile (flip, "</span> <span class="special">&lt;&lt;</span> <span class="identifier">probability</span> <span class="special">&lt;&lt;</span> <span class="string">") = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">q</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Quantile (flip, 0.3) = 3</span>
<span class="identifier">probability</span> <span class="special">=</span> <span class="number">0.6</span><span class="special">;</span>
<span class="identifier">q</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">flip</span><span class="special">,</span> <span class="identifier">probability</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Quantile (flip, "</span> <span class="special">&lt;&lt;</span> <span class="identifier">probability</span> <span class="special">&lt;&lt;</span> <span class="string">") = "</span> <span class="special">&lt;&lt;</span> <span class="identifier">q</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// Quantile (flip, 0.6) = 5</span>
<span class="special">}</span>
<span class="keyword">catch</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">exception</span><span class="special">&amp;</span> <span class="identifier">e</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">//</span>
@@ -241,7 +247,7 @@ Probability of getting exactly (==) heads
9 0.009766 or 1 in 102.4, or 0.9766%
10 0.0009766 or 1 in 1024, or 0.09766%
Probability of getting upto (&lt;=) heads
Probability of getting up to (&lt;=) heads
0 0.0009766 or 1 in 1024, or 0.09766%
1 0.01074 or 1 in 93.09, or 1.074%
2 0.05469 or 1 in 18.29, or 5.469%
@@ -257,11 +263,11 @@ Probability of getting upto (&lt;=) heads
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Binomial Quiz Example</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../binom_eg.html" title="Binomial Distribution Examples">
<link rel="prev" href="binomial_coinflip_example.html" title="Binomial Coin-Flipping Example">
<link rel="next" href="binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for a Binomial Distribution">
@@ -441,11 +441,11 @@ If guessing then percentiles 1 to 99% will get 0 to 7.788 right.
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using the Distributions from Within C#</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="nag_library.html" title="Comparison with C, R, FORTRAN-style Free Functions">
<link rel="next" href="../variates.html" title="Random Variates and Distribution Parameters">
@@ -41,11 +41,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chi Squared Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="st_eg/paired_st.html" title="Comparing two paired samples with the Student's t distribution">
<link rel="next" href="cs_eg/chi_sq_intervals.html" title="Confidence Intervals on the Standard Deviation">
@@ -38,11 +38,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Confidence Intervals on the Standard Deviation</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../cs_eg.html" title="Chi Squared Distribution Examples">
<link rel="prev" href="../cs_eg.html" title="Chi Squared Distribution Examples">
<link rel="next" href="chi_sq_test.html" title="Chi-Square Test for the Standard Deviation">
@@ -72,12 +72,26 @@
For each value of alpha, the formula for the confidence interval is given
by:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/chi_squ_tut1.svg"></span>
</p></blockquote></div>
<p>
<span class="inlinemediaobject"><img src="../../../../../equations/chi_squ_tut1.svg"></span>
Where
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/chi_squ_tut2.svg"></span>
</p></blockquote></div>
<p>
Where <span class="inlinemediaobject"><img src="../../../../../equations/chi_squ_tut2.svg"></span> is the upper critical value, and <span class="inlinemediaobject"><img src="../../../../../equations/chi_squ_tut3.svg"></span> is
the lower critical value of the Chi Squared distribution.
is the upper critical value, and
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/chi_squ_tut3.svg"></span>
</p></blockquote></div>
<p>
is the lower critical value of the Chi Squared distribution.
</p>
<p>
In code we begin by printing out a table header:
@@ -219,11 +233,11 @@ ________________________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Estimating the Required Sample Sizes for a Chi-Square Test for the Standard Deviation</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../cs_eg.html" title="Chi Squared Distribution Examples">
<link rel="prev" href="chi_sq_test.html" title="Chi-Square Test for the Standard Deviation">
<link rel="next" href="../f_eg.html" title="F Distribution Examples">
@@ -165,11 +165,11 @@ _______________________________________________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chi-Square Test for the Standard Deviation</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../cs_eg.html" title="Chi Squared Distribution Examples">
<link rel="prev" href="chi_sq_intervals.html" title="Confidence Intervals on the Standard Deviation">
<link rel="next" href="chi_sq_size.html" title="Estimating the Required Sample Sizes for a Chi-Square Test for the Standard Deviation">
@@ -106,7 +106,7 @@
</td>
<td>
<p>
Reject if T &lt; &#967;<sup>2</sup><sub>(1-alpha/2; N-1)</sub> or T &gt; &#967;<sup>2</sup><sub>(alpha/2; N-1)</sub>
Reject if T &lt; χ<sup>2</sup><sub>(1-alpha/2; N-1)</sub> or T &gt; χ<sup>2</sup><sub>(alpha/2; N-1)</sub>
</p>
</td>
</tr>
@@ -119,7 +119,7 @@
</td>
<td>
<p>
Reject if &#967;<sup>2</sup><sub>(1-alpha/2; N-1)</sub> &gt;= T &gt;= &#967;<sup>2</sup><sub>(alpha/2; N-1)</sub>
Reject if χ<sup>2</sup><sub>(1-alpha/2; N-1)</sub> &gt;= T &gt;= χ<sup>2</sup><sub>(alpha/2; N-1)</sub>
</p>
</td>
</tr>
@@ -132,7 +132,7 @@
</td>
<td>
<p>
Reject if &#967;<sup>2</sup><sub>(1-alpha; N-1)</sub> &lt;= T
Reject if χ<sup>2</sup><sub>(1-alpha; N-1)</sub> &lt;= T
</p>
</td>
</tr>
@@ -145,15 +145,15 @@
</td>
<td>
<p>
Reject if &#967;<sup>2</sup><sub>(alpha; N-1)</sub> &gt;= T
Reject if χ<sup>2</sup><sub>(alpha; N-1)</sub> &gt;= T
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
Where &#967;<sup>2</sup><sub>(alpha; N-1)</sub> is the upper critical value of the Chi Squared distribution,
and &#967;<sup>2</sup><sub>(1-alpha; N-1)</sub> is the lower critical value.
Where χ<sup>2</sup><sub>(alpha; N-1)</sub> is the upper critical value of the Chi Squared distribution,
and χ<sup>2</sup><sub>(1-alpha; N-1)</sub> is the lower critical value.
</p>
<p>
Recall that the lower critical value is the same as the quantile, and
@@ -280,11 +280,11 @@ Standard Deviation &gt; 10.000 ACCEPTED
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Distribution Construction Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="../weg.html" title="Worked Examples">
<link rel="next" href="st_eg.html" title="Student's t Distribution Examples">
@@ -30,12 +30,12 @@
<p>
The structure of distributions is rather different from some other statistical
libraries, for example, those written in less object-oriented language
like FORTRAN and C: these provide a few arguments to each free function.
like FORTRAN and C that provide a few arguments to each free function.
</p>
<p>
Boost.Math library provides each distribution as a template C++ class.
A distribution is constructed with a few arguments, and then member and
non-member functions are used to find values of the distribution, often
Boost.Math library instead provides each distribution as a template C++
class. A distribution is constructed with a few arguments, and then member
and non-member functions are used to find values of the distribution, often
a function of a random variate.
</p>
<p>
@@ -44,8 +44,17 @@
</p>
<p>
To demonstrate the use with a high precision User-defined floating-point
type <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code> we also
need an include from Boost.Multiprecision.
type <code class="computeroutput"><span class="identifier">cpp_bin_float</span></code>, we
also need an include from Boost.Multiprecision. (We could equally well
have used a <code class="computeroutput"><span class="identifier">cpp_dec_float</span></code>
multiprecision type).
</p>
<p>
We choose a typedef <code class="computeroutput"><span class="identifier">cpp_bin_float_50</span></code>
to provide a 50 decimal digit type, but we could equally have chosen at
128-bit type <code class="computeroutput"><span class="identifier">cpp_bin_float_quad</span></code>,
or on some platforms <code class="computeroutput"><span class="identifier">__float128</span></code>,
providing about 35 decimal digits.
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">negative_binomial</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for negative_binomial_distribution</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">negative_binomial_distribution</span><span class="special">;</span> <span class="comment">// default type is double.</span>
@@ -55,7 +64,7 @@
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">gamma</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for gamma_distribution.</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">normal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for normal_distribution.</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">multiprecision</span><span class="special">/</span><span class="identifier">cpp_dec_float</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for cpp_dec_float_100</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">multiprecision</span><span class="special">/</span><span class="identifier">cpp_bin_float</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span> <span class="comment">// for cpp_bin_float_50</span>
</pre>
<p>
Several examples of constructing distributions follow:
@@ -104,7 +113,7 @@
</tr>
<tr><td align="left" valign="top"><p>
This convenience typedef is <span class="bold"><strong>not provided</strong></span>
if a clash would occur with the name of a function: currently only <code class="computeroutput"><span class="identifier">beta</span></code> and <code class="computeroutput"><span class="identifier">gamma</span></code>
if a clash would occur with the name of a function; currently only <code class="computeroutput"><span class="identifier">beta</span></code> and <code class="computeroutput"><span class="identifier">gamma</span></code>
fall into this category.
</p></td></tr>
</table></div>
@@ -124,12 +133,14 @@
<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>
And automatic conversion takes place, so you can use integers and floats:
And automatic conversion of arguments takes place, so you can use integers
and floats:
</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 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 of type double, and int and double arguments.</span>
</pre>
<p>
This is probably the most common usage.
This is probably the most common usage. Other combination are possible
too:
</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>
@@ -143,7 +154,7 @@
<p>
For cases when the typdef distribution name would clash with a math special
function (currently only beta and gamma) the typedef is deliberately not
provided, and the longer version of the name must be used. For example
provided, and the longer version of the name must be used, so for example,
do not use:
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">beta</span><span class="special">;</span>
@@ -186,33 +197,37 @@ error C3861: 'mybetad0': identifier not found
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="identifier">mydist5</span><span class="special">(</span><span class="number">8</span><span class="special">,</span> <span class="number">1</span><span class="special">);</span>
<span class="comment">// Explicit double precision:</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">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="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">mydist6</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">// Explicit long double precision:</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">mydist7</span><span class="special">(</span><span class="number">8.</span><span class="special">,</span> <span class="number">0.25</span><span class="special">);</span>
</pre>
<p>
And you can use your own RealType, for example, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">cpp_dec_float_50</span></code>
(an arbitrary 50 decimal digits precision type), then we can write:
And you can use your own template RealType, for example, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">cpp_bin_float_50</span></code> (an arbitrary 50 decimal
digits precision type), then we can write:
</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">multiprecision</span><span class="special">;</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">cpp_bin_float_50</span><span class="special">&gt;</span> <span class="identifier">mydist8</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="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">cpp_dec_float_50</span><span class="special">&gt;</span> <span class="identifier">mydist8</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">// `integer` arguments are promoted to your RealType exactly, but</span>
<span class="comment">// `double` argument are converted to RealType,</span>
<span class="comment">// possibly losing precision, so don't write:</span>
<span class="comment">// most likely losing precision!</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">cpp_dec_float_50</span><span class="special">&gt;</span> <span class="identifier">mydist20</span><span class="special">(</span><span class="number">8</span><span class="special">,</span> <span class="number">0.23456789012345678901234567890</span><span class="special">);</span>
<span class="comment">// to avoid truncation of second parameter to `0.2345678901234567`.</span>
<span class="comment">// So DON'T be tempted to write the 'obvious':</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">cpp_bin_float_50</span><span class="special">&gt;</span> <span class="identifier">mydist20</span><span class="special">(</span><span class="number">8</span><span class="special">,</span> <span class="number">0.23456789012345678901234567890</span><span class="special">);</span>
<span class="comment">// to avoid truncation of second parameter to `0.2345678901234567` and loss of precision.</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">cpp_dec_float_50</span><span class="special">&gt;</span> <span class="identifier">mydist21</span><span class="special">(</span><span class="number">8</span><span class="special">,</span> <span class="identifier">cpp_dec_float_50</span><span class="special">(</span><span class="string">"0.23456789012345678901234567890"</span><span class="special">)</span> <span class="special">);</span>
<span class="comment">// Instead pass a quoted decimal digit string:</span>
<span class="identifier">negative_binomial_distribution</span><span class="special">&lt;</span><span class="identifier">cpp_bin_float_50</span><span class="special">&gt;</span> <span class="identifier">mydist21</span><span class="special">(</span><span class="number">8</span><span class="special">,</span> <span class="identifier">cpp_bin_float_50</span><span class="special">(</span><span class="string">"0.23456789012345678901234567890"</span><span class="special">)</span> <span class="special">);</span>
<span class="comment">// Ensure that all potentially significant digits are shown.</span>
<span class="identifier">std</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">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">&lt;</span><span class="identifier">cpp_dec_float_50</span><span class="special">&gt;::</span><span class="identifier">digits10</span><span class="special">);</span>
<span class="identifier">cpp_dec_float_50</span> <span class="identifier">x</span><span class="special">(</span><span class="string">"1.23456789012345678901234567890"</span><span class="special">);</span>
<span class="identifier">std</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">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">&lt;</span><span class="identifier">cpp_bin_float_50</span><span class="special">&gt;::</span><span class="identifier">digits10</span><span class="special">);</span>
<span class="comment">// </span>
<span class="identifier">cpp_bin_float_50</span> <span class="identifier">x</span><span class="special">(</span><span class="string">"1.23456789012345678901234567890"</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">mydist8</span><span class="special">,</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
</pre>
<pre class="programlisting"><span class="identifier">showing</span> <span class="number">0.00012630010495970320103876754721976419438231705359935</span>
<span class="number">0.00012630010495970320103876754721976419438231528547467</span>
</pre>
<div class="warning"><table border="0" summary="Warning">
<tr>
@@ -241,17 +256,17 @@ error C3861: 'mybetad0': identifier not found
Then the now <code class="computeroutput"><span class="keyword">double</span> <span class="identifier">x</span></code>
is passed to function <code class="computeroutput"><span class="identifier">pdf</span></code>,
and this truncated <code class="computeroutput"><span class="keyword">double</span></code>
value is finally promoted to <code class="computeroutput"><span class="identifier">cpp_dec_float_50</span></code>.
value is finally promoted to <code class="computeroutput"><span class="identifier">cpp_bin_float_50</span></code>.
</p>
<p>
Another way of quietly getting the wrong answer is to write:
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">mydist8</span><span class="special">,</span> <span class="identifier">cpp_dec_float_50</span><span class="special">(</span><span class="number">1.23456789012345678901234567890</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">mydist8</span><span class="special">,</span> <span class="identifier">cpp_bin_float_50</span><span class="special">(</span><span class="number">1.23456789012345678901234567890</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
</pre>
<p>
A correct way from a multi-digit string value is
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">mydist8</span><span class="special">,</span> <span class="identifier">cpp_dec_float_50</span><span class="special">(</span><span class="string">"1.23456789012345678901234567890"</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">pdf</span><span class="special">(</span><span class="identifier">mydist8</span><span class="special">,</span> <span class="identifier">cpp_bin_float_50</span><span class="special">(</span><span class="string">"1.23456789012345678901234567890"</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
</pre>
<div class="tip"><table border="0" summary="Tip">
<tr>
@@ -289,11 +304,11 @@ error C3861: 'mybetad0': identifier not found
<pre class="programlisting"><span class="identifier">normal_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">mean</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">sd</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
</pre>
<p>
So in this case we can write:
So in this case we can more tersely write:
</p>
<pre class="programlisting"> <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">normal</span><span class="special">;</span>
<span class="identifier">normal</span> <span class="identifier">norm1</span><span class="special">;</span> <span class="comment">// Standard normal distribution.</span>
<span class="identifier">normal</span> <span class="identifier">norm1</span><span class="special">;</span> <span class="comment">// Standard normal distribution N[0,1].</span>
<span class="identifier">normal</span> <span class="identifier">norm2</span><span class="special">(</span><span class="number">2</span><span class="special">);</span> <span class="comment">// Mean = 2, std deviation = 1.</span>
<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>
@@ -316,11 +331,11 @@ error C3861: 'mybetad0': identifier not found
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Error Handling Example</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="nccs_eg/nccs_power_eg.html" title="Tables of the power function of the chi2 test.">
<link rel="next" href="find_eg.html" title="Find Location and Scale Examples">
@@ -31,7 +31,7 @@
See <a class="link" href="../../error_handling.html" title="Error Handling">error handling documentation</a>
for a detailed explanation of the mechanism of handling errors, including
the common "bad" arguments to distributions and functions, and
how to use <a class="link" href="../../../policy.html" title="Chapter&#160;18.&#160;Policies: Controlling Precision, Error Handling etc">Policies</a> to control it.
how to use <a class="link" href="../../../policy.html" title="Chapter 21. Policies: Controlling Precision, Error Handling etc">Policies</a> to control it.
</p>
<p>
But, by default, <span class="bold"><strong>exceptions will be raised</strong></span>,
@@ -189,11 +189,11 @@ errno is set to: 33
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>F Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="cs_eg/chi_sq_size.html" title="Estimating the Required Sample Sizes for a Chi-Square Test for the Standard Deviation">
<link rel="next" href="binom_eg.html" title="Binomial Distribution Examples">
@@ -79,9 +79,9 @@
The test statistic for an F-test is simply the ratio of the square of the
two standard deviations:
</p>
<p>
F = s<sub>1</sub><sup>2</sup> / s<sub>2</sub><sup>2</sup>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">F = s<sub>1</sub><sup>2</sup> / s<sub>2</sub><sup>2</sup></span>
</p></blockquote></div>
<p>
where s<sub>1</sub> is the standard deviation of the first sample and s<sub>2</sub>
is the standard
@@ -179,14 +179,14 @@ is the standard
The upper and lower critical values can be computed using the quantile
function:
</p>
<p>
F<sub>(1-alpha; N1-1, N2-1)</sub> = <code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">fisher_f</span><span class="special">(</span><span class="identifier">N1</span><span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="identifier">N2</span><span class="special">-</span><span class="number">1</span><span class="special">),</span>
<span class="identifier">alpha</span><span class="special">)</span></code>
</p>
<p>
F<sub>(alpha; N1-1, N2-1)</sub> = <code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">fisher_f</span><span class="special">(</span><span class="identifier">N1</span><span class="special">-</span><span class="number">1</span><span class="special">,</span> <span class="identifier">N2</span><span class="special">-</span><span class="number">1</span><span class="special">),</span>
<span class="identifier">alpha</span><span class="special">))</span></code>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">F<sub>(1-alpha; N1-1, N2-1)</sub> = <code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">fisher_f</span><span class="special">(</span><span class="identifier">N1</span><span class="special">-</span><span class="number">1</span><span class="special">,</span>
<span class="identifier">N2</span><span class="special">-</span><span class="number">1</span><span class="special">),</span> <span class="identifier">alpha</span><span class="special">)</span></code></span>
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">F<sub>(alpha; N1-1, N2-1)</sub> = <code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">fisher_f</span><span class="special">(</span><span class="identifier">N1</span><span class="special">-</span><span class="number">1</span><span class="special">,</span>
<span class="identifier">N2</span><span class="special">-</span><span class="number">1</span><span class="special">),</span> <span class="identifier">alpha</span><span class="special">))</span></code></span>
</p></blockquote></div>
<p>
In our example program we need both upper and lower critical values for
alpha and for alpha/2:
@@ -312,11 +312,11 @@ Standard deviation 1 is greater than standard deviation 2 ACCEPTED
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Find Location and Scale Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="error_eg.html" title="Error Handling Example">
<link rel="next" href="find_eg/find_location_eg.html" title="Find Location (Mean) Example">
@@ -38,11 +38,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Find Location (Mean) Example</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../find_eg.html" title="Find Location and Scale Examples">
<link rel="prev" href="../find_eg.html" title="Find Location and Scale Examples">
<link rel="next" href="find_scale_eg.html" title="Find Scale (Standard Deviation) Example">
@@ -38,7 +38,7 @@
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">find_location</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">find_location</span><span class="special">;</span> <span class="comment">// for mean</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">/</span><span class="identifier">find_scale</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">find_scale</span><span class="special">;</span> <span class="comment">// for standard devation</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_scale</span><span class="special">;</span> <span class="comment">// for standard deviation</span>
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">complement</span><span class="special">;</span> <span class="comment">// Needed if you want to use the complement version.</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">policy</span><span class="special">;</span>
@@ -173,11 +173,11 @@ Normal distribution with mean = 0.355146 has fraction &gt; 2 = 0.05
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Find mean and standard deviation example</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../find_eg.html" title="Find Location and Scale Examples">
<link rel="prev" href="find_scale_eg.html" title="Find Scale (Standard Deviation) Example">
<link rel="next" href="../nag_library.html" title="Comparison with C, R, FORTRAN-style Free Functions">
@@ -438,11 +438,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Find Scale (Standard Deviation) Example</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../find_eg.html" title="Find Location and Scale Examples">
<link rel="prev" href="find_location_eg.html" title="Find Location (Mean) Example">
<link rel="next" href="find_mean_and_sd_eg.html" title="Find mean and standard deviation example">
@@ -192,11 +192,11 @@ Normal distribution with mean = 0.946339 has fraction &gt; -2 = 0.999
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Geometric Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="binom_eg/binom_size_eg.html" title="Estimating Sample Sizes for a Binomial Distribution.">
<link rel="next" href="neg_binom_eg.html" title="Negative Binomial Distribution Examples">
@@ -104,11 +104,11 @@
</pre>
<p>
If the dice is thrown repeatedly until the <span class="bold"><strong>first</strong></span>
time a <span class="emphasis"><em>three</em></span> appears. The probablility distribution
time a <span class="emphasis"><em>three</em></span> appears. The probability distribution
of the number of times it is thrown <span class="bold"><strong>not</strong></span>
getting a <span class="emphasis"><em>three</em></span> (<span class="emphasis"><em>not-a-threes</em></span>
number of failures to get a <span class="emphasis"><em>three</em></span>) is a geometric
distribution with the success_fraction = 1/6 = 0.1666&#8202;&#775;.
distribution with the success_fraction = 1/6 = 0.1666 ̇.
</p>
<p>
We therefore start by constructing a geometric distribution with the one
@@ -169,7 +169,7 @@
discrete quantiles</a>.
</p>
<p>
The geometric distribution is related to the negative binomial &#8192;&#8192; <code class="computeroutput"><span class="identifier">negative_binomial_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">RealType</span>
The geometric distribution is related to the negative binomial    <code class="computeroutput"><span class="identifier">negative_binomial_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">RealType</span>
<span class="identifier">p</span><span class="special">);</span></code>
with parameter <span class="emphasis"><em>r</em></span> = 1. So we could get the same result
using the negative binomial, but using the geometric the results will be
@@ -194,7 +194,7 @@
to the nearest integer. For example, R returns the success fraction probability
for all values of failures from 0 to 0.999999 thus:
</p>
<pre class="programlisting">&#8192;&#8192; R&gt; formatC(pgeom(0.0001,0.5, FALSE), digits=17) " 0.5"
<pre class="programlisting">   R&gt; formatC(pgeom(0.0001,0.5, FALSE), digits=17) " 0.5"
</pre>
<p>
So in Boost.Math the equivalent is
@@ -371,7 +371,7 @@
</pre>
<p>
In real life, there will usually be more than one event (fault or success),
when the negative binomial, which has the neccessary extra parameter, will
when the negative binomial, which has the necessary extra parameter, will
be needed.
</p>
<p>
@@ -405,11 +405,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Inverse Chi-Squared Distribution Bayes Example</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="normal_example/normal_misc.html" title="Some Miscellaneous Examples of the Normal (Gaussian) Distribution">
<link rel="next" href="nccs_eg.html" title="Non Central Chi Squared Example">
@@ -29,8 +29,8 @@
</h4></div></div></div>
<p>
The scaled-inversed-chi-squared distribution is the conjugate prior distribution
for the variance (&#963;<sup>2</sup>) parameter of a normal distribution with known expectation
(&#956;). As such it has widespread application in Bayesian statistics:
for the variance (σ<sup>2</sup>) parameter of a normal distribution with known expectation
(μ). As such it has widespread application in Bayesian statistics:
</p>
<p>
In <a href="http://en.wikipedia.org/wiki/Bayesian_inference" target="_top">Bayesian
@@ -52,7 +52,7 @@
Data Analysis, 2003, ISBN 978-1439840955.
</li>
<li class="listitem">
Jim Albert, Bayesian Compution with R, Springer, 2009, ISBN 978-0387922973.
Jim Albert, Bayesian Computation with R, Springer, 2009, ISBN 978-0387922973.
</li>
</ul></div>
<p>
@@ -62,17 +62,17 @@
</p>
<p>
Consider precision machines which produce balls for a high-quality ball
bearing. Ideally each ball should have a diameter of precisely 3000 &#956;m (3
bearing. Ideally each ball should have a diameter of precisely 3000 μm (3
mm). Assume that machines generally produce balls of that size on average
(mean), but individual balls can vary slightly in either direction following
(approximately) a normal distribution. Depending on various production
conditions (e.g. raw material used for balls, workplace temperature and
humidity, maintenance frequency and quality) some machines produce balls
tighter distributed around the target of 3000 &#956;m, while others produce balls
tighter distributed around the target of 3000 μm, while others produce balls
with a wider distribution. Therefore the variance parameter of the normal
distribution of the ball sizes varies from machine to machine. An extensive
survey by the precision machinery manufacturer, however, has shown that
most machines operate with a variance between 15 and 50, and near 25 &#956;m<sup>2</sup> on
most machines operate with a variance between 15 and 50, and near 25 μm<sup>2</sup> on
average.
</p>
<p>
@@ -80,7 +80,7 @@
The variance is strictly positive, and therefore we look for a statistical
distribution with support in the positive domain of the real numbers. Given
the expectation of the normal distribution of the balls is known (3000
&#956;m), for reasons of conjugacy, it is customary practice in Bayesian statistics
μm), for reasons of conjugacy, it is customary practice in Bayesian statistics
to model the variance to be scaled-inverse-chi-squared distributed.
</p>
<p>
@@ -106,11 +106,11 @@
Using the mathematical properties of the scaled-inverse-chi-squared distribution
as guideline, we see that that both the mean and mode of the scaled-inverse-chi-squared
distribution are approximately given by the scale parameter (s) of the
distribution. As the survey machines operated at a variance of 25 &#956;m<sup>2</sup> on
distribution. As the survey machines operated at a variance of 25 μm<sup>2</sup> on
average, we hence set the scale parameter (s<sub>prior</sub>) of our prior distribution
equal to this value. Using some trial-and-error and calls to the global
quantile function, we also find that a value of 20 for the degrees-of-freedom
(&#957;<sub>prior</sub>) parameter is adequate so that most of the prior distribution mass
(ν<sub>prior</sub>) parameter is adequate so that most of the prior distribution mass
is located between 15 and 50 (see figure below).
</p>
<p>
@@ -199,13 +199,13 @@
posterior distribution parameters are given by the two expressions:
</p>
<p>
&#8192;&#8192; &#957;<sub>posterior</sub> = &#957;<sub>prior</sub> + n
   ν<sub>posterior</sub> = ν<sub>prior</sub> + n
</p>
<p>
which gives the posteriorDF below, and
</p>
<p>
&#8192;&#8192; s<sub>posterior</sub> = (&#957;<sub>prior</sub>s<sub>prior</sub> + &#931;<sup>n</sup><sub>i=1</sub>(x<sub>i</sub> - &#956;)<sup>2</sup>) / (&#957;<sub>prior</sub> + n)
   s<sub>posterior</sub> = (ν<sub>prior</sub>s<sub>prior</sub> + Σ<sup>n</sup><sub>i=1</sub>(x<sub>i</sub> - μ)<sup>2</sup>) / (ν<sub>prior</sub> + n)
</p>
<p>
which after some rearrangement gives the formula for the posteriorScale
@@ -213,12 +213,12 @@
</p>
<p>
Machine-specific data consist of 100 balls which were accurately measured
and show the expected mean of 3000 &#956;m and a sample variance of 55 (calculated
and show the expected mean of 3000 μm and a sample variance of 55 (calculated
for a sample mean defined to be 3000 exactly). From these data, the prior
parameterization, and noting that the term &#931;<sup>n</sup><sub>i=1</sub>(x<sub>i</sub> - &#956;)<sup>2</sup> equals the sample
parameterization, and noting that the term Σ<sup>n</sup><sub>i=1</sub>(x<sub>i</sub> - μ)<sup>2</sup> equals the sample
variance multiplied by n - 1, it follows that the posterior distribution
of the variance parameter is scaled-inverse-chi-squared distribution with
degrees-of-freedom (&#957;<sub>posterior</sub>) = 120 and scale (s<sub>posterior</sub>) = 49.54.
degrees-of-freedom (ν<sub>posterior</sub>) = 120 and scale (s<sub>posterior</sub>) = 49.54.
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">ballsSampleSize</span> <span class="special">=</span> <span class="number">100</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span><span class="string">"balls sample size: "</span> <span class="special">&lt;&lt;</span> <span class="identifier">ballsSampleSize</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@@ -256,9 +256,10 @@
we calculate again the same quantiles and probabilities as above, and find
a distribution clearly shifted to greater values (see figure).
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../graphs/prior_posterior_plot.svg" align="middle"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../graphs/prior_posterior_plot.svg" align="middle"></span>
</p></blockquote></div>
<pre class="programlisting"><span class="identifier">inverse_chi_squared</span> <span class="identifier">posterior</span><span class="special">(</span><span class="identifier">posteriorDF</span><span class="special">,</span> <span class="identifier">posteriorScale</span><span class="special">);</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Posterior distribution:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
@@ -343,11 +344,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Comparison with C, R, FORTRAN-style Free Functions</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="find_eg/find_mean_and_sd_eg.html" title="Find mean and standard deviation example">
<link rel="next" href="c_sharp.html" title="Using the Distributions from Within C#">
@@ -99,11 +99,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Non Central Chi Squared Example</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="inverse_chi_squared_eg.html" title="Inverse Chi-Squared Distribution Bayes Example">
<link rel="next" href="nccs_eg/nccs_power_eg.html" title="Tables of the power function of the chi2 test.">
@@ -36,11 +36,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tables of the power function of the chi2 test.</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../nccs_eg.html" title="Non Central Chi Squared Example">
<link rel="prev" href="../nccs_eg.html" title="Non Central Chi Squared Example">
<link rel="next" href="../error_eg.html" title="Error Handling Example">
@@ -28,11 +28,11 @@
of the power function of the chi<sup>2</sup> test.</a>
</h5></div></div></div>
<p>
This example computes a table of the power of the &#967;<sup>2</sup>
This example computes a table of the power of the χ<sup>2</sup>
test at the 5% significance
level, for various degrees of freedom and non-centrality parameters.
The table is deliberately the same as Table 6 from "The Non-Central
&#967;<sup>2</sup> and F-Distributions and their applications.", P. B. Patnaik, Biometrika,
χ<sup>2</sup> and F-Distributions and their applications.", P. B. Patnaik, Biometrika,
Vol. 36, No. 1/2 (June 1949), 202-232.
</p>
<p>
@@ -51,7 +51,7 @@ test at the 5% significance
<span class="special">{</span>
</pre>
<p>
Create a table of the power of the &#967;<sup>2</sup> test at 5% significance level, start
Create a table of the power of the χ<sup>2</sup> test at 5% significance level, start
with a table header:
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"[table\n[[[nu]]"</span><span class="special">;</span>
@@ -75,13 +75,13 @@ test at the 5% significance
<span class="special">{</span>
</pre>
<p>
Calculate the &#967;<sup>2</sup> statistic for a 5% significance:
Calculate the χ<sup>2</sup> statistic for a 5% significance:
</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>
<p>
The power of the test is given by the complement of the CDF of the non-central
&#967;<sup>2</sup> distribution:
χ<sup>2</sup> distribution:
</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>
@@ -100,7 +100,7 @@ test at the 5% significance
shown below.
</p>
<p>
We can interpret this as follows - for example if &#957;=10 and &#955;=10 then the
We can interpret this as follows - for example if ν=10 and λ=10 then the
power of the test is 0.542 - so we have only a 54% chance of correctly
detecting that our null hypothesis is false, and a 46% chance of incurring
a type II error (failing to reject the null hypothesis when it is in
@@ -123,57 +123,57 @@ test at the 5% significance
<thead><tr>
<th>
<p>
&#957;
ν
</p>
</th>
<th>
<p>
&#955;=2
λ=2
</p>
</th>
<th>
<p>
&#955;=4
λ=4
</p>
</th>
<th>
<p>
&#955;=6
λ=6
</p>
</th>
<th>
<p>
&#955;=8
λ=8
</p>
</th>
<th>
<p>
&#955;=10
λ=10
</p>
</th>
<th>
<p>
&#955;=12
λ=12
</p>
</th>
<th>
<p>
&#955;=14
λ=14
</p>
</th>
<th>
<p>
&#955;=16
λ=16
</p>
</th>
<th>
<p>
&#955;=18
λ=18
</p>
</th>
<th>
<p>
&#955;=20
λ=20
</p>
</th>
</tr></thead>
@@ -1270,11 +1270,11 @@ test at the 5% significance
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Negative Binomial Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="geometric_eg.html" title="Geometric Distribution Examples">
<link rel="next" href="neg_binom_eg/neg_binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for the Negative Binomial Distribution">
@@ -45,11 +45,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calculating Confidence Limits on the Frequency of Occurrence for the Negative Binomial Distribution</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../neg_binom_eg.html" title="Negative Binomial Distribution Examples">
<link rel="prev" href="../neg_binom_eg.html" title="Negative Binomial Distribution Examples">
<link rel="next" href="neg_binom_size_eg.html" title="Estimating Sample Sizes for the Negative Binomial.">
@@ -204,11 +204,11 @@ ___________________________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Estimating Sample Sizes for the Negative Binomial.</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../neg_binom_eg.html" title="Negative Binomial Distribution Examples">
<link rel="prev" href="neg_binom_conf.html" title="Calculating Confidence Limits on the Frequency of Occurrence for the Negative Binomial Distribution">
<link rel="next" href="negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">
@@ -190,11 +190,11 @@ ____________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Negative Binomial Sales Quota Example.</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../neg_binom_eg.html" title="Negative Binomial Distribution Examples">
<link rel="prev" href="neg_binom_size_eg.html" title="Estimating Sample Sizes for the Negative Binomial.">
<link rel="next" href="negative_binomial_example2.html" title="Negative Binomial Table Printing Example.">
@@ -120,7 +120,7 @@
<p>
Selling five candy bars means getting five successes, so successes r
= 5. The total number of trials (n, in this case, houses visited) this
takes is therefore = sucesses + failures or k + r = k + 5.
takes is therefore = successes + failures or k + r = k + 5.
</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>
@@ -370,7 +370,7 @@ If confidence of meeting quota is 0, then finishing house is 5
<pre class="programlisting"> <span class="keyword">double</span> <span class="identifier">ps</span><span class="special">[]</span> <span class="special">=</span> <span class="special">{</span><span class="number">0.</span><span class="special">,</span> <span class="number">0.001</span><span class="special">,</span> <span class="number">0.01</span><span class="special">,</span> <span class="number">0.05</span><span class="special">,</span> <span class="number">0.1</span><span class="special">,</span> <span class="number">0.5</span><span class="special">,</span> <span class="number">0.9</span><span class="special">,</span> <span class="number">0.95</span><span class="special">,</span> <span class="number">0.99</span><span class="special">,</span> <span class="number">0.999</span><span class="special">,</span> <span class="number">1.</span><span class="special">};</span>
<span class="comment">// Confidence as fraction = 1-alpha, as percent = 100 * (1-alpha[i]) %</span>
<span class="identifier">cout</span><span class="special">.</span><span class="identifier">precision</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">ps</span><span class="special">)/</span><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">ps</span><span class="special">[</span><span class="number">0</span><span class="special">]);</span> <span class="identifier">i</span><span class="special">++)</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">ps</span><span class="special">)/</span><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">ps</span><span class="special">[</span><span class="number">0</span><span class="special">]);</span> <span class="identifier">i</span><span class="special">++)</span>
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"If confidence of meeting quota is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">ps</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span>
<span class="special">&lt;&lt;</span> <span class="string">", then finishing house is "</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">nb</span><span class="special">,</span> <span class="identifier">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>
@@ -478,11 +478,11 @@ If confidence of meeting quota is 0.95, then finishing house is 21
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Negative Binomial Table Printing Example.</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../neg_binom_eg.html" title="Negative Binomial Distribution Examples">
<link rel="prev" href="negative_binomial_example1.html" title="Negative Binomial Sales Quota Example.">
<link rel="next" href="../normal_example.html" title="Normal Distribution Examples">
@@ -119,11 +119,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Normal Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="neg_binom_eg/negative_binomial_example2.html" title="Negative Binomial Table Printing Example.">
<link rel="next" href="normal_example/normal_misc.html" title="Some Miscellaneous Examples of the Normal (Gaussian) Distribution">
@@ -36,11 +36,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Some Miscellaneous Examples of the Normal (Gaussian) Distribution</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../normal_example.html" title="Normal Distribution Examples">
<link rel="prev" href="../normal_example.html" title="Normal Distribution Examples">
<link rel="next" href="../inverse_chi_squared_eg.html" title="Inverse Chi-Squared Distribution Bayes Example">
@@ -88,7 +88,7 @@
<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>
And the area under the normal curve from -&#8734; up to z, the cumulative distribution
And the area under the normal curve from - up to z, the cumulative distribution
function (cdf).
</p>
<pre class="programlisting"><span class="comment">// For a standard normal distribution</span>
@@ -163,7 +163,7 @@
</p>
<pre class="programlisting"><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"level of significance (alpha)"</span> <span class="special">&lt;&lt;</span> <span class="identifier">setprecision</span><span class="special">(</span><span class="number">4</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"2-sided 1 -sided z(alpha) "</span> <span class="special">&lt;&lt;</span> <span class="identifier">endl</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">alpha</span><span class="special">)/</span><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">alpha</span><span class="special">[</span><span class="number">0</span><span class="special">]);</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="keyword">for</span> <span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">alpha</span><span class="special">)/</span><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">alpha</span><span class="special">[</span><span class="number">0</span><span class="special">]);</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="special">{</span>
<span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">15</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">alpha</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">15</span><span class="special">)</span> <span class="special">&lt;&lt;</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">&lt;&lt;</span> <span class="identifier">setw</span><span class="special">(</span><span class="number">10</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">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">&lt;&lt;</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>
@@ -174,16 +174,16 @@
Notice the distinction between one-sided (also called one-tailed) where
we are using a &gt; <span class="bold"><strong>or</strong></span> &lt; test (and
not both) and considering the area of the tail (integral) from z up to
+&#8734;, and a two-sided test where we are using two &gt; <span class="bold"><strong>and</strong></span>
&lt; tests, and thus considering two tails, from -&#8734; up to z low and z high
up to +&#8734;.
+, and a two-sided test where we are using two &gt; <span class="bold"><strong>and</strong></span>
&lt; tests, and thus considering two tails, from - up to z low and z high
up to +.
</p>
<p>
So the 2-sided values alpha[i] are calculated using alpha[i]/2.
</p>
<p>
If we consider a simple example of alpha = 0.05, then for a two-sided
test, the lower tail area from -&#8734; up to -1.96 is 0.025 (alpha/2) and the
test, the lower tail area from - up to -1.96 is 0.025 (alpha/2) and the
upper tail area from +z up to +1.96 is also 0.025 (alpha/2), and the
area between -1.96 up to 12.96 is alpha = 0.95. and the sum of the two
tails is 0.025 + 0.025 = 0.05,
@@ -501,11 +501,11 @@ Fraction 3 standard deviations within either side of mean is 0.997300203936740
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Student's t Distribution Examples</title>
<link rel="stylesheet" href="../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../weg.html" title="Worked Examples">
<link rel="prev" href="dist_construct_eg.html" title="Distribution Construction Examples">
<link rel="next" href="st_eg/tut_mean_intervals.html" title="Calculating confidence intervals on the mean with the Students-t distribution">
@@ -43,11 +43,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Comparing two paired samples with the Student's t distribution</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../st_eg.html" title="Student's t Distribution Examples">
<link rel="prev" href="two_sample_students_t.html" title="Comparing the means of two samples with the Students-t test">
<link rel="next" href="../cs_eg.html" title="Chi Squared Distribution Examples">
@@ -64,11 +64,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calculating confidence intervals on the mean with the Students-t distribution</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../st_eg.html" title="Student's t Distribution Examples">
<link rel="prev" href="../st_eg.html" title="Student's t Distribution Examples">
<link rel="next" href="tut_mean_test.html" title='Testing a sample mean for difference from a "true" mean'>
@@ -39,13 +39,14 @@
<p>
The formula for the interval can be expressed as:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial4.svg"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial4.svg"></span>
</p></blockquote></div>
<p>
Where, <span class="emphasis"><em>Y<sub>s</sub></em></span> is the sample mean, <span class="emphasis"><em>s</em></span>
is the sample standard deviation, <span class="emphasis"><em>N</em></span> is the sample
size, /&#945;/ is the desired significance level and <span class="emphasis"><em>t<sub>(&#945;/2,N-1)</sub></em></span>
size, /α/ is the desired significance level and <span class="emphasis"><em>t<sub>(α/2,N-1)</sub></em></span>
is the upper critical value of the Students-t distribution with <span class="emphasis"><em>N-1</em></span>
degrees of freedom.
</p>
@@ -56,12 +57,12 @@
</tr>
<tr><td align="left" valign="top">
<p>
The quantity &#945; &#160; is the maximum acceptable risk of falsely rejecting the
null-hypothesis. The smaller the value of &#945; the greater the strength
The quantity α is the maximum acceptable risk of falsely rejecting the
null-hypothesis. The smaller the value of α the greater the strength
of the test.
</p>
<p>
The confidence level of the test is defined as 1 - &#945;, and often expressed
The confidence level of the test is defined as 1 - α, and often expressed
as a percentage. So for example a significance level of 0.05, is equivalent
to a 95% confidence level. Refer to <a href="http://www.itl.nist.gov/div898/handbook/prc/section1/prc14.htm" target="_top">"What
are confidence intervals?"</a> in <a href="http://www.itl.nist.gov/div898/handbook/" target="_top">NIST/SEMATECH
@@ -250,11 +251,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Estimating how large a sample size would have to become in order to give a significant Students-t test result with a single sample test</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../st_eg.html" title="Student's t Distribution Examples">
<link rel="prev" href="tut_mean_test.html" title='Testing a sample mean for difference from a "true" mean'>
<link rel="next" href="two_sample_students_t.html" title="Comparing the means of two samples with the Students-t test">
@@ -162,11 +162,11 @@ _______________________________________________________________
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing a sample mean for difference from a "true" mean</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../st_eg.html" title="Student's t Distribution Examples">
<link rel="prev" href="tut_mean_intervals.html" title="Calculating confidence intervals on the mean with the Students-t distribution">
<link rel="next" href="tut_mean_size.html" title="Estimating how large a sample size would have to become in order to give a significant Students-t test result with a single sample test">
@@ -54,7 +54,7 @@
</tr>
<tr><td align="left" valign="top"><p>
Non-statisticians might say 'not-rejected' means 'accepted', (often
of the null-hypothesis) implying, wrongly, that there really <span class="bold"><strong>IS</strong></span> no difference, but statisticans eschew this
of the null-hypothesis) implying, wrongly, that there really <span class="bold"><strong>IS</strong></span> no difference, but statisticians eschew this
to avoid implying that there is positive evidence of 'no difference'.
'Not-rejected' here means there is <span class="bold"><strong>no evidence</strong></span>
of difference, but there still might well be a difference. For example,
@@ -317,11 +317,11 @@ Mean &gt; 38.900 REJECTED
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>

View File

@@ -1,10 +1,10 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Comparing the means of two samples with the Students-t test</title>
<link rel="stylesheet" href="../../../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Math Toolkit 2.6.0">
<link rel="home" href="../../../../index.html" title="Math Toolkit 3.0.0">
<link rel="up" href="../st_eg.html" title="Student's t Distribution Examples">
<link rel="prev" href="tut_mean_size.html" title="Estimating how large a sample size would have to become in order to give a significant Students-t test result with a single sample test">
<link rel="next" href="paired_st.html" title="Comparing two paired samples with the Student's t distribution">
@@ -75,9 +75,10 @@
Our procedure will begin by calculating the t-statistic, assuming equal
variances the needed formulae are:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial1.svg"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial1.svg"></span>
</p></blockquote></div>
<p>
where Sp is the "pooled" standard deviation of the two samples,
and <span class="emphasis"><em>v</em></span> is the number of degrees of freedom of the
@@ -162,7 +163,7 @@
<p>
<code class="computeroutput"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist</span><span class="special">,</span>
<span class="identifier">fabs</span><span class="special">(</span><span class="identifier">t</span><span class="special">)))</span>
<span class="special">&lt;</span> <span class="identifier">alpha</span>
<span class="special">&gt;</span> <span class="identifier">alpha</span>
<span class="special">/</span> <span class="number">2</span></code>
</p>
</td>
@@ -260,16 +261,18 @@
at the more complex one: that the standard deviations of the two samples
are not equal. In this case the formula for the t-statistic becomes:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial2.svg"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial2.svg"></span>
</p></blockquote></div>
<p>
And for the combined degrees of freedom we use the <a href="http://en.wikipedia.org/wiki/Welch-Satterthwaite_equation" target="_top">Welch-Satterthwaite</a>
approximation:
</p>
<p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial3.svg"></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="inlinemediaobject"><img src="../../../../../equations/dist_tutorial3.svg"></span>
</p></blockquote></div>
<p>
Note that this is one of the rare situations where the degrees-of-freedom
parameter to the Student's t distribution is a real number, and not an
@@ -342,11 +345,11 @@
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2006-2010, 2012-2014, 2017 Nikhar
Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan R&#229;de, Gautam
Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle Walker
and Xiaogang Zhang<p>
<td align="right"><div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
Walker and Xiaogang Zhang<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>