yat  0.8.3pre
OneDimensional.h
00001 #ifndef _theplu_yat_regression_onedimensional_
00002 #define _theplu_yat_regression_onedimensional_
00003 
00004 // $Id: OneDimensional.h 2564 2011-09-25 20:03:41Z peter $
00005 
00006 /*
00007   Copyright (C) 2004 Peter Johansson
00008   Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
00009   Copyright (C) 2011 Peter Johansson
00010 
00011   This file is part of the yat library, http://dev.thep.lu.se/yat
00012 
00013   The yat library is free software; you can redistribute it and/or
00014   modify it under the terms of the GNU General Public License as
00015   published by the Free Software Foundation; either version 3 of the
00016   License, or (at your option) any later version.
00017 
00018   The yat library is distributed in the hope that it will be useful,
00019   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00021   General Public License for more details.
00022 
00023   You should have received a copy of the GNU General Public License
00024   along with yat. If not, see <http://www.gnu.org/licenses/>.
00025 */
00026 
00027 #include "yat/statistics/AveragerPair.h"
00028 
00029 #include <iosfwd>
00030 
00031 namespace theplu {
00032 namespace yat {
00033 namespace utility {
00034   class VectorBase;
00035 }
00036 namespace regression {
00037 
00043   class OneDimensional 
00044   {
00045 
00046   public:
00050     OneDimensional(void);
00051 
00055     virtual ~OneDimensional(void);
00056  
00063     double chisq(void) const;
00064     
00070     virtual void fit(const utility::VectorBase& x, 
00071                      const utility::VectorBase& y)=0; 
00072     
00076     virtual double predict(const double x) const=0;
00077     
00089     double prediction_error2(const double x) const; 
00090 
00105     std::ostream& print(std::ostream& os,const double min, 
00106                         double max, const unsigned int n) const;
00107 
00114     double r2(void) const;
00115 
00121     virtual double s2(void) const=0;
00122 
00128     virtual double standard_error2(const double x) const=0;
00129 
00130   protected:
00134     double variance(void) const;
00135 
00139     statistics::AveragerPair ap_;
00140 
00144     double chisq_;
00145   };
00146 
00147 }}} // of namespaces regression, yat, and theplu
00148 
00149 #endif

Generated on Thu Dec 20 2012 03:12:58 for yat by  doxygen 1.8.0-20120409