Package smile.interpolation
Class CubicSplineInterpolation1D
java.lang.Object
smile.interpolation.AbstractInterpolation
smile.interpolation.CubicSplineInterpolation1D
- All Implemented Interfaces:
Serializable
,Interpolation
Cubic spline interpolation. Spline interpolation uses low-degree polynomials
in each of the intervals, and chooses the polynomial pieces such that they
fit smoothly together. The resulting function is called a spline.
The natural cubic spline is piecewise cubic and twice continuously differentiable. Furthermore, its second derivative is zero at the end points.
Like polynomial interpolation, spline interpolation incurs a smaller error than linear interpolation and the interpolant is smoother. However, the interpolant is easier to evaluate than the high-degree polynomials used in polynomial interpolation. It also does not suffer from Runge's phenomenon.
- See Also:
-
Constructor Summary
-
Method Summary
Methods inherited from class smile.interpolation.AbstractInterpolation
interpolate, search
-
Constructor Details
-
CubicSplineInterpolation1D
public CubicSplineInterpolation1D(double[] x, double[] y) Constructor.- Parameters:
x
- the tabulated points.y
- the function values atx
.
-
-
Method Details
-
rawinterp
public double rawinterp(int j, double x) Description copied from class:AbstractInterpolation
Subclasses provide this as the actual interpolation method.- Specified by:
rawinterp
in classAbstractInterpolation
- Parameters:
j
- the value jlo is such that x is (insofar as possible) centered in the subrange xx[j..j+m-1], where xx is the stored data.x
- interpolate at this value- Returns:
- the raw interpolated value.
-
toString
-