yat
0.8.3pre
|
00001 #ifndef _theplu_yat_regression_naiveweighted_ 00002 #define _theplu_yat_regression_naiveweighted_ 00003 00004 // $Id: NaiveWeighted.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2005 Peter Johansson 00008 Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 00009 00010 This file is part of the yat library, http://dev.thep.lu.se/yat 00011 00012 The yat library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License as 00014 published by the Free Software Foundation; either version 3 of the 00015 License, or (at your option) any later version. 00016 00017 The yat library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with yat. If not, see <http://www.gnu.org/licenses/>. 00024 */ 00025 00026 #include "OneDimensionalWeighted.h" 00027 00028 #include <cmath> 00029 #include <utility> 00030 00031 namespace theplu { 00032 namespace yat { 00033 namespace utility { 00034 class VectorBase; 00035 } 00036 namespace regression { 00037 00043 class NaiveWeighted : public OneDimensionalWeighted 00044 { 00045 00046 public: 00050 NaiveWeighted(void); 00051 00055 virtual ~NaiveWeighted(void); 00056 00063 void fit(const utility::VectorBase& x, 00064 const utility::VectorBase& y, 00065 const utility::VectorBase& w); 00066 00071 double predict(const double x) const; 00072 00082 double s2(const double w=1) const; 00083 00090 double standard_error2(const double x) const; 00091 00092 private: 00096 NaiveWeighted(const NaiveWeighted&); 00097 00098 }; 00099 00100 }}} // of namespaces regression, yat, and theplu 00101 00102 #endif