yat  0.21pre
OneDimensionalWeighted.h
1 #ifndef _theplu_yat_regression_onedimensioanlweighted_
2 #define _theplu_yat_regression_onedimensioanlweighted_
3 
4 // $Id: OneDimensionalWeighted.h 4207 2022-08-26 04:36:28Z peter $
5 
6 /*
7  Copyright (C) 2005 Peter Johansson
8  Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2022 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/AveragerPairWeighted.h"
28 
29 #include <ostream>
30 
31 namespace theplu {
32 namespace yat {
33 namespace utility {
34  class VectorBase;
35 }
36 namespace regression {
37 
43  {
44 
45  public:
50 
54  virtual ~OneDimensionalWeighted(void);
55 
63  virtual void fit(const utility::VectorBase& x, const utility::VectorBase& y,
64  const utility::VectorBase& w)=0;
65 
69  virtual double predict(const double x) const=0;
70 
84  double prediction_error2(const double x, const double w=1.0) const;
85 
91  double r2(void) const;
92 
99  virtual double s2(double w=1) const=0;
100 
107  virtual double standard_error2(const double x) const=0;
108 
109  protected:
114 
121  double chisq_;
122 
123  private:
124  };
125 
126 }}} // of namespaces regression, yat, and theplu
127 
128 #endif
double chisq_
Chi-squared.
Definition: OneDimensionalWeighted.h:121
virtual double s2(double w=1) const =0
virtual void fit(const utility::VectorBase &x, const utility::VectorBase &y, const utility::VectorBase &w)=0
Class for taking care of mean and covariance of two variables in a weighted manner.
Definition: AveragerPairWeighted.h:56
The Department of Theoretical Physics namespace as we define it.
virtual double standard_error2(const double x) const =0
This is the yat interface to GSL vector.
Definition: VectorBase.h:55
Interface Class for One Dimensional fitting in a weighted fashion.
Definition: OneDimensionalWeighted.h:42
virtual double predict(const double x) const =0
double prediction_error2(const double x, const double w=1.0) const
statistics::AveragerPairWeighted ap_
Definition: OneDimensionalWeighted.h:113

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14