yat  0.14.5pre
LinearWeighted.h
1 #ifndef _theplu_yat_regression_linearweighted_
2 #define _theplu_yat_regression_linearweighted_
3 
4 // $Id: LinearWeighted.h 3076 2013-09-05 08:01:19Z peter $
5 
6 /*
7  Copyright (C) 2005 Peter Johansson
8  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
9  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
10  Copyright (C) 2012 Peter Johansson
11 
12  This file is part of the yat library, http://dev.thep.lu.se/yat
13 
14  The yat library is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License as
16  published by the Free Software Foundation; either version 3 of the
17  License, or (at your option) any later version.
18 
19  The yat library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with yat. If not, see <http://www.gnu.org/licenses/>.
26 */
27 
28 #include "OneDimensionalWeighted.h"
29 
30 namespace theplu {
31 namespace yat {
32  namespace utility {
33  class VectorBase;
34  }
35 namespace regression {
36 
41  {
42 
43  public:
47  LinearWeighted(void);
48 
52  virtual ~LinearWeighted(void);
53 
59  double alpha(void) const;
60 
68  double alpha_var(void) const;
69 
76  double beta(void) const;
77 
85  double beta_var(void) const;
86 
95  void fit(const utility::VectorBase& x, const utility::VectorBase& y,
96  const utility::VectorBase& w);
97 
102  double predict(const double x) const;
103 
107  double s2(double w=1) const;
108 
113  double standard_error2(const double x) const;
114 
115  private:
120 
121  double m_x(void) const;
122  double m_y(void) const;
123  double sxx(void) const;
124  double syy(void) const;
125  double sxy(void) const;
126 
127  double alpha_;
128  double alpha_var_;
129  double beta_;
130  double beta_var_;
131  };
132 
133 }}} // of namespaces regression, yat, and theplu
134 
135 #endif
void fit(const utility::VectorBase &x, const utility::VectorBase &y, const utility::VectorBase &w)
double standard_error2(const double x) const
linear regression.
Definition: LinearWeighted.h:40
This is the yat interface to GSL vector.
Definition: VectorBase.h:52
double predict(const double x) const
Interface Class for One Dimensional fitting in a weighted fashion.
Definition: OneDimensionalWeighted.h:41
LinearWeighted(void)
The default constructor.
virtual ~LinearWeighted(void)
The destructor.

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