yat  0.14.5pre
OneDimensional.h
1 #ifndef _theplu_yat_regression_onedimensional_
2 #define _theplu_yat_regression_onedimensional_
3 
4 // $Id: OneDimensional.h 2564 2011-09-25 20:03:41Z peter $
5 
6 /*
7  Copyright (C) 2004 Peter Johansson
8  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2011 Peter Johansson
10 
11  This file is part of the yat library, http://dev.thep.lu.se/yat
12 
13  The yat library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License as
15  published by the Free Software Foundation; either version 3 of the
16  License, or (at your option) any later version.
17 
18  The yat library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with yat. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #include "yat/statistics/AveragerPair.h"
28 
29 #include <iosfwd>
30 
31 namespace theplu {
32 namespace yat {
33 namespace utility {
34  class VectorBase;
35 }
36 namespace regression {
37 
44  {
45 
46  public:
50  OneDimensional(void);
51 
55  virtual ~OneDimensional(void);
56 
63  double chisq(void) const;
64 
70  virtual void fit(const utility::VectorBase& x,
71  const utility::VectorBase& y)=0;
72 
76  virtual double predict(const double x) const=0;
77 
89  double prediction_error2(const double x) const;
90 
105  std::ostream& print(std::ostream& os,const double min,
106  double max, const unsigned int n) const;
107 
114  double r2(void) const;
115 
121  virtual double s2(void) const=0;
122 
128  virtual double standard_error2(const double x) const=0;
129 
130  protected:
134  double variance(void) const;
135 
140 
144  double chisq_;
145  };
146 
147 }}} // of namespaces regression, yat, and theplu
148 
149 #endif
std::ostream & print(std::ostream &os, const double min, double max, const unsigned int n) const
print output to ostream os
virtual ~OneDimensional(void)
The destructor.
virtual double predict(const double x) const =0
Class for taking care of mean and covariance of two variables.
Definition: AveragerPair.h:47
T max(const T &a, const T &b, const T &c)
Definition: stl_utility.h:697
This is the yat interface to GSL vector.
Definition: VectorBase.h:52
double chisq_
Definition: OneDimensional.h:144
statistics::AveragerPair ap_
Definition: OneDimensional.h:139
double prediction_error2(const double x) const
virtual void fit(const utility::VectorBase &x, const utility::VectorBase &y)=0
Interface Class for One Dimensional fitting.
Definition: OneDimensional.h:43
OneDimensional(void)
The default constructor.
virtual double s2(void) const =0
double chisq(void) const
Chi-squared.
virtual double standard_error2(const double x) const =0

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5