Class OverlappingStretchSpan

java.lang.Object
org.drip.spline.grid.OverlappingStretchSpan
All Implemented Interfaces:
Span

public class OverlappingStretchSpan
extends java.lang.Object
implements Span
OverlappingStretchSpan implements the Span interface, and the collection functionality of overlapping Stretches. In addition to providing a custom implementation of all the Span interface stubs, it also converts the Overlapping Stretch Span to a non-overlapping Stretch Span. Overlapping Stretches are clipped from the Left.
  • OverlappingStretchSpan constructor
  • Convert the Overlapping Stretch Span to a non-overlapping Stretch Span. Overlapping Stretches are clipped from the Left

Module Product Core Module
Library Fixed Income Analytics
Project Basis Splines and Linear Compounders across a Broad Family of Spline Basis Functions
Package Aggregated/Overlapping Stretch/Span Grids

Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    OverlappingStretchSpan​(MultiSegmentSequence multiSegmentSequence)
    OverlappingStretchSpan constructor
  • Method Summary

    Modifier and Type Method Description
    boolean addStretch​(MultiSegmentSequence multiSegmentSequence)
    Add a Stretch to the Span
    double calcResponseValue​(double predictorOrdinate)
    Compute the Response from the containing Stretches
    double calcResponseValueDerivative​(double predictorOrdinate, int order)
    Compute the Response Value Derivative from the containing Stretches
    java.lang.String displayString()
    Display the Span Edge Coordinates
    MultiSegmentSequence getContainingStretch​(double predictorOrdinate)
    Retrieve the first Stretch that contains the Predictor Ordinate
    MultiSegmentSequence getStretch​(java.lang.String name)
    Retrieve the Stretch by Name
    boolean in​(double predictorOrdinate)
    Check if the Predictor Ordinate is in the Stretch Range
    boolean isMergeState​(double predictorOrdinate, LatentStateLabel latentStateLabel)
    Indicate if the specified Label is part of the Merge State at the specified Predictor Ordinate
    WengertJacobian jackDResponseDManifestMeasure​(java.lang.String manifestMeasure, double predictorOrdinate, int order)
    Calculate the Response Derivative to the Manifest Measure at the specified Ordinate
    double left()
    Retrieve the Left Span Edge
    double right()
    Retrieve the Right Span Edge
    Span toNonOverlapping()
    Convert the Overlapping Stretch Span to a non-overlapping Stretch Span.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OverlappingStretchSpan

      public OverlappingStretchSpan​(MultiSegmentSequence multiSegmentSequence) throws java.lang.Exception
      OverlappingStretchSpan constructor
      Parameters:
      multiSegmentSequence - The Initial Stretch in the Span
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
  • Method Details

    • addStretch

      public boolean addStretch​(MultiSegmentSequence multiSegmentSequence)
      Description copied from interface: Span
      Add a Stretch to the Span
      Specified by:
      addStretch in interface Span
      Parameters:
      multiSegmentSequence - Stretch to be added
      Returns:
      TRUE - Stretch added successfully
    • getContainingStretch

      public MultiSegmentSequence getContainingStretch​(double predictorOrdinate)
      Description copied from interface: Span
      Retrieve the first Stretch that contains the Predictor Ordinate
      Specified by:
      getContainingStretch in interface Span
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      Returns:
      The containing Stretch
    • getStretch

      public MultiSegmentSequence getStretch​(java.lang.String name)
      Description copied from interface: Span
      Retrieve the Stretch by Name
      Specified by:
      getStretch in interface Span
      Parameters:
      name - The Stretch Name
      Returns:
      The Stretch
    • left

      public double left() throws java.lang.Exception
      Description copied from interface: Span
      Retrieve the Left Span Edge
      Specified by:
      left in interface Span
      Returns:
      The Left Span Edge
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • right

      public double right() throws java.lang.Exception
      Description copied from interface: Span
      Retrieve the Right Span Edge
      Specified by:
      right in interface Span
      Returns:
      The Left Span Edge
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • calcResponseValue

      public double calcResponseValue​(double predictorOrdinate) throws java.lang.Exception
      Description copied from interface: Span
      Compute the Response from the containing Stretches
      Specified by:
      calcResponseValue in interface Span
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      Returns:
      The Response
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • calcResponseValueDerivative

      public double calcResponseValueDerivative​(double predictorOrdinate, int order) throws java.lang.Exception
      Description copied from interface: Span
      Compute the Response Value Derivative from the containing Stretches
      Specified by:
      calcResponseValueDerivative in interface Span
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      order - Order of the Derivative to be calculated
      Returns:
      The Response Value Derivative
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • isMergeState

      public boolean isMergeState​(double predictorOrdinate, LatentStateLabel latentStateLabel)
      Description copied from interface: Span
      Indicate if the specified Label is part of the Merge State at the specified Predictor Ordinate
      Specified by:
      isMergeState in interface Span
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      latentStateLabel - Merge State Label
      Returns:
      TRUE - The specified Label is part of the Merge State at the specified Predictor Ordinate
    • jackDResponseDManifestMeasure

      public WengertJacobian jackDResponseDManifestMeasure​(java.lang.String manifestMeasure, double predictorOrdinate, int order)
      Description copied from interface: Span
      Calculate the Response Derivative to the Manifest Measure at the specified Ordinate
      Specified by:
      jackDResponseDManifestMeasure in interface Span
      Parameters:
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      predictorOrdinate - Predictor Ordinate
      order - Order of Derivative desired
      Returns:
      Jacobian of the Response Derivative to the Manifest Measure at the Ordinate
    • in

      public boolean in​(double predictorOrdinate) throws java.lang.Exception
      Description copied from interface: Span
      Check if the Predictor Ordinate is in the Stretch Range
      Specified by:
      in in interface Span
      Parameters:
      predictorOrdinate - Predictor Ordinate
      Returns:
      TRUE - Predictor Ordinate is in the Range
      Throws:
      java.lang.Exception - Thrown if the Inputs are invalid
    • toNonOverlapping

      public Span toNonOverlapping()
      Convert the Overlapping Stretch Span to a non-overlapping Stretch Span. Overlapping Stretches are clipped from the Left.
      Returns:
      The Non-overlapping Stretch Span Instance
    • displayString

      public java.lang.String displayString()
      Description copied from interface: Span
      Display the Span Edge Coordinates
      Specified by:
      displayString in interface Span
      Returns:
      The Edge Coordinates String