|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.fit.PolynomialFitter
public class PolynomialFitter
A class for fitting a polynomial to a set of data provided as a ChartModel. The order of the polynomial to be fitted is given as a parameter to the constructor.
Constructor Summary | |
---|---|
PolynomialFitter(int n)
Create a class that can derive a best-fit polynomial of order n for a ChartModel. |
Method Summary | |
---|---|
AnnotatedChartModel |
createModel(Polynomial polynomial,
Range<?> xRange,
int numPoints)
Create a ChartModel by sampling from the supplied polynomial. |
AnnotatedChartModel |
createModel(String name,
Polynomial polynomial,
Double[] xs)
Create a ChartModel by sampling from the supplied polynomial. |
AnnotatedChartModel |
createModel(String name,
Polynomial polynomial,
Range<?> xRange,
int numPoints)
Create a named ChartModel by sampling from the supplied polynomial. |
Polynomial |
performRegression(ChartModel model)
Start by creating a RealMatrix to store the coefficients double[][] coefficientsData = {{2, 3, -2}, {-1, 7, 6}, {4, -3, -5}}; RealMatrix coefficients = new RealMatrixImpl(coefficientsData); Next create a double[] array to represent the constant vector and use solve(double[]) to solve the system double[] constants = {1, -2, 1}; double[] solution = coefficients.solve(constants); |
Polynomial |
performRegression(List<? extends Point2D> points)
Not supported |
AnnotatedChartModel |
performRegression(String name,
ChartModel model,
Range<?> xRange,
int numPoints)
Start by creating a RealMatrix to store the coefficients double[][] coefficientsData = {{2, 3, -2}, {-1, 7, 6}, {4, -3, -5}}; RealMatrix coefficients = new RealMatrixImpl(coefficientsData); Next create a double[] array to represent the constant vector and use solve(double[]) to solve the system double[] constants = {1, -2, 1}; double[] solution = coefficients.solve(constants); |
void |
setOrder(int n)
Specify the order of the polynomial to create when performing regression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolynomialFitter(int n)
n
- the order of the polynomialMethod Detail |
---|
public void setOrder(int n)
n
- the order of polynomials to createpublic Polynomial performRegression(ChartModel model)
performRegression
in interface CurveFitter
model
- the chart model on which to perform the regression
public AnnotatedChartModel performRegression(String name, ChartModel model, Range<?> xRange, int numPoints)
performRegression
in interface CurveFitter
model
- the chart model on which to perform the regression
numPoints
points, and representing the result of the regression.public AnnotatedChartModel createModel(Polynomial polynomial, Range<?> xRange, int numPoints)
numPoints
points, distributed evenly over xRange
createModel
in interface CurveFitter
public AnnotatedChartModel createModel(String name, Polynomial polynomial, Range<?> xRange, int numPoints)
numPoints
points, distributed evenly over xRange
.
createModel
in interface CurveFitter
public AnnotatedChartModel createModel(String name, Polynomial polynomial, Double[] xs)
xs
array.
public Polynomial performRegression(List<? extends Point2D> points)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |