source: trunk/c++_tools/statistics/OneDimensional.cc @ 586

Last change on this file since 586 was 586, checked in by Peter, 15 years ago

closes #23 redesign of regression classes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 565 bytes
Line 
1// $Id: OneDimensional.cc 586 2006-06-19 09:56:04Z peter $
2
3#include <c++_tools/statistics/OneDimensional.h>
4
5namespace theplu {
6namespace statistics {
7namespace regression {
8
9  std::ostream& OneDimensional::print(std::ostream& os, const double min, 
10                                      double max, const u_int n) const
11  {
12    double dx;
13    if (n>1)
14      dx=(max-min)/(n-1);
15    else{
16      dx=1.0;
17      max=min;
18    }
19
20    for ( double x=min; x<=max; x+=dx) {
21      double y = predict(x);
22      double y_err = prediction_error(x);
23      os << x << "\t" << y << "\t" << y_err << "\n";
24    }
25    return os;
26  }
27
28}}} // of namespaces regression, statisitcs and thep
Note: See TracBrowser for help on using the repository browser.