34 #if defined(OrderedLinearRegression_RECURSES) 35 #error Recursive header files inclusion detected in OrderedLinearRegression.h 36 #else // defined(OrderedLinearRegression_RECURSES) 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 =
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 =
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;
305 #endif // !defined OrderedLinearRegression_h 307 #undef OrderedLinearRegression_RECURSES 308 #endif // else defined(OrderedLinearRegression_RECURSES) OrderedLinearRegression(double eps_zero=1e-8)
~OrderedLinearRegression()
void selfDisplay(std::ostream &that_stream) const
std::vector< double > myY
Ordinate values of sample points.
Description of class 'SimpleLinearRegression'.
Description of class 'OrderedLinearRegression'.
void forwardSLR(SimpleLinearRegression &linearModel, const unsigned int n=4, const double alpha=0.01) const
double myEpsilonZero
Epsilon zero value.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
OrderedLinearRegression & operator=(const OrderedLinearRegression &other)
void addSample(const double x, const double y)
DGtal is the top-level namespace which contains all DGtal functions and types.
void addSample(const double x, const double y)
std::pair< double, double > trustIntervalForY(const double x, const double a) const
unsigned int myN
Number of samples.
void addSamples(XIterator begin_x, XIterator end_x, YIterator begin_y)
void addSamples(XIterator begin_x, XIterator end_x, YIterator begin_y)
std::vector< double > myX
Abscissa values of sample points.
void backwardSLR(SimpleLinearRegression &linearModel, const unsigned int n=4, const double alpha=0.01) const
void setEpsilonZero(const double aEpsilonZero)