34#if defined(OrderedLinearRegression_RECURSES)
35#error Recursive header files inclusion detected in OrderedLinearRegression.h
38#define OrderedLinearRegression_RECURSES
40#if !defined OrderedLinearRegression_h
42#define OrderedLinearRegression_h
48#include "DGtal/math/SimpleLinearRegression.h"
110 template <
class XIterator,
class YIterator>
111 void addSamples( XIterator begin_x, XIterator end_x, YIterator begin_y )
113 for ( ; begin_x != end_x; ++begin_x, ++begin_y )
158 const unsigned int n = 4,
159 const double alpha = 0.01)
const
163 std::vector<double>::const_iterator itx =
myX.begin();
164 std::vector<double>::const_iterator itxe =
myX.end();
165 std::vector<double>::const_iterator ity =
myY.begin();
170 unsigned int l = (
unsigned int)
myX.size() - n + 1;
171 for ( ; itx != itxe; ++itx, ++ity, --l )
173 std::pair<double,double> ic;
175 if ( ( *ity < ic.first ) || ( *ity > ic.second ) )
201 const unsigned int n = 4,
202 const double alpha = 0.01 )
const
206 std::vector<double>::const_reverse_iterator itx =
myX.rbegin();
207 std::vector<double>::const_reverse_iterator itxe =
myX.rend();
208 std::vector<double>::const_reverse_iterator ity =
myY.rbegin();
213 unsigned int l =
static_cast<unsigned int>(
myX.size()) - n + 1;
214 for ( ; itx != itxe; ++itx, ++ity, --l )
216 std::pair<double,double> ic;
218 if ( ( *ity < ic.first ) || ( *ity > ic.second ) )
234 that_stream <<
"[OrderedLinearRegression] Number of samples="<<
myN;
307#undef OrderedLinearRegression_RECURSES
Description of class 'OrderedLinearRegression'.
std::vector< double > myX
Abscissa values of sample points.
double myEpsilonZero
Epsilon zero value.
void backwardSLR(SimpleLinearRegression &linearModel, const unsigned int n=4, const double alpha=0.01) const
void selfDisplay(std::ostream &that_stream) const
std::vector< double > myY
Ordinate values of sample points.
void addSample(const double x, const double y)
~OrderedLinearRegression()
unsigned int myN
Number of samples.
OrderedLinearRegression(double eps_zero=1e-8)
OrderedLinearRegression & operator=(const OrderedLinearRegression &other)
void addSamples(XIterator begin_x, XIterator end_x, YIterator begin_y)
OrderedLinearRegression(const OrderedLinearRegression &other)
void forwardSLR(SimpleLinearRegression &linearModel, const unsigned int n=4, const double alpha=0.01) const
Description of class 'SimpleLinearRegression'.
void addSample(const double x, const double y)
void addSamples(XIterator begin_x, XIterator end_x, YIterator begin_y)
std::pair< double, double > trustIntervalForY(const double x, const double a) const
void setEpsilonZero(const double aEpsilonZero)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)