public class LeastSquares extends Object implements CurveFitting
Modifier and Type | Class and Description |
---|---|
static interface |
LeastSquares.Weighting
This interface defines a weighting for observations.
|
Modifier and Type | Field and Description |
---|---|
static LeastSquares.Weighting |
UNIFORM_WEIGHTING
A uniform weighting.
|
Constructor and Description |
---|
LeastSquares(int m)
Construct a new instance of this algorithm, which uses uniform weighting for the
observations.
|
LeastSquares(int m,
LeastSquares.Weighting weighting)
Construct a new instance of this algorithm, which will use a weighted sum of orthogonal
polynomials up to order n (the number of points).
|
Modifier and Type | Method and Description |
---|---|
UnivariateRealFunction |
fit(OrderedPairs f)
Fit a real valued function from a discrete set of data points.
|
public static final LeastSquares.Weighting UNIFORM_WEIGHTING
public LeastSquares(int m, LeastSquares.Weighting weighting)
m
- the maximum degree of the orthogonal polynomials (m ≤ n)weighting
- the function used to determine the weight for each observationpublic LeastSquares(int m)
m
- the maximum order of the orthogonal polynomialspublic UnivariateRealFunction fit(OrderedPairs f)
CurveFitting
fit
in interface CurveFitting
f
- a discrete set of data pointsCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.