Ignore:
Timestamp:
Aug 12, 2005, 5:39:24 PM (16 years ago)
Author:
Jari Häkkinen
Message:

Moved regression stuff into a namespace ...statistics::regression.
Filenames was changed and a first draft of a Polynomial regression is
implemented (compiles but does not run properly).

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/lib/statistics/Linear.cc

    r380 r383  
    11// $Id$
    22
    3 #include <c++_tools/statistics/RegressionLinear.h>
     3#include <c++_tools/statistics/Linear.h>
    44
    55#include <c++_tools/statistics/AveragerPair.h>
     
    1212namespace theplu {
    1313namespace statistics {
     14namespace regression {
    1415
    15  
    16   RegressionLinear::RegressionLinear(void)
    17     : Regression(), alpha_(0), alpha_var_(0), beta_(0), beta_var_(0), m_x_(0),
    18       s2_(0)
    19   {
    20   }
    2116
    22   void RegressionLinear::fit(const gslapi::vector& x, const gslapi::vector& y)
     17  void Linear::fit(const gslapi::vector& x, const gslapi::vector& y)
    2318  {
    2419    statistics::AveragerPair ap;
     
    4035  }
    4136
    42   void RegressionLinear::fit(const gslapi::vector& x, const gslapi::vector& y,
    43                              const gslapi::vector& w)
     37  void Linear::fit(const gslapi::vector& x,
     38                   const gslapi::vector& y,
     39                   const gslapi::vector& w)
    4440  {
    4541    double m_x = w*x /w.sum();
     
    6965  }
    7066
    71   std::ostream& RegressionLinear::print(std::ostream& s) const
     67  std::ostream& Linear::print(std::ostream& s) const
    7268  {
    7369    s << x_ << "\t"
     
    8480  }
    8581   
    86   std::ostream& RegressionLinear::print_header(std::ostream& s) const
     82  std::ostream& Linear::print_header(std::ostream& s) const
    8783  {
    8884    s << "# column 1: x\n"
     
    9894  }
    9995
    100    
    101 }} // of namespace statistics and namespace theplu
     96
     97}}} // of namespaces regression, statisitcs and thep
Note: See TracChangeset for help on using the changeset viewer.