Class LatentStateMergeSubStretch

java.lang.Object
org.drip.state.representation.LatentStateMergeSubStretch

public class LatentStateMergeSubStretch
extends java.lang.Object
LatentStateMergeSubStretch implements merged stretch that is common to multiple latent states. It is identified by the start/end date predictor ordinates, and the Latent State Label. Its methods provide the following functionality:

  • Identify if the specified predictor ordinate belongs to the sub stretch
  • Shift that sub stretch start/end
  • Identify if the this overlaps the supplied sub stretch, and coalesce them if possible
  • Retrieve the label, start, and end



Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Latent State Merge Sub-stretch
Author:
Lakshmi Krishnamurthy
  • Constructor Summary

    Constructors
    Constructor Description
    LatentStateMergeSubStretch​(double startDate, double endDate, LatentStateLabel label)
    LatentStateMergeSubStretch constructor
  • Method Summary

    Modifier and Type Method Description
    LatentStateMergeSubStretch coalesce​(LatentStateMergeSubStretch latentStateMergeSubStretchOther)
    Coalesce the supplied Merge Stretch with the current one (if possible) to create a new Merge Stretch
    double end()
    Retrieve the Merge Stretch End Date
    boolean in​(double date)
    Indicate whether the specified Date is "inside" the Stretch Range.
    boolean indexMatch​(LatentStateMergeSubStretch latentStateMergeSubStretchOther)
    Indicate whether Specified Merge Stretch's Label matches with the current one
    LatentStateLabel label()
    Retrieve the Latent State Label
    boolean overlap​(LatentStateMergeSubStretch latentStateMergeSubStretchOther)
    Identify if the Supplied Merge Stretch overlaps with the provided one.
    boolean shiftEnd​(double newEndDate)
    Shift/Adjust the End Date
    boolean shiftStart​(double newStartDate)
    Shift/Adjust the Start Date
    double start()
    Retrieve the Merge Stretch Start Date

    Methods inherited from class java.lang.Object

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

    • LatentStateMergeSubStretch

      public LatentStateMergeSubStretch​(double startDate, double endDate, LatentStateLabel label) throws java.lang.Exception
      LatentStateMergeSubStretch constructor
      Parameters:
      startDate - Merge Stretch Start Date
      endDate - Merge Stretch End Date
      label - The Latent State Label
      Throws:
      java.lang.Exception - Thrown if Inputs are invalid
  • Method Details

    • start

      public double start()
      Retrieve the Merge Stretch Start Date
      Returns:
      The Merge Stretch Start Date
    • shiftStart

      public boolean shiftStart​(double newStartDate)
      Shift/Adjust the Start Date
      Parameters:
      newStartDate - The new Date to be Shifted to
      Returns:
      TRUE - Start Date successfully shifted
    • end

      public double end()
      Retrieve the Merge Stretch End Date
      Returns:
      The Merge Stretch End Date
    • shiftEnd

      public boolean shiftEnd​(double newEndDate)
      Shift/Adjust the End Date
      Parameters:
      newEndDate - The new Date to be Shifted to
      Returns:
      TRUE - End Date successfully shifted
    • label

      public LatentStateLabel label()
      Retrieve the Latent State Label
      Returns:
      The Latent State Label
    • indexMatch

      public boolean indexMatch​(LatentStateMergeSubStretch latentStateMergeSubStretchOther)
      Indicate whether Specified Merge Stretch's Label matches with the current one
      Parameters:
      latentStateMergeSubStretchOther - The Supplied Merge Stretch
      Returns:
      TRUE - Merge Stretches Index Match
    • in

      public boolean in​(double date)
      Indicate whether the specified Date is "inside" the Stretch Range.
      Parameters:
      date - Date whose "inside"ness is asked for
      Returns:
      TRUE - Date is Inside
    • overlap

      public boolean overlap​(LatentStateMergeSubStretch latentStateMergeSubStretchOther)
      Identify if the Supplied Merge Stretch overlaps with the provided one.
      Parameters:
      latentStateMergeSubStretchOther - The Supplied Merge Stretch
      Returns:
      TRUE - Merge Stretches Overlap
    • coalesce

      public LatentStateMergeSubStretch coalesce​(LatentStateMergeSubStretch latentStateMergeSubStretchOther)
      Coalesce the supplied Merge Stretch with the current one (if possible) to create a new Merge Stretch
      Parameters:
      latentStateMergeSubStretchOther - The Supplied Merge Stretch
      Returns:
      The Coalesced Merge Stretch