Template Function mrpt::math::leastSquareLinearFit(const NUMTYPE, const VECTORLIKE&, const VECTORLIKE&, bool)

Function Documentation

template<typename NUMTYPE, class VECTORLIKE, int NUM_POINTS = -1>
NUMTYPE mrpt::math::leastSquareLinearFit(const NUMTYPE t, const VECTORLIKE &x, const VECTORLIKE &y, bool wrap2pi = false)

Interpolates or extrapolates using a least-square linear fit of the set of values “x” and “y”, evaluated at a single point “t”. The vectors x and y must have size >=2, and all values of “x” must be different. If wrap2pi is true, output “y” values are wrapped to ]-pi,pi] (It is assumed that input “y” values already are in the correct range).

See also

spline

See also

getRegressionLine, getRegressionPlane

Note

Implementation in #include <mrpt/math/interp_fit.hpp>