Class CsSmoothC2
- All Implemented Interfaces:
Serializable,Cloneable
Class CsSmoothC2 is designed to produce a \(C^2\)
cubic spline approximation to a data set in which the function values are
noisy. This spline is called a smoothing spline. It is a natural cubic
spline with knots at all the data abscissas x, but it
does not interpolate the data \((x_i, f_i)\). The smoothing spline
\(S_\sigma\) is the unique \(C^2\) function
that minimizes
$$\int\limits_a^b {s''_\sigma \left( x
\right)^2 dx}$$
subject to the constraint
$$\sum\limits_{i=0}^{n-1} {\left| {s_\sigma \left( {x_i } \right) - f_i } \right|} ^2 \le \sigma$$.
Recommended values for \(\sigma\) depend on the weights, w.
If an estimate for the standard deviation of the error in the y-values
is availiable, then \(w_i\) should be set to this value and
the smoothing parameter should be choosen in the confidence interval corresponding
to the left side of the above inequality. That is,
$$n-\sqrt{2n} \le \sigma \le n+\sqrt{2n}\)
CsSmoothC2 is based on an algorithm of Reinsch (1967).
This algorithm is also discussed in de Boor (1978, pages 235-243).
- See Also:
-
Field Summary
Fields inherited from class com.imsl.math.Spline
breakPoint, coef, EPSILON_LARGE -
Constructor Summary
ConstructorsConstructorDescriptionCsSmoothC2(double[] xData, double[] yData, double sigma) Constructs a smooth cubic spline from noisy data using an algorithm based on Reinsch (1967).CsSmoothC2(double[] xData, double[] yData, double[] weight, double sigma) Constructs a smooth cubic spline from noisy data using an algorithm based on Reinsch (1967) with weights supplied by the user. -
Method Summary
Methods inherited from class com.imsl.math.Spline
copyAndSortData, copyAndSortData, derivative, derivative, derivative, getBreakpoints, integral, value, value
-
Constructor Details
-
CsSmoothC2
public CsSmoothC2(double[] xData, double[] yData, double sigma) Constructs a smooth cubic spline from noisy data using an algorithm based on Reinsch (1967). All of the points have equal weights.- Parameters:
xData- Adoublearray containing the x-coordinates of the data. Values must be distinct.yData- Adoublearray containing the y-coordinates of the data. The arrays xData and yData must have the same length.sigma- Adoublevalue specifying the smoothing parameter. Sigma must not be negative.
-
CsSmoothC2
public CsSmoothC2(double[] xData, double[] yData, double[] weight, double sigma) Constructs a smooth cubic spline from noisy data using an algorithm based on Reinsch (1967) with weights supplied by the user.- Parameters:
xData- Adoublearray containing the x-coordinates of the data. Values must be distinct.yData- Adoublearray containing the y-coordinates of the data. The arrays xData and yData must have the same length.weight- Adoublearray containing the weights. The arrays xData and weight must have the same length.sigma- Adoublevalue specifying the smoothing parameter. Sigma must not be negative.
-