|
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.LineFitter
public class LineFitter
Uses Ordinary Least Squares regression to fit a line to a data set
Method Summary | |
---|---|
AnnotatedChartModel |
createModel(Polynomial line,
Range<?> xRange,
int numPoints)
Creates a ChartModel for describing a line from a Polynomial instance. |
AnnotatedChartModel |
createModel(String name,
Polynomial polynomial,
Double[] xs)
Creates a model for describing the given polynomial by generating points along the curve. |
AnnotatedChartModel |
createModel(String name,
Polynomial line,
Range<?> xRange,
int numPoints)
Creates a ChartModel for describing a line from a Polynomial instance. |
static LineFitter |
getInstance()
Creates and returns an instance of this class if one does not already exist; otherwise simply return the instance that already exists. |
Polynomial |
performRegression(ChartModel model)
Performs linear regression on a ChartModel and returns a Line |
Polynomial |
performRegression(Collection<? extends Point2D> points)
Performs linear regression on a collection of points and returns a Polynomial |
AnnotatedChartModel |
performRegression(String name,
ChartModel model,
Range<?> xRange,
int numPoints)
Performs linear regression on a ChartModel and returns a ChartModel that encodes the line |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static LineFitter getInstance()
public AnnotatedChartModel performRegression(String name, ChartModel model, Range<?> xRange, int numPoints)
ChartModel
that encodes the line
performRegression
in interface CurveFitter
model
- the ChartModel to approximate with a line
public AnnotatedChartModel createModel(Polynomial line, Range<?> xRange, int numPoints)
Creates a ChartModel for describing a line from a Polynomial instance. The model will be assigned a default name.
Note: the Polynomial is expected to be a line but the method does not check this assumption.
createModel
in interface CurveFitter
line
- the line that the new model should describexRange
- the range over which the line segment should be givennumPoints
- ignored for linear modelspublic AnnotatedChartModel createModel(String name, Polynomial line, Range<?> xRange, int numPoints)
Creates a ChartModel for describing a line from a Polynomial instance.
Note: the Polynomial is expected to be a line but the method does not check this assumption.
createModel
in interface CurveFitter
name
- the name of the new modelline
- the line that the new model should describexRange
- the range over which the line segment should be givennumPoints
- ignored for linear models
public AnnotatedChartModel createModel(String name, Polynomial polynomial, Double[] xs)
name
- the name of the model to createpolynomial
- the polynomial describing the curvexs
- the x points for which values of y should be calculated
public Polynomial performRegression(ChartModel model)
Line
performRegression
in interface CurveFitter
model
- the ChartModel on which to perform linear regression
public Polynomial performRegression(Collection<? extends Point2D> points)
points
- the points
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |