## Cubic

Subtype of Interp MethodThe reference quantity is interpolated according to the QuantLib Cubic method.

If the latter object is omitted, the default Interp#1 is assumed.

Cubic interpolation is fully defined when the function values

**at points**

*v₁, v₂, ..., vₙ***are supplemented with function derivative values**

*x₁, x₂, ..., xₙ***.**

*d₁, d₂, ..., dₙ*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 function values near the given points to calculate each derivative value.

Non-local schemes (Spline with different boundary conditions) use all function values and obtain the derivative values

**by solving a linear system of equations.**

*d₁, d₂, ..., dₙ*Local schemes produce interpolants with continuous first derivative function, while the spline schemes generate interpolants with continuous second derivative function.

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 interpolants with continuous second derivative function 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 monotonic 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.

This method supports several specifications optionally supplied through an object of type Interpolation

If the latter object is omitted, the default Interp#2 is assumed.