00001 #ifndef _theplu_yat_regression_onedimensional_
00002 #define _theplu_yat_regression_onedimensional_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "yat/statistics/AveragerPair.h"
00027
00028 #include <ostream>
00029
00030 namespace theplu {
00031 namespace yat {
00032 namespace utility {
00033 class VectorBase;
00034 }
00035 namespace regression {
00036
00042 class OneDimensional
00043 {
00044
00045 public:
00049 OneDimensional(void);
00050
00054 virtual ~OneDimensional(void);
00055
00062 double chisq(void) const;
00063
00069 virtual void fit(const utility::VectorBase& x,
00070 const utility::VectorBase& y)=0;
00071
00075 virtual double predict(const double x) const=0;
00076
00088 double prediction_error2(const double x) const;
00089
00104 std::ostream& print(std::ostream& os,const double min,
00105 double max, const unsigned int n) const;
00106
00113 double r2(void) const;
00114
00120 virtual double s2(void) const=0;
00121
00127 virtual double standard_error2(const double x) const=0;
00128
00129 protected:
00133 double variance(void) const;
00134
00138 statistics::AveragerPair ap_;
00139
00143 double chisq_;
00144 };
00145
00146 }}}
00147
00148 #endif