Class CubicInterpolation
- java.lang.Object
-
- org.jquantlib.math.interpolations.AbstractInterpolation
-
- org.jquantlib.math.interpolations.CubicInterpolation
-
- All Implemented Interfaces:
- Extrapolator, Interpolation, Ops.DoubleOp
- Direct Known Subclasses:
- MonotonicNaturalCubicInterpolation, NaturalCubicInterpolation
public class CubicInterpolation extends AbstractInterpolation
Cubic interpolation between discrete points.Cubic interpolation is fully defined when the ${f_i}$ function values at points ${x_i}$ are supplemented with ${f_i}$ function derivative values.
Different type of first derivative approximations are implemented, both local and non-local. Local schemes (Fourth-order, Parabolic, Modified Parabolic, Fritsch-Butland, Akima, Kruger) use only $f$ values near $x_i$ to calculate $f_i$. Non-local schemes (Spline with different boundary conditions) use all ${f_i}$ values and obtain ${f_i}$ by solving a linear system of equations. Local schemes produce $C^1$ interpolants, while the spline scheme generates $C^2$ interpolants.
Hyman's monotonicity constraint filter is also implemented: it can be applied to all schemes to ensure that in the regions of local monotoniticity of the input (three successive increasing or decreasing values) the interpolating cubic remains monotonic. If the interpolating cubic is already monotonic, the Hyman filter leaves it unchanged preserving all its original features.
In the case of $C^2$ interpolants the Hyman filter ensures local monotonicity at the expense of the second derivative of the interpolant which will no longer be continuous in the points where the filter has been applied.
While some non-linear schemes (Modified Parabolic, Fritsch-Butland, Kruger) are guaranteed to be locally monotone in their original approximation, all other schemes must be filtered according to the Hyman criteria at the expense of their linearity.
See R. L. Dougherty, A. Edelman, and J. M. Hyman, "Nonnegativity-, Monotonicity-, or Convexity-Preserving CubicSpline and Quintic Hermite Interpolation" Mathematics Of Computation, v. 52, n. 186, April 1989, pp. 471-494.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classCubicInterpolation.BoundaryConditionstatic classCubicInterpolation.DerivativeApprox-
Nested classes/interfaces inherited from interface org.jquantlib.math.interpolations.Interpolation
Interpolation.Interpolator
-
-
Constructor Summary
Constructors Constructor and Description CubicInterpolation(Array vx, Array vy, CubicInterpolation.DerivativeApprox da, boolean monotonic, CubicInterpolation.BoundaryCondition leftCondition, double leftConditionValue, CubicInterpolation.BoundaryCondition rightCondition, double rightConditionValue)Constructor for a CubicSpline interpolation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ArrayaCoefficients()ArraybCoefficients()ArraycCoefficients()boolean[]monotonicityAdjustments()-
Methods inherited from class org.jquantlib.math.interpolations.AbstractInterpolation
allowsExtrapolation, derivative, derivative, disableExtrapolation, empty, enableExtrapolation, isInRange, op, op, primitive, primitive, secondDerivative, secondDerivative, update, xMax, xMin
-
-
-
-
Constructor Detail
-
CubicInterpolation
public CubicInterpolation(Array vx, Array vy, CubicInterpolation.DerivativeApprox da, boolean monotonic, CubicInterpolation.BoundaryCondition leftCondition, double leftConditionValue, CubicInterpolation.BoundaryCondition rightCondition, double rightConditionValue)
Constructor for a CubicSpline interpolation.Interpolations are not instantiated directly by applications, but via a factory class.
- See Also:
Cubic
-
-
DataMelt 3.0 © DataMelt by jWork.ORG