yat  0.10.4pre
LinearWeighted.h
1 #ifndef _theplu_yat_regression_linearweighted_
2 #define _theplu_yat_regression_linearweighted_
3 
4 // $Id: LinearWeighted.h 2919 2012-12-19 06:54:23Z 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 
96  void fit(const utility::VectorBase& x, const utility::VectorBase& y,
97  const utility::VectorBase& w);
98 
103  double predict(const double x) const;
104 
108  double s2(double w=1) const;
109 
114  double standard_error2(const double x) const;
115 
116  private:
121 
122  double m_x(void) const;
123  double m_y(void) const;
124  double sxx(void) const;
125  double syy(void) const;
126  double sxy(void) const;
127 
128  double alpha_;
129  double alpha_var_;
130  double beta_;
131  double beta_var_;
132  };
133 
134 }}} // of namespaces regression, yat, and theplu
135 
136 #endif

Generated on Mon Nov 11 2013 09:41:44 for yat by  doxygen 1.8.1