yat  0.9.3pre
LinearWeighted.h
1 #ifndef _theplu_yat_regression_linearweighted_
2 #define _theplu_yat_regression_linearweighted_
3 
4 // $Id: LinearWeighted.h 2119 2009-12-12 23:11:43Z 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 
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 "OneDimensionalWeighted.h"
28 
29 namespace theplu {
30 namespace yat {
31  namespace utility {
32  class VectorBase;
33  }
34 namespace regression {
35 
42  {
43 
44  public:
48  LinearWeighted(void);
49 
53  virtual ~LinearWeighted(void);
54 
60  double alpha(void) const;
61 
69  double alpha_var(void) const;
70 
77  double beta(void) const;
78 
86  double beta_var(void) const;
87 
96 
97  void fit(const utility::VectorBase& x, const utility::VectorBase& y,
98  const utility::VectorBase& w);
99 
104  double predict(const double x) const;
105 
109  double s2(double w=1) const;
110 
115  double standard_error2(const double x) const;
116 
117  private:
122 
123  double m_x(void) const;
124  double m_y(void) const;
125  double sxx(void) const;
126  double syy(void) const;
127  double sxy(void) const;
128 
129  double alpha_;
130  double alpha_var_;
131  double beta_;
132  double beta_var_;
133  };
134 
135 }}} // of namespaces regression, yat, and theplu
136 
137 #endif

Generated on Tue Jan 29 2013 02:33:39 for yat by  doxygen 1.8.1