public class PolynomialCurveFitter extends java.lang.Object implements CurveFitter
A least-squares polynomial CurveFitter.
See http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html
TODO: write proper testsConstructor and Description |
---|
PolynomialCurveFitter(int order) |
Modifier and Type | Method and Description |
---|---|
CurveFitter |
clone() |
Function |
fit(float[] x,
float[] y) |
int |
getOrder() |
public PolynomialCurveFitter(int order)
order
- Order of polynomials used to approximate example pointspublic Function fit(float[] x, float[] y)
fit
in interface CurveFitter
x
- Example x pointsy
- Example y points (must be same length as x)CurveFitter.fit(float[], float[])
public int getOrder()
public CurveFitter clone() throws java.lang.CloneNotSupportedException
clone
in interface CurveFitter
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- is clone can't be made