Class LocalControlStretchBuilder

java.lang.Object
org.drip.spline.pchip.LocalControlStretchBuilder

public class LocalControlStretchBuilder
extends java.lang.Object
LocalControlStretchBuilder exports Stretch creation/calibration methods to generate customized basis splines, with customized segment behavior using the segment control. It provides the following local-control functionality:
  • Create a Stretch off of Hermite Splines from the specified the Predictor Ordinates, the Response Values, the Custom Slopes, and the Segment Builder Parameters
  • Create Hermite/Bessel C1 Cubic Spline Stretch
  • Create Hyman (1983) Monotone Preserving Stretch
  • Create Hyman (1989) enhancement to the Hyman (1983) Monotone Preserving Stretch
  • Create the Harmonic Monotone Preserving Stretch
  • Create the van Leer Limiter Stretch
  • Create the Kruger Stretch
  • Create the Huynh Le Floch Limiter Stretch
  • Generate the local control C1 Slope using the Akima Cubic Algorithm
  • Generate the local control C1 Slope using the Hagan-West Monotone Convex Algorithm

Module Product Core Module
Library Fixed Income Analytics
Project Basis Splines and Linear Compounders across a Broad Family of Spline Basis Functions
Package Monotone Convex Themed PCHIP Splines

Author:
Lakshmi Krishnamurthy
  • Constructor Details

    • LocalControlStretchBuilder

      public LocalControlStretchBuilder()
  • Method Details

    • CustomSlopeHermiteSpline

      public static final MultiSegmentSequence CustomSlopeHermiteSpline​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, double[] customSlopeArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode)
      Create a Stretch off of Hermite Splines from the specified the Predictor Ordinates, the Response Values, the Custom Slopes, and the Segment Builder Parameters.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      customSlopeArray - Array of Custom Slopes
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Calibration Set up Mode NATURAL | FINANCIAL | FLOATING | NOTAKNOT
      Returns:
      The Instance of the Hermite Spline Stretch
    • CustomSlopeHermiteSpline

      public static final MultiSegmentSequence CustomSlopeHermiteSpline​(java.lang.String name, int[] predictorOrdinateArray, double[] responseValueArray, double[] customSlopeArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode)
      Create a Stretch off of Hermite Splines from the specified the Predictor Ordinates, the Response Values, the Custom Slopes, and the Segment Builder Parameters.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      customSlopeArray - Array of Custom Slopes
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Calibration Set up Mode NATURAL | FINANCIAL | FLOATING | NOTAKNOT
      Returns:
      The Instance of the Hermite Spline Stretch
    • CreateBesselCubicSplineStretch

      public static final MultiSegmentSequence CreateBesselCubicSplineStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create Hermite/Bessel C1 Cubic Spline Stretch
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      Hermite/Bessel C1 Cubic Spline Stretch
    • CreateHyman83MonotoneStretch

      public static final MultiSegmentSequence CreateHyman83MonotoneStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create Hyman (1983) Monotone Preserving Stretch. The reference is: Hyman (1983) Accurate Monotonicity Preserving Cubic Interpolation - SIAM J on Numerical Analysis 4 (4), 645-654.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      Hyman (1983) Monotone Preserving Stretch
    • CreateHyman89MonotoneStretch

      public static final MultiSegmentSequence CreateHyman89MonotoneStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create Hyman (1989) enhancement to the Hyman (1983) Monotone Preserving Stretch. The reference is: Doherty, Edelman, and Hyman (1989) Non-negative, monotonic, or convexity preserving cubic and quintic Hermite interpolation - Mathematics of Computation 52 (186), 471-494.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      Hyman (1989) Monotone Preserving Stretch
    • CreateHarmonicMonotoneStretch

      public static final MultiSegmentSequence CreateHarmonicMonotoneStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create the Harmonic Monotone Preserving Stretch. The reference is: Fritcsh and Butland (1984) A Method for constructing local monotonic piece-wise cubic interpolants - SIAM J on Scientific and Statistical Computing 5, 300-304.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      Harmonic Monotone Preserving Stretch
    • CreateVanLeerLimiterStretch

      public static final MultiSegmentSequence CreateVanLeerLimiterStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create the Van Leer Limiter Stretch. The reference is: Van Leer (1974) Towards the Ultimate Conservative Difference Scheme. II - Monotonicity and Conservation combined in a Second-Order Scheme, Journal of Computational Physics 14 (4), 361-370.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      The Van Leer Limiter Stretch
    • CreateKrugerStretch

      public static final MultiSegmentSequence CreateKrugerStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create the Kruger Stretch. The reference is: Kruger (2002) Constrained Cubic Spline Interpolations for Chemical Engineering Application, http://www.korf.co.uk/spline.pdf
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      The Kruger Stretch
    • CreateHuynhLeFlochLimiterStretch

      public static final MultiSegmentSequence CreateHuynhLeFlochLimiterStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Create the Huynh Le Floch Limiter Stretch. The reference is: Huynh (1993) Accurate Monotone Cubic Interpolation, SIAM J on Numerical Analysis 30 (1), 57-100.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      The Huynh Le Floch Limiter Stretch
    • CreateAkimaStretch

      public static final MultiSegmentSequence CreateAkimaStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] responseValueArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Generate the local control C1 Slope using the Akima Cubic Algorithm. The reference is: Akima (1970): A New Method of Interpolation and Smooth Curve Fitting based on Local Procedures, Journal of the Association for the Computing Machinery 17 (4), 589-602.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      The Akima Local Control Stretch Instance
    • CreateMonotoneConvexStretch

      public static final MultiSegmentSequence CreateMonotoneConvexStretch​(java.lang.String name, double[] predictorOrdinateArray, double[] observationArray, SegmentCustomBuilderControl[] segmentCustomBuilderControlArray, StretchBestFitResponse stretchBestFitResponse, int setupMode, boolean linearNodeInference, boolean eliminateSpuriousExtrema, boolean applyMonotoneFilter)
      Generate the local control C1 Slope using the Hagan-West Monotone Convex Algorithm. The references are: Hagan, P., and G. West (2006): Interpolation Methods for Curve Construction, Applied Mathematical Finance 13 (2): 89-129. Hagan, P., and G. West (2008): Methods for Curve a Yield Curve, Wilmott Magazine: 70-81.
      Parameters:
      name - Stretch Name
      predictorOrdinateArray - Array of Predictor Ordinates
      observationArray - Array of Observations
      segmentCustomBuilderControlArray - Array of Segment Builder Parameters
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Segment Setup Mode
      linearNodeInference - Apply Linear Node Inference from Observations
      eliminateSpuriousExtrema - TRUE - Eliminate Spurious Extrema
      applyMonotoneFilter - TRUE - Apply Monotone Filter
      Returns:
      The Monotone-Convex Local Control Stretch Instance