![]() |
sablib
|
Polynomial fitting using the least squares method (Gauss-Newton for linear models). More...
#include <stdexcept>#include <Eigen/Eigen>Go to the source code of this file.
Functions | |
| template<typename Derived> | |
| const Derived::PlainObject | sablib::PolyFit (const Eigen::MatrixBase< Derived > &x, const Eigen::MatrixBase< Derived > &y, const unsigned int polyorder) |
| Fits a polynomial of a specified order to the given data points. | |
Polynomial fitting using the least squares method (Gauss-Newton for linear models).
Definition in file polyfit.h.
| const Derived::PlainObject sablib::PolyFit | ( | const Eigen::MatrixBase< Derived > & | x, |
| const Eigen::MatrixBase< Derived > & | y, | ||
| const unsigned int | polyorder ) |
Fits a polynomial of a specified order to the given data points.
This function uses the normal equations, which is the Gauss-Newton method applied to a linear model.
| Derived | The derived type of the Eigen object. |
| x | The x-coordinates of the data points. |
| y | The y-coordinates of the data points. |
| polyorder | The order of the polynomial to fit. |
| std::invalid_argument | Thrown if x and y sizes differ or if polyorder is too high. |