yat  0.13.2pre
Local.h
1 #ifndef _theplu_yat_regression_local_
2 #define _theplu_yat_regression_local_
3 
4 // $Id: Local.h 2564 2011-09-25 20:03:41Z peter $
5 
6 /*
7  Copyright (C) 2004 Peter Johansson
8  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2009, 2010, 2011 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 "yat/utility/Vector.h"
28 
29 #include <iosfwd>
30 
31 namespace theplu {
32 namespace yat {
33 namespace regression {
34 
35  class Kernel;
36  class OneDimensionalWeighted;
37 
49  class Local
50  {
51 
52  public:
58 
62  virtual ~Local(void);
63 
67  void add(const double x, const double y);
68 
76  void fit(const size_t step_size, const size_t nof_points);
77 
83  void reset(void);
84 
88  const utility::Vector& x(void) const;
89 
93  const utility::Vector& y_predicted(void) const;
94 
98  const utility::Vector& y_err(void) const;
99 
100  private:
104  Local(const Local&);
105 
106  std::vector<std::pair<double, double> > data_;
107  Kernel* kernel_;
108  OneDimensionalWeighted* regressor_;
109  utility::Vector x_;
110  utility::Vector y_predicted_;
111  utility::Vector y_err_;
112  };
113 
119  std::ostream& operator<<(std::ostream&, const Local& );
120 
121 }}} // of namespaces regression, yat, and theplu
122 
123 #endif
Class for Locally weighted regression.
Definition: Local.h:49
virtual ~Local(void)
The destructor.
void add(const double x, const double y)
Local(OneDimensionalWeighted &r, Kernel &k)
Constructor taking type of regressor, type of kernel.
This is the yat interface to GSL vector.
Definition: Vector.h:57
void reset(void)
Set everything to zero.
Interface Class for calculating the weights in a more general way than classical rectangular windows...
Definition: Kernel.h:36
Interface Class for One Dimensional fitting in a weighted fashion.
Definition: OneDimensionalWeighted.h:41
const utility::Vector & y_predicted(void) const
const utility::Vector & x(void) const
void fit(const size_t step_size, const size_t nof_points)
const utility::Vector & y_err(void) const

Generated on Wed Jan 4 2017 02:23:07 for yat by  doxygen 1.8.5