1 #ifndef _theplu_yat_statistics_smoother_
2 #define _theplu_yat_statistics_smoother_
27 #include "yat/utility/iterator_traits.h"
29 #include <boost/concept_check.hpp>
35 namespace regression {
38 namespace statistics {
55 const std::vector<double>& values);
68 double xmin,
double xmax,
size_t n);
73 void add(
double x,
double weight=1.0);
78 const std::vector<double>&
density(
void)
const;
95 const std::vector<double>&
value(
void)
const;
98 std::vector<double> density_;
101 std::vector<double> x_;
109 template<
typename ForwardIterator>
111 ForwardIterator first, ForwardIterator last)
113 BOOST_CONCEPT_ASSERT((boost::ForwardIterator<ForwardIterator>));
115 while (first!=last) {
126 std::ostream& operator<<(std::ostream& s,
const Smoother&);
Smoother(const regression::Kernel &, double width, const std::vector< double > &values)
data_reference data(Iter iter) const
Definition: iterator_traits.h:440
Definition: iterator_traits.h:412
void rescale(double factor)
const std::vector< double > & density(void) const
estimated values
Estimating a distribution in a smooth fashion.
Definition: Smoother.h:45
void add(Smoother &h, ForwardIterator first, ForwardIterator last)
Definition: Smoother.h:110
Interface Class for calculating the weights in a more general way than classical rectangular windows...
Definition: Kernel.h:36
weight_reference weight(Iter iter) const
Definition: iterator_traits.h:446
void reset(void)
reset density to zero
const std::vector< double > & value(void) const
values in which distribution is estimated
void add(double x, double weight=1.0)
Add a data point.