public final class SmoothingCubicSpline
extends java.lang.Object
The spline is computed with a smoothing parameter ρ∈[0, 1] which represents its accuracy with respect to the initial (xi, yi) nodes. The smoothing spline minimizes
Constructor and Description |
---|
SmoothingCubicSpline(double[] x,
double[] y,
double rho)
Constructs a spline with nodes at (xi, yi), with
weights = 1 and smoothing factor ρ =
rho.
|
SmoothingCubicSpline(double[] x,
double[] y,
double[] w,
double rho)
Constructs a spline with nodes at (xi, yi), with
weights wi and smoothing factor ρ = rho.
|
Modifier and Type | Method and Description |
---|---|
double |
evaluate(double z)
Evaluates and returns the value of the spline at z.
|
int |
getFitPolynomialIndex(double x)
Returns the index of P, the
Polynomial instance used to evaluate x, in an ArrayList table instance returned by
getSplinePolynomials(). |
public SmoothingCubicSpline(double[] x, double[] y, double[] w, double rho)
x
- the xi coordinates.y
- the yi coordinates.w
- the weight for each point, must be > 0.rho
- the smoothing parameterjava.lang.IllegalArgumentException
- if x, y and z do not have the same length, if rho
has wrong value, or if the spline cannot be calculated.public SmoothingCubicSpline(double[] x, double[] y, double rho)
x
- the xi coordinates.y
- the yi coordinates.rho
- the smoothing parameterjava.lang.IllegalArgumentException
- if x and y do not have the same length, if rho has wrong
value, or if the spline cannot be calculated.public double evaluate(double z)
z
- argument of the spline.public int getFitPolynomialIndex(double x)
Polynomial
instance used to evaluate x, in an ArrayList table instance returned by
getSplinePolynomials(). This index k gives also the interval in table
X which contains the value x (i.e. such that xk < x <= xk+1).