Package org.drip.spline.stretch
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 Summary
Fields Modifier and Type Field Description static int
CALIBRATE
Calibration Detail: Calibrate the Stretch as part of the set upstatic int
CALIBRATE_JACOBIAN
Calibration Detail: Calibrate the Stretch AND compute Jacobian as part of the set up -
Method Summary
Modifier and Type Method Description double
bestFitDPE(StretchBestFitResponse stretchBestFitResponse)
Retrieve the Stretch Best Fit DPEdouble
calcLeftEdgeDerivative(int order)
Calculate the Derivative of the requested order at the Left Edge of the Stretchdouble
calcRightEdgeDerivative(int order)
Calculate the Derivative of the requested order at the right Edge of the StretchSegmentPredictorResponseDerivative
calcSPRD(double predictorOrdinate)
Calculate the SegmentPredictorResponseDerivative at the specified Predictor OrdinateMultiSegmentSequence
clipLeft(java.lang.String name, double predictorOrdinate)
Generate a new Stretch by clipping all the Segments to the Left of the specified Predictor Ordinate.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.int
containingIndex(double predictorOrdinate, boolean includeLeft, boolean includeRight)
Return the Index for the Segment containing specified Predictor Ordinatedouble
curvatureDPE()
Retrieve the Span Curvature DPEjava.lang.String
displayString()
Display the Segmentsboolean
in(double predictorOrdinate)
Check if the Predictor Ordinate is in the Stretch Rangedouble
lengthDPE()
Retrieve the Span Length DPEMergeSubStretchManager
msm()
Retrieve the Merge Stretch Manager if it exists.java.lang.String
name()
Retrieve the Stretch NameSegmentCustomBuilderControl[]
segmentBuilderControl()
Retrieve the Segment Builder ParametersLatentStateResponseModel[]
segments()
Retrieve the Stretch Segmentsboolean
setLeftNode(double stretchLeftResponse, double stretchLeftResponseSlope, double stretchRightResponse, StretchBestFitResponse stretchBestFitResponse)
Set the Slope at the left Edge of the Stretchboolean
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.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.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.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.Methods inherited from interface org.drip.spline.stretch.SingleSegmentSequence
getLeftPredictorOrdinateEdge, getRightPredictorOrdinateEdge, isCoMonotone, isKnot, isLocallyMonotone, jackDResponseDCalibrationInput, jackDResponseDManifestMeasure, monotoneType, resetNode, resetNode, responseValue, responseValueDerivative, setup, toAU
-
Field Details
-
CALIBRATE
static final int CALIBRATECalibration Detail: Calibrate the Stretch as part of the set up- See Also:
- Constant Field Values
-
CALIBRATE_JACOBIAN
static final int CALIBRATE_JACOBIANCalibration 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
LatentStateResponseModel[] 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 ValuesrightSegmentPredictorResponseDerivativeArray
- Array of Right Segment Edge ValuessegmentResponseValueConstraintGrid
- Double Array of Constraints - Outer Index corresponds to Segment Index, and the Inner Index to Constraint Array within each SegmentstretchBestFitResponse
- Stretch Fitness Weighted ResponsesetupMode
- 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 StretchstretchLeftResponseSlope
- Response Slope Value at the Left Edge of the StretchstretchRightResponse
- Response Value at the Right Edge of the StretchstretchBestFitResponse
- Stretch Fitness Weighted Response- Returns:
- TRUE - Left slope successfully set
-
calcSPRD
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.ExceptionCalculate 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.ExceptionCalculate 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.ExceptionCheck 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.ExceptionReturn the Index for the Segment containing specified Predictor Ordinate- Parameters:
predictorOrdinate
- Predictor OrdinateincludeLeft
- TRUE - Less than or equal to the Left Predictor OrdinateincludeRight
- 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
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 InstancecalibrationDetail
- 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 ConstraintsegmentResponseValueConstraintArray
- Array of Segment Response Value ConstraintsstretchBestFitResponse
- Stretch Fitness Weighted ResponseboundarySettings
- The Calibration Boundary ConditioncalibrationDetail
- 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 ValuesegmentResponseValueConstraintArray
- Array of Segment Response Value ConstraintsstretchBestFitResponse
- Stretch Best Fit Weighted Response ValuesboundarySettings
- The Calibration Boundary ConditioncalibrationDetail
- The Calibration Detail- Returns:
- TRUE - Set up was successful
-
clipLeft
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 StretchpredictorOrdinate
- Predictor Ordinate Left of which the Clipping is to be applied- Returns:
- The Clipped Stretch
-
clipRight
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 StretchpredictorOrdinate
- Predictor Ordinate Right of which the Clipping is to be applied- Returns:
- The Clipped Stretch
-
curvatureDPE
double curvatureDPE() throws java.lang.ExceptionRetrieve 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.ExceptionRetrieve the Span Length DPE- Returns:
- The Span Length DPE
- Throws:
java.lang.Exception
- Thrown if the Span Length DPE cannot be computed
-
bestFitDPE
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
MergeSubStretchManager 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
-