00001 #ifndef _theplu_yat_regression_polynomialweighted_ 00002 #define _theplu_yat_regression_polynomialweighted_ 00003 00004 // $Id: PolynomialWeighted.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 00008 00009 This file is part of the yat library, http://dev.thep.lu.se/yat 00010 00011 The yat library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License as 00013 published by the Free Software Foundation; either version 3 of the 00014 License, or (at your option) any later version. 00015 00016 The yat library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with yat. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #include "OneDimensionalWeighted.h" 00026 #include "MultiDimensionalWeighted.h" 00027 #include "yat/utility/Vector.h" 00028 00029 namespace theplu { 00030 namespace yat { 00031 namespace regression { 00032 00036 class PolynomialWeighted : public OneDimensionalWeighted 00037 { 00038 public: 00039 00043 PolynomialWeighted(size_t power); 00044 00048 ~PolynomialWeighted(void); 00049 00057 void fit(const utility::VectorBase& x, const utility::VectorBase& y, 00058 const utility::VectorBase& w); 00059 00065 const utility::Vector& fit_parameters(void) const; 00066 00070 double s2(const double w=1) const; 00071 00075 double predict(const double x) const; 00076 00080 double standard_error2(const double x) const; 00081 00082 private: 00083 MultiDimensionalWeighted md_; 00084 size_t power_; 00085 00086 }; 00087 00088 }}} // of namespaces regression, yat, and theplu 00089 00090 #endif