|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.functionfit.SmoothingCubicSpline
public class SmoothingCubicSpline
Represents a cubic spline with nodes at (xi, yi) computed with the smoothing cubic spline algorithm of Schoenberg. A smoothing cubic spline is made of n + 1 cubic polynomials. The ith polynomial of such a spline, for i = 1,…, n - 1, is defined as Si(x) while the complete spline is defined as
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
double |
derivative(double z)
Evaluates and returns the value of the first derivative of the spline at z. |
double |
derivative(double z,
int n)
Evaluates and returns the value of the n-th derivative of the spline at z. |
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(). |
double |
getRho()
Returns the smoothing factor used to construct the spline. |
Polynomial[] |
getSplinePolynomials()
Returns a table containing all fitting polynomials. |
double[] |
getWeights()
Returns the weights of the points. |
double[] |
getX()
Returns the xi coordinates for this spline. |
double[] |
getY()
Returns the yi coordinates for this spline. |
double |
integral(double a,
double b)
Evaluates and returns the value of the integral of the spline from a to b. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 parameter
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 parameter
IllegalArgumentException
- if x and y do
not have the same length, if rho has wrong value, or if the spline
cannot be calculated.Method Detail |
---|
public double evaluate(double z)
evaluate
in interface MathFunction
z
- argument of the spline.
public double integral(double a, double b)
integral
in interface MathFunctionWithIntegral
a
- lower limit of integral.b
- upper limit of integral.
public double derivative(double z)
derivative
in interface MathFunctionWithFirstDerivative
z
- argument of the spline.
public double derivative(double z, int n)
derivative
in interface MathFunctionWithDerivative
z
- argument of the spline.n
- order of the derivative.
public double[] getX()
public double[] getY()
public double[] getWeights()
public double getRho()
public Polynomial[] getSplinePolynomials()
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).
|
SSJ V. 2.6. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |