Interface MultiSegmentSequence

All Superinterfaces:
SingleSegmentSequence
All Known Implementing Classes:
CalibratableMultiSegmentSequence, CurveStretch

public interface MultiSegmentSequence
extends SingleSegmentSequence
MultiSegmentSequence is the interface that exposes functionality that spans multiple segments. Its derived instances hold the ordered segment sequence, the segment control parameters, and, if available, the spanning Jacobian. MultiSegmentSequence exports the following group of functionality:
  • CALIBRATE
  • CALIBRATE_JACOBIAN
  • Retrieve the Stretch Name
  • Retrieve the Segment Builder Parameters
  • Set up (i.e., calibrate) the individual Segment in the Stretch to the Target Segment Edge Values and Constraints. This is also called the Hermite setup - where the segment boundaries are entirely locally set
  • Set the Slope at the left Edge of the Stretch
  • Calculate the SegmentPredictorResponseDerivative at the specified Predictor Ordinate
  • Calculate the Derivative of the requested order at the Left Edge of the Stretch
  • Calculate the Derivative of the requested order at the Right Edge of the Stretch
  • Check if the Predictor Ordinate is in the Stretch Range
  • Return the Index for the Segment containing specified Predictor Ordinate
  • Set up (i.e., calibrate) the individual Segments in the Stretch to the Stretch Edge, the Target Constraints, and the custom segment sequence builder
  • Set up (i.e., calibrate) the individual Segments in the Stretch to the Stretch Left Edge and the Target Constraints
  • Set up (i.e., calibrate) the individual Segments in the Stretch to the Stretch Left Edge Response and the Target Constraints
  • Generate a new Stretch by clipping all the Segments to the Left of the specified Predictor Ordinate. Smoothness Constraints will be maintained
  • Generate a new Stretch by clipping all the Segments to the Right of the specified Predictor Ordinate. Smoothness Constraints will be maintained
  • Retrieve the Span Curvature DPE
  • Retrieve the Span Length DPE
  • Retrieve the Stretch Best Fit DPE
  • Retrieve the Merge Stretch Manager if it exists
  • Display the Segments

Module Product Core Module
Library Fixed Income Analytics
Project Basis Splines and Linear Compounders across a Broad Family of Spline Basis Functions
Package Multi-Segment Sequence Spline Stretch

Author:
Lakshmi Krishnamurthy
  • Field Details

    • CALIBRATE

      static final int CALIBRATE
      Calibration Detail: Calibrate the Stretch as part of the set up
      See Also:
      Constant Field Values
    • CALIBRATE_JACOBIAN

      static final int CALIBRATE_JACOBIAN
      Calibration Detail: Calibrate the Stretch AND compute Jacobian as part of the set up
      See Also:
      Constant Field Values
  • Method Details

    • name

      java.lang.String name()
      Retrieve the Stretch Name
      Returns:
      The Stretch Name
    • segmentBuilderControl

      SegmentCustomBuilderControl[] segmentBuilderControl()
      Retrieve the Segment Builder Parameters
      Returns:
      The Segment Builder Parameters
    • segments

      Retrieve the Stretch Segments
      Returns:
      The Stretch Segments
    • setupHermite

      boolean setupHermite​(SegmentPredictorResponseDerivative[] leftSegmentPredictorResponseDerivativeArray, SegmentPredictorResponseDerivative[] rightSegmentPredictorResponseDerivativeArray, SegmentResponseValueConstraint[][] segmentResponseValueConstraintGrid, StretchBestFitResponse stretchBestFitResponse, int setupMode)
      Set up (i.e., calibrate) the individual Segment in the Stretch to the Target Segment Edge Values and Constraints. This is also called the Hermite setup - where the segment boundaries are entirely locally set.
      Parameters:
      leftSegmentPredictorResponseDerivativeArray - Array of Left Segment Edge Values
      rightSegmentPredictorResponseDerivativeArray - Array of Right Segment Edge Values
      segmentResponseValueConstraintGrid - Double Array of Constraints - Outer Index corresponds to Segment Index, and the Inner Index to Constraint Array within each Segment
      stretchBestFitResponse - Stretch Fitness Weighted Response
      setupMode - Set up Mode (i.e., set up ITEP only, or fully calibrate the Stretch, or calibrate Stretch plus compute Jacobian)
      Returns:
      TRUE - Set up was successful
    • setLeftNode

      boolean setLeftNode​(double stretchLeftResponse, double stretchLeftResponseSlope, double stretchRightResponse, StretchBestFitResponse stretchBestFitResponse)
      Set the Slope at the left Edge of the Stretch
      Parameters:
      stretchLeftResponse - Response Value at the Left Edge of the Stretch
      stretchLeftResponseSlope - Response Slope Value at the Left Edge of the Stretch
      stretchRightResponse - Response Value at the Right Edge of the Stretch
      stretchBestFitResponse - Stretch Fitness Weighted Response
      Returns:
      TRUE - Left slope successfully set
    • calcSPRD

      SegmentPredictorResponseDerivative calcSPRD​(double predictorOrdinate)
      Calculate the SegmentPredictorResponseDerivative at the specified Predictor Ordinate
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      Returns:
      The Computed SegmentPredictorResponseDerivative
    • calcLeftEdgeDerivative

      double calcLeftEdgeDerivative​(int order) throws java.lang.Exception
      Calculate the Derivative of the requested order at the Left Edge of the Stretch
      Parameters:
      order - Order of the Derivative
      Returns:
      The Derivative of the requested order at the Left Edge of the Stretch
      Throws:
      java.lang.Exception - Thrown if the Derivative cannot be calculated
    • calcRightEdgeDerivative

      double calcRightEdgeDerivative​(int order) throws java.lang.Exception
      Calculate the Derivative of the requested order at the right Edge of the Stretch
      Parameters:
      order - Order of the Derivative
      Returns:
      The Derivative of the requested order at the right Edge of the Stretch
      Throws:
      java.lang.Exception - Thrown if the Derivative cannot be calculated
    • in

      boolean in​(double predictorOrdinate) throws java.lang.Exception
      Check if the Predictor Ordinate is in the Stretch Range
      Parameters:
      predictorOrdinate - Predictor Ordinate
      Returns:
      TRUE - Predictor Ordinate is in the Range
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • containingIndex

      int containingIndex​(double predictorOrdinate, boolean includeLeft, boolean includeRight) throws java.lang.Exception
      Return the Index for the Segment containing specified Predictor Ordinate
      Parameters:
      predictorOrdinate - Predictor Ordinate
      includeLeft - TRUE - Less than or equal to the Left Predictor Ordinate
      includeRight - TRUE - Less than or equal to the Right Predictor Ordinate
      Returns:
      Index for the Segment containing specified Predictor Ordinate
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • setup

      boolean setup​(SegmentSequenceBuilder segmentSequenceBuilder, int calibrationDetail)
      Set up (i.e., calibrate) the individual Segments in the Stretch to the Stretch Edge, the Target Constraints, and the custom segment sequence builder.
      Parameters:
      segmentSequenceBuilder - The Segment Sequence Builder Instance
      calibrationDetail - The Calibration Detail
      Returns:
      TRUE - Set up was successful
    • setup

      boolean setup​(SegmentResponseValueConstraint leadingSegmentResponseValueConstraint, SegmentResponseValueConstraint[] segmentResponseValueConstraintArray, StretchBestFitResponse stretchBestFitResponse, BoundarySettings boundarySettings, int calibrationDetail)
      Set up (i.e., calibrate) the individual Segments in the Stretch to the Stretch Left Edge and the Target Constraints.
      Parameters:
      leadingSegmentResponseValueConstraint - Stretch Left-most Segment Response Value Constraint
      segmentResponseValueConstraintArray - Array of Segment Response Value Constraints
      stretchBestFitResponse - Stretch Fitness Weighted Response
      boundarySettings - The Calibration Boundary Condition
      calibrationDetail - The Calibration Detail
      Returns:
      TRUE - Set up was successful
    • setup

      boolean setup​(double stretchLeftResponseValue, SegmentResponseValueConstraint[] segmentResponseValueConstraintArray, StretchBestFitResponse stretchBestFitResponse, BoundarySettings boundarySettings, int calibrationDetail)
      Set up (i.e., calibrate) the individual Segments in the Stretch to the Stretch Left Edge Response and the Target Constraints.
      Parameters:
      stretchLeftResponseValue - Stretch Left-most Response Value
      segmentResponseValueConstraintArray - Array of Segment Response Value Constraints
      stretchBestFitResponse - Stretch Best Fit Weighted Response Values
      boundarySettings - The Calibration Boundary Condition
      calibrationDetail - The Calibration Detail
      Returns:
      TRUE - Set up was successful
    • clipLeft

      MultiSegmentSequence clipLeft​(java.lang.String name, double predictorOrdinate)
      Generate a new Stretch by clipping all the Segments to the Left of the specified Predictor Ordinate. Smoothness Constraints will be maintained.
      Parameters:
      name - Name of the Clipped Stretch
      predictorOrdinate - Predictor Ordinate Left of which the Clipping is to be applied
      Returns:
      The Clipped Stretch
    • clipRight

      MultiSegmentSequence clipRight​(java.lang.String name, double predictorOrdinate)
      Generate a new Stretch by clipping all the Segments to the Right of the specified Predictor Ordinate. Smoothness Constraints will be maintained.
      Parameters:
      name - Name of the Clipped Stretch
      predictorOrdinate - Predictor Ordinate Right of which the Clipping is to be applied
      Returns:
      The Clipped Stretch
    • curvatureDPE

      double curvatureDPE() throws java.lang.Exception
      Retrieve the Span Curvature DPE
      Returns:
      The Span Curvature DPE
      Throws:
      java.lang.Exception - Thrown if the Span Curvature DPE cannot be computed
    • lengthDPE

      double lengthDPE() throws java.lang.Exception
      Retrieve the Span Length DPE
      Returns:
      The Span Length DPE
      Throws:
      java.lang.Exception - Thrown if the Span Length DPE cannot be computed
    • bestFitDPE

      double bestFitDPE​(StretchBestFitResponse stretchBestFitResponse) throws java.lang.Exception
      Retrieve the Stretch Best Fit DPE
      Parameters:
      stretchBestFitResponse - Stretch Best Fit Weighted Response Values
      Returns:
      The Stretch Best Fit DPE
      Throws:
      java.lang.Exception - Thrown if the Stretch Best Fit DPE cannot be computed
    • msm

      Retrieve the Merge Stretch Manager if it exists.
      Returns:
      The Merge Stretch Manager
    • displayString

      java.lang.String displayString()
      Display the Segments
      Returns:
      The Segments String