Modify

Opened 5 years ago

Closed 5 years ago

#7402 closed Bugs (fixed)

Typo in math example

Reported by: n.g.davies@… Owned by: pbristow
Milestone: To Be Determined Component: math
Version: Boost 1.52.0 Severity: Problem
Keywords: math students t two sample Cc:

Description

In the function two_samples_t_test_equal_sd in libs/math/example/students_t_two_samples.cpp:

   //
   // 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";

I believe the line marked should have sp in place of v.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by johnmaddock

  • Owner changed from johnmaddock to pbristow

comment:2 Changed 5 years ago by pbristow

  • Keywords math students t two sample added
  • Resolution set to fixed
  • Status changed from new to closed

Thanks for reporting this. Glad to see someone is reading this.

Corrected in trunk SVN 80706

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain pbristow.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.