Public Member Functions | |
PolynomialFit (const std::string &nameIn, int order=1) | |
const std::string & | getName () const |
const std::vector< double > & | getCoeff () |
The coefficients are returned so that the first coefficient is the multiplier for x^(N-1). | |
double | getYForX (double x) |
bool | isValid () const |
enough points for a valid fit? | |
double | update (const std::vector< double > &x, const std::vector< double > &y) |
update with all points, and return rmserror on data | |
double | computeMonotonicFitError (const std::vector< double > &x, const std::vector< double > &y) |
update with all delta of points, and return rmserror on data. |
w2kmeans::PolynomialFit::PolynomialFit | ( | const std::string & | nameIn, | |
int | order = 1 | |||
) | [inline] |
double w2kmeans::PolynomialFit::computeMonotonicFitError | ( | const std::vector< double > & | x, | |
const std::vector< double > & | y | |||
) |
update with all delta of points, and return rmserror on data.
This is useful if your intent is to verify that the data are monotonic; the actual fit itself will be on the deltas, so you can not use the getYForX() to get an estimate of data.
const std::vector<double>& w2kmeans::PolynomialFit::getCoeff | ( | ) | [inline] |
The coefficients are returned so that the first coefficient is the multiplier for x^(N-1).
const std::string& w2kmeans::PolynomialFit::getName | ( | ) | const [inline] |
double w2kmeans::PolynomialFit::getYForX | ( | double | x | ) | [inline] |
bool w2kmeans::PolynomialFit::isValid | ( | ) | const [inline] |
enough points for a valid fit?
double w2kmeans::PolynomialFit::update | ( | const std::vector< double > & | x, | |
const std::vector< double > & | y | |||
) |
update with all points, and return rmserror on data