2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Revert [67111] (addition of boost/detail/iomanip.hpp) and all the commits that depend on it. ([68137], [68140], [68141], [68154], and [68165]).

[SVN r68168]
This commit is contained in:
Steven Watanabe
2011-01-15 08:11:51 +00:00
parent a52fce70a8
commit 3524499fc0
99 changed files with 455 additions and 536 deletions

View File

@@ -13,13 +13,12 @@
# pragma warning(disable: 4180) // qualifier has no effect (in Fusion).
#endif
#include <ios>
#include <boost/detail/iomanip.hpp>
#include <iostream>
using std::cout; using std::endl;
using std::left; using std::fixed; using std::right; using std::scientific;
using boost::detail::setw;
using boost::detail::setprecision;
#include <iomanip>
using std::setw;
using std::setprecision;
#include <boost/math/distributions/fisher_f.hpp>
@@ -47,45 +46,45 @@ void f_test(
"____________________________________\n"
"F test for equal standard deviations\n"
"____________________________________\n\n";
cout << boost::detail::setprecision(5);
cout << setprecision(5);
cout << "Sample 1:\n";
cout << boost::detail::setw(55) << left << "Number of Observations" << "= " << N1 << "\n";
cout << boost::detail::setw(55) << left << "Sample Standard Deviation" << "= " << sd1 << "\n\n";
cout << setw(55) << left << "Number of Observations" << "= " << N1 << "\n";
cout << setw(55) << left << "Sample Standard Deviation" << "= " << sd1 << "\n\n";
cout << "Sample 2:\n";
cout << boost::detail::setw(55) << left << "Number of Observations" << "= " << N2 << "\n";
cout << boost::detail::setw(55) << left << "Sample Standard Deviation" << "= " << sd2 << "\n\n";
cout << setw(55) << left << "Number of Observations" << "= " << N2 << "\n";
cout << setw(55) << left << "Sample Standard Deviation" << "= " << sd2 << "\n\n";
//
// Now we can calculate and output some stats:
//
// F-statistic:
double F = (sd1 / sd2);
F *= F;
cout << boost::detail::setw(55) << left << "Test Statistic" << "= " << F << "\n\n";
cout << setw(55) << left << "Test Statistic" << "= " << F << "\n\n";
//
// Finally define our distribution, and get the probability:
//
fisher_f dist(N1 - 1, N2 - 1);
double p = cdf(dist, F);
cout << boost::detail::setw(55) << left << "CDF of test statistic: " << "= "
<< boost::detail::setprecision(3) << scientific << p << "\n";
cout << setw(55) << left << "CDF of test statistic: " << "= "
<< setprecision(3) << scientific << p << "\n";
double ucv = quantile(complement(dist, alpha));
double ucv2 = quantile(complement(dist, alpha / 2));
double lcv = quantile(dist, alpha);
double lcv2 = quantile(dist, alpha / 2);
cout << boost::detail::setw(55) << left << "Upper Critical Value at alpha: " << "= "
<< boost::detail::setprecision(3) << scientific << ucv << "\n";
cout << boost::detail::setw(55) << left << "Upper Critical Value at alpha/2: " << "= "
<< boost::detail::setprecision(3) << scientific << ucv2 << "\n";
cout << boost::detail::setw(55) << left << "Lower Critical Value at alpha: " << "= "
<< boost::detail::setprecision(3) << scientific << lcv << "\n";
cout << boost::detail::setw(55) << left << "Lower Critical Value at alpha/2: " << "= "
<< boost::detail::setprecision(3) << scientific << lcv2 << "\n\n";
cout << setw(55) << left << "Upper Critical Value at alpha: " << "= "
<< setprecision(3) << scientific << ucv << "\n";
cout << setw(55) << left << "Upper Critical Value at alpha/2: " << "= "
<< setprecision(3) << scientific << ucv2 << "\n";
cout << setw(55) << left << "Lower Critical Value at alpha: " << "= "
<< setprecision(3) << scientific << lcv << "\n";
cout << setw(55) << left << "Lower Critical Value at alpha/2: " << "= "
<< setprecision(3) << scientific << lcv2 << "\n\n";
//
// Finally print out results of null and alternative hypothesis:
//
cout << boost::detail::setw(55) << left <<
cout << setw(55) << left <<
"Results for Alternative Hypothesis and alpha" << "= "
<< boost::detail::setprecision(4) << fixed << alpha << "\n\n";
<< setprecision(4) << fixed << alpha << "\n\n";
cout << "Alternative Hypothesis Conclusion\n";
cout << "Standard deviations are unequal (two sided test) ";
if((ucv2 < F) || (lcv2 > F))