yat
0.8.3pre
|
00001 #ifndef _theplu_yat_regression_linearweighted_ 00002 #define _theplu_yat_regression_linearweighted_ 00003 00004 // $Id: LinearWeighted.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2005 Peter Johansson 00008 Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér 00009 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 00010 00011 This file is part of the yat library, http://dev.thep.lu.se/yat 00012 00013 The yat library is free software; you can redistribute it and/or 00014 modify it under the terms of the GNU General Public License as 00015 published by the Free Software Foundation; either version 3 of the 00016 License, or (at your option) any later version. 00017 00018 The yat library is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00021 General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 along with yat. If not, see <http://www.gnu.org/licenses/>. 00025 */ 00026 00027 #include "OneDimensionalWeighted.h" 00028 00029 namespace theplu { 00030 namespace yat { 00031 namespace utility { 00032 class VectorBase; 00033 } 00034 namespace regression { 00035 00041 class LinearWeighted : public OneDimensionalWeighted 00042 { 00043 00044 public: 00048 LinearWeighted(void); 00049 00053 virtual ~LinearWeighted(void); 00054 00060 double alpha(void) const; 00061 00069 double alpha_var(void) const; 00070 00077 double beta(void) const; 00078 00086 double beta_var(void) const; 00087 00096 00097 void fit(const utility::VectorBase& x, const utility::VectorBase& y, 00098 const utility::VectorBase& w); 00099 00104 double predict(const double x) const; 00105 00109 double s2(double w=1) const; 00110 00115 double standard_error2(const double x) const; 00116 00117 private: 00121 LinearWeighted(const LinearWeighted&); 00122 00123 double m_x(void) const; 00124 double m_y(void) const; 00125 double sxx(void) const; 00126 double syy(void) const; 00127 double sxy(void) const; 00128 00129 double alpha_; 00130 double alpha_var_; 00131 double beta_; 00132 double beta_var_; 00133 }; 00134 00135 }}} // of namespaces regression, yat, and theplu 00136 00137 #endif