Package org.hipparchus.fitting.ransac
Class PolynomialModelFitter.Model
java.lang.Object
org.hipparchus.fitting.ransac.PolynomialModelFitter.Model
- Enclosing class:
PolynomialModelFitter
Class representing the polynomial model to fit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Get the coefficients of the polynomial model.doublepredict(double x) Predicts the model value for the input point.
-
Constructor Details
-
Model
public Model(double[] coefficients) Constructor.- Parameters:
coefficients- coefficients of the polynomial model
-
-
Method Details
-
predict
public double predict(double x) Predicts the model value for the input point.- Parameters:
x- point- Returns:
- the model value for the given point
-
getCoefficients
public double[] getCoefficients()Get the coefficients of the polynomial model.The coefficients are sort by degree. For instance, for a quadratic equation the coefficients are as followed:
y = coefficients[2] * x * x + coefficients[1] * x + coefficients[0]- Returns:
- the coefficients of the polynomial model
-