Boost C++ Libraries: Ticket #7402: Typo in math example
https://svn.boost.org/trac10/ticket/7402
<p>
In the function <code>two_samples_t_test_equal_sd</code> in libs/math/example/students_t_two_samples.cpp:
</p>
<pre class="wiki"> //
// Now we can calculate and output some stats:
//
// Degrees of freedom:
double v = Sn1 + Sn2 - 2;
cout << setw(55) << left << "Degrees of Freedom" << "= " << v << "\n";
// Pooled variance:
double sp = sqrt(((Sn1-1) * Sd1 * Sd1 + (Sn2-1) * Sd2 * Sd2) / v);
/********* THIS LINE BELOW **********/
cout << setw(55) << left << "Pooled Standard Deviation" << "= " << v << "\n";
// t-statistic:
double t_stat = (Sm1 - Sm2) / (sp * sqrt(1.0 / Sn1 + 1.0 / Sn2));
cout << setw(55) << left << "T Statistic" << "= " << t_stat << "\n";
</pre><p>
I believe the line marked should have <code>sp</code> in place of <code>v</code>.
</p>
en-usBoost C++ Libraries/htdocs/site/boost.png
https://svn.boost.org/trac10/ticket/7402
Trac 1.4.3John MaddockFri, 21 Sep 2012 16:09:42 GMTowner changed
https://svn.boost.org/trac10/ticket/7402#comment:1
https://svn.boost.org/trac10/ticket/7402#comment:1
<ul>
<li><strong>owner</strong>
changed from <span class="trac-author">John Maddock</span> to <span class="trac-author">Paul A. Bristow</span>
</li>
</ul>
TicketPaul A. BristowWed, 26 Sep 2012 15:36:35 GMTstatus changed; keywords, resolution set
https://svn.boost.org/trac10/ticket/7402#comment:2
https://svn.boost.org/trac10/ticket/7402#comment:2
<ul>
<li><strong>keywords</strong>
math students t two sample added
</li>
<li><strong>status</strong>
<span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span>
</li>
<li><strong>resolution</strong>
→ <span class="trac-field-new">fixed</span>
</li>
</ul>
<p>
Thanks for reporting this. Glad to see someone is reading this.
</p>
<p>
Corrected in trunk SVN 80706
</p>
Ticket