Class LatentStateResponseModel

java.lang.Object
org.drip.spline.segment.LatentStateInelastic
org.drip.spline.segment.LatentStateResponseModel
All Implemented Interfaces:
java.lang.Comparable<LatentStateInelastic>

public class LatentStateResponseModel
extends LatentStateInelastic
LatentStateResponseModel implements the single segment basis calibration and inference functionality. It exports the following functionality:
  • Build the LatentStateResponseModel instance from the Basis Function/Shape Controller Set
  • Build the LatentStateResponseModel instance from the Basis Evaluator Set
  • Retrieve the Number of Parameters, Basis Evaluator, Array of the Response Basis Coefficients, and Segment Design Inelastic Control
  • Calibrate the Segment State from the Calibration Parameter Set
  • Sensitivity Calibrator: Calibrate the Segment Manifest Jacobian from the Calibration Parameter Set
  • Calibrate the coefficients from the prior Predictor/Response Segment, the Constraint, and fitness Weights
  • Calibrate the coefficients from the prior Segment and the Response Value at the Right Predictor Ordinate
  • Calibrate the Coefficients from the Edge Response Values and the Left Edge Response Slope
  • Calibrate the coefficients from the Left Edge Response Value Constraint, the Left Edge Response Value Slope, and the Right Edge Response Value Constraint
  • Retrieve the Segment Curvature, Length, and the Best Fit DPE
  • Calculate the Response Value and its Derivative at the given Predictor Ordinate
  • Calculate the Ordered Derivative of the Coefficient to the Manifest
  • Calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Inputs
  • Calculate the Jacobian of the Response to the Edge Inputs at the given Predictor Ordinate
  • Calculate the Jacobian of the Response to the Basis Coefficients at the given Predictor Ordinate
  • Calibrate the segment and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
  • Calibrate the Coefficients from the Edge Response Values and the Left Edge Response Value Slope and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
  • Calibrate the coefficients from the prior Segment and the Response Value at the Right Predictor Ordinate and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
  • Indicate whether the given segment is monotone. If monotone, may optionally indicate the nature of the extrema contained inside (maxima/minima/infection)
  • Clip the part of the Segment to the Right of the specified Predictor Ordinate. Retain all other constraints the same
  • Clip the part of the Segment to the Left of the specified Predictor Ordinate. Retain all other constraints the same
  • Display the string representation for diagnostic purposes

Module Product Core Module
Library Fixed Income Analytics
Project Basis Splines and Linear Compounders across a Broad Family of Spline Basis Functions
Package Flexure Penalizing Best Fit Segment

Author:
Lakshmi Krishnamurthy
  • Field Details

    • LEFT_NODE_VALUE_PARAMETER_INDEX

      public static final int LEFT_NODE_VALUE_PARAMETER_INDEX
      LEFT NODE VALUE PARAMETER INDEX
      See Also:
      Constant Field Values
    • RIGHT_NODE_VALUE_PARAMETER_INDEX

      public static final int RIGHT_NODE_VALUE_PARAMETER_INDEX
      RIGHT NODE VALUE PARAMETER INDEX
      See Also:
      Constant Field Values
  • Method Details

    • Create

      public static final LatentStateResponseModel Create​(double leftPredictorOrdinate, double rightPredictorOrdinate, FunctionSet functionSet, ResponseScalingShapeControl responseScalingShapeControl, SegmentInelasticDesignControl segmentInelasticDesignControl)
      Build the LatentStateResponseModel instance from the Basis Function/Shape Controller Set
      Parameters:
      leftPredictorOrdinate - Left Predictor Ordinate
      rightPredictorOrdinate - Right Predictor Ordinate
      functionSet - Response Basis Function Set
      responseScalingShapeControl - Shape Controller
      segmentInelasticDesignControl - Segment Inelastic Design Parameters
      Returns:
      Instance of LatentStateResponseModel
    • Create

      public static final LatentStateResponseModel Create​(double leftPredictorOrdinate, double rightPredictorOrdinate, BasisEvaluator basisEvaluator, SegmentInelasticDesignControl segmentInelasticDesignControl)
      Build the LatentStateResponseModel instance from the Basis Evaluator Set
      Parameters:
      leftPredictorOrdinate - Left Predictor Ordinate
      rightPredictorOrdinate - Right Predictor Ordinate
      basisEvaluator - Basis Evaluator
      segmentInelasticDesignControl - Segment Inelastic Design Parameters
      Returns:
      Instance of LatentStateResponseModel
    • setPreceedingManifestSensitivityControl

      public boolean setPreceedingManifestSensitivityControl​(java.lang.String manifestMeasure, PreceedingManifestSensitivityControl precedingManifestSensitivityControl)
      Set the Preceding Manifest Sensitivity Control Parameters for the specified Manifest Measure
      Parameters:
      manifestMeasure - The Manifest Measure
      precedingManifestSensitivityControl - The Preceding Manifest Sensitivity Control Instance
      Returns:
      TRUE - Named Preceding Manifest Sensitivity Control Instance Successfully Set
    • numParameters

      public int numParameters()
      Retrieve the Number of Parameters
      Returns:
      The Number of Parameters
    • basisEvaluator

      public BasisEvaluator basisEvaluator()
      Retrieve the Basis Evaluator
      Returns:
      The Basis Evaluator
    • responseBasisCoefficient

      public double[] responseBasisCoefficient()
      Retrieve the Array of Response Basis Coefficients
      Returns:
      The Array of Response Basis Coefficients
    • designControl

      public SegmentInelasticDesignControl designControl()
      Retrieve the Segment Inelastic Design Control
      Returns:
      The Segment Inelastic Design Control
    • calibrateState

      public boolean calibrateState​(SegmentStateCalibrationInputs stateSegmentStateCalibrationInputs)
      Main Calibrator: Calibrate the Segment State from the Calibration Parameter Set
      Parameters:
      stateSegmentStateCalibrationInputs - The Segment State Calibration Inputs Set
      Returns:
      TRUE - Calibration Successful
    • calibrateManifestJacobian

      public double[] calibrateManifestJacobian​(SegmentStateCalibrationInputs manifestSensitivitySegmentStateCalibrationInputs, SegmentBasisFlexureConstraint[] stateSegmentBasisFlexureConstraintArray)
      Sensitivity Calibrator: Calibrate the Segment Manifest Measure Jacobian from the Calibration Inputs
      Parameters:
      manifestSensitivitySegmentStateCalibrationInputs - The Segment Manifest Calibration Sensitivity Inputs
      stateSegmentBasisFlexureConstraintArray - Array of Segment State Basis Flexure Constraints
      Returns:
      The Manifest Sensitivity Coefficients
    • calibrateLocalManifestJacobian

      public boolean calibrateLocalManifestJacobian​(java.lang.String manifestMeasure, SegmentStateCalibrationInputs manifestSensitivitySegmentStateCalibrationInputs, SegmentBasisFlexureConstraint[] stateSegmentBasisFlexureConstraintArray)
      Sensitivity Calibrator: Calibrate the Segment Local Manifest Jacobian from the Calibration Parameter Set
      Parameters:
      manifestMeasure - Latent State Manifest Measure
      manifestSensitivitySegmentStateCalibrationInputs - The Segment Manifest Calibration Parameter Sensitivity
      stateSegmentBasisFlexureConstraintArray - Array of Segment State Basis Flexure Constraints
      Returns:
      TRUE - Local Manifest Sensitivity Calibration Successful
    • calibratePreceedingManifestJacobian

      public boolean calibratePreceedingManifestJacobian​(java.lang.String manifestMeasure, SegmentStateCalibrationInputs precedingManifestSensitivitySegmentStateCalibrationInputs)
      Sensitivity Calibrator: Calibrate the Segment Preceding Manifest Jacobian from the Calibration Parameter Set
      Parameters:
      manifestMeasure - Latent State Manifest
      precedingManifestSensitivitySegmentStateCalibrationInputs - The Segment Preceding Manifest Calibration Parameter Sensitivity
      Returns:
      TRUE - Preceding Manifest Sensitivity Calibration Successful
    • calibrate

      public boolean calibrate​(LatentStateResponseModel precedingLatentStateResponseModel, SegmentResponseValueConstraint stateSegmentResponseValueConstraint, SegmentBestFitResponse stateSegmentBestFitResponse)
      Calibrate the coefficients from the prior Predictor/Response Segment, the Constraint, and fitness Weights
      Parameters:
      precedingLatentStateResponseModel - Preceeding Predictor/Response Segment
      stateSegmentResponseValueConstraint - The Segment State Response Value Constraint
      stateSegmentBestFitResponse - Segment's Best Fit Weighted State Response Values
      Returns:
      TRUE - If the calibration succeeds
    • calibrate

      public boolean calibrate​(LatentStateResponseModel precedingLatentStateResponseModel, double rightStateValue, SegmentBestFitResponse stateSegmentBestFitResponse)
      Calibrate the coefficients from the prior Segment and the Response Value at the Right Predictor Ordinate
      Parameters:
      precedingLatentStateResponseModel - Preceding Predictor/Response Segment
      rightStateValue - Response Value at the Right Predictor Ordinate
      stateSegmentBestFitResponse - Segment's Best Fit Weighted Response Values
      Returns:
      TRUE - If the calibration succeeds
    • calibrate

      public boolean calibrate​(double leftValue, double leftSlope, double rightValue, SegmentBestFitResponse stateSegmentBestFitResponse)
      Calibrate the Coefficients from the Edge Response Values and the Left Edge Response Slope
      Parameters:
      leftValue - Left Edge Response Value
      leftSlope - Left Edge Response Slope
      rightValue - Right Edge Response Value
      stateSegmentBestFitResponse - Segment's Best Fit Weighted Response Values
      Returns:
      TRUE - The Calibration Succeeded
    • calibrate

      public boolean calibrate​(SegmentResponseValueConstraint leftStateSegmentResponseValueConstraint, double leftSlope, SegmentResponseValueConstraint rightStateSegmentResponseValueConstraint, SegmentBestFitResponse stateSegmentBestFitResponse)
      Calibrate the coefficients from the Left Edge Response Value Constraint, the Left Edge Response Value Slope, and the Right Edge Response Value Constraint
      Parameters:
      leftStateSegmentResponseValueConstraint - Left Edge Response Value Constraint
      leftSlope - Left Edge Response Value Slope
      rightStateSegmentResponseValueConstraint - Right Edge Response Value Constraint
      stateSegmentBestFitResponse - Segment's Best Fit Weighted Response
      Returns:
      TRUE - If the calibration succeeds
    • manifestMeasureSensitivity

      public boolean manifestMeasureSensitivity​(LatentStateResponseModel precedingLatentStateResponseModel, java.lang.String manifestMeasure, SegmentResponseValueConstraint stateSegmentResponseValueConstraint, SegmentResponseValueConstraint manifestSensitivitySegmentResponseValueConstraint, SegmentBestFitResponse manifestSensitivitySegmentBestFitResponse)
      Compute the Local and the Preceding Manifest Measure Sensitivity Coefficients from the Preceding Segment, the Local Response Value, the Local Response Value Manifest Measure Sensitivity, and the Local Best Fit Response Sensitivity
      Parameters:
      precedingLatentStateResponseModel - Preceding Predictor/Response Segment
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      stateSegmentResponseValueConstraint - The Segment State Response Value Constraint
      manifestSensitivitySegmentResponseValueConstraint - The Segment State Response Value Constraint Manifest Sensitivity
      manifestSensitivitySegmentBestFitResponse - Segment's Best Fit Weighted State Response Value Manifest Sensitivity
      Returns:
      TRUE - If the calibration succeeds
    • manifestMeasureSensitivity

      public boolean manifestMeasureSensitivity​(LatentStateResponseModel precedingLatentStateResponseModel, java.lang.String manifestMeasure, double rightStateManifestSensitivity, SegmentBestFitResponse manifestSensitivitySegmentBestFitResponse)
      Compute the Local and the Preceding Manifest Measure Sensitivity Coefficients from the Preceding Segments, the Local Response Value Sensitivity at the Right Predictor Ordinate, and the Local Best Fit Response Sensitivity
      Parameters:
      precedingLatentStateResponseModel - Preceding Predictor/Response Segment
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      rightStateManifestSensitivity - Response Value Manifest Sensitivity at the Right Predictor Ordinate
      manifestSensitivitySegmentBestFitResponse - Segment's Best Fit Weighted Response Value Manifest Sensitivity
      Returns:
      TRUE - If the calibration succeeds
    • manifestMeasureSensitivity

      public boolean manifestMeasureSensitivity​(java.lang.String manifestMeasure, double leftManifestSensitivity, double leftSlopeManifestSensitivity, double rightManifestSensitivity, SegmentBestFitResponse manifestSensitivitySegmentBestFitResponse)
      Compute the Local and the Preceeding Manifest Measure Sensitivity Coefficients from the Local Response Value Sensitivity at the Left/Right Predictor Ordinate, the Local Left Response Value Sensitivity Slope, and the Local Best Fit Response Sensitivity.
      Parameters:
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      leftManifestSensitivity - Left Edge Response Value Manifest Sensitivity
      leftSlopeManifestSensitivity - Left Edge Response Slope Manifest Sensitivity
      rightManifestSensitivity - Right Edge Response Value Manifest Sensitivity
      manifestSensitivitySegmentBestFitResponse - Segment's Best Fit Weighted Response Values Manifest Sensitivity
      Returns:
      TRUE - The Calibration Succeeded
    • manifestMeasureSensitivity

      public boolean manifestMeasureSensitivity​(java.lang.String manifestMeasure, SegmentResponseValueConstraint stateLeftSegmentResponseValueConstraint, SegmentResponseValueConstraint stateRightSegmentResponseValueConstraint, double leftSlopeManifestSensitivity, SegmentResponseValueConstraint stateLeftManifestSensitivitySegmentResponseValueConstraint, SegmentResponseValueConstraint stateRightManifestSensitivitySegmentResponseValueConstraint, SegmentBestFitResponse manifestSensitivitySegmentBestFitResponse)
      Compute the Local and the Preceeding Manifest Measure Sensitivity Coefficients from the Local Response Value/Sensitivity Constraints at the Left/Right Predictor Ordinate, the Local Left Response Value Sensitivity Slope, and the Local Best Fit Response Sensitivity
      Parameters:
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      stateLeftSegmentResponseValueConstraint - Left Edge Response Value Constraint
      stateRightSegmentResponseValueConstraint - Right Edge Response Value Constraint
      leftSlopeManifestSensitivity - Left Edge Response Value Slope Manifest Sensitivity
      stateLeftManifestSensitivitySegmentResponseValueConstraint - Left Edge Response Value Constraint Manifest Sensitivity
      stateRightManifestSensitivitySegmentResponseValueConstraint - Right Edge Response Value Constraint Manifest Sensitivity
      manifestSensitivitySegmentBestFitResponse - Segment's Best Fit Weighted Response Manifest Sensitivity
      Returns:
      TRUE - If the calibration succeeds
    • curvatureDPE

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

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

      public double bestFitDPE​(SegmentBestFitResponse segmentBestFitResponse) throws java.lang.Exception
      Retrieve the Segment Best Fit DPE
      Parameters:
      segmentBestFitResponse - The Segment's Best Fit Response Inputs
      Returns:
      The Segment Best Fit DPE
      Throws:
      java.lang.Exception - Thrown if the Segment Best Fit DPE cannot be computed
    • responseValue

      public double responseValue​(double predictorOrdinate) throws java.lang.Exception
      Calculate the Response Value at the given Predictor Ordinate
      Parameters:
      predictorOrdinate - Predictor Ordinate
      Returns:
      The Response Value
      Throws:
      java.lang.Exception - Thrown if the calculation did not succeed
    • calcResponseValueDerivative

      public double calcResponseValueDerivative​(double predictorOrdinate, int order) throws java.lang.Exception
      Calculate the Ordered Response Value Derivative at the Predictor Ordinate
      Parameters:
      predictorOrdinate - Predictor Ordinate at which the ordered Response Derivative is to be calculated
      order - Derivative Order
      Returns:
      Retrieve the Ordered Response Value Derivative
      Throws:
      java.lang.Exception - Thrown if the Ordered Response Value Derivative cannot be calculated
    • calcDResponseDManifest

      public double calcDResponseDManifest​(java.lang.String manifestMeasure, double predictorOrdinate, int order) throws java.lang.Exception
      Calculate the Ordered Derivative of the Response to the Manifest
      Parameters:
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      predictorOrdinate - Predictor Ordinate at which the ordered Derivative of the Response to the Manifest is to be calculated
      order - Derivative Order
      Returns:
      Retrieve the Ordered Derivative of the Response to the Manifest
      Throws:
      java.lang.Exception - Thrown if the Ordered Derivative of the Response to the Manifest cannot be calculated
    • calcDResponseDPreceedingManifest

      public double calcDResponseDPreceedingManifest​(java.lang.String manifestMeasure, double predictorOrdinate, int order) throws java.lang.Exception
      Calculate the Ordered Derivative of the Response to the Preceeding Manifest
      Parameters:
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      predictorOrdinate - Predictor Ordinate at which the ordered Derivative of the Response to the Manifest is to be calculated
      order - Derivative Order
      Returns:
      Retrieve the Ordered Derivative of the Response to the Preceeding Manifest
      Throws:
      java.lang.Exception - Thrown if the Ordered Derivative of the Response to the Manifest cannot be calculated
    • impactFade

      public boolean impactFade​(java.lang.String manifestMeasure) throws java.lang.Exception
      Retrieve the Manifest Measure Preceding Manifest Impact Flag
      Parameters:
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      Returns:
      The Manifest Measure Preceding Manifest Impact Flag
      Throws:
      java.lang.Exception - Thrown if the Inputs are Invalid
    • jackDCoeffDEdgeInputs

      public WengertJacobian jackDCoeffDEdgeInputs()
      Calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Inputs
      Returns:
      The Jacobian of the Segment's Response Basis Function Coefficients to the Edge Inputs
    • jackDResponseDEdgeInput

      public WengertJacobian jackDResponseDEdgeInput​(double predictorOrdinate, int order)
      Calculate the Jacobian of the Response to the Edge Inputs at the given Predictor Ordinate
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      order - Order of the Derivative Desired
      Returns:
      The Jacobian of the Response to the Edge Inputs at the given Predictor Ordinate
    • jackDResponseDBasisCoeff

      public WengertJacobian jackDResponseDBasisCoeff​(double predictorOrdinate, int order)
      Calculate the Jacobian of the Response to the Basis Coefficients at the given Predictor Ordinate
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      order - Order of the Derivative Desired
      Returns:
      The Jacobian of the Response to the Basis Coefficients at the given Predictor Ordinate
    • jackDCoeffDEdgeParams

      public WengertJacobian jackDCoeffDEdgeParams​(double[] predictorOrdinateArray, double[] responseValueArray, double[] leftEdgeDerivativeArray, double[] rightEdgeDerivativeArray, SegmentBasisFlexureConstraint[] segmentBasisFlexureConstraintArray, SegmentBestFitResponse segmentBestFitResponse)
      Calibrate the segment and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
      Parameters:
      predictorOrdinateArray - Array of Predictor Ordinates
      responseValueArray - Array of Response Values
      leftEdgeDerivativeArray - Array of Left Edge Derivatives
      rightEdgeDerivativeArray - Array of Right Edge Derivatives
      segmentBasisFlexureConstraintArray - Array of Segment Flexure Constraints, expressed as Basis Coefficients
      segmentBestFitResponse - Segment Best Fit Response Instance
      Returns:
      The Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
    • jackDCoeffDEdgeParams

      public WengertJacobian jackDCoeffDEdgeParams​(double leftValue, double leftSlope, double rightValue, SegmentBestFitResponse stateSegmentBestFitResponse)
      Calibrate the Coefficients from the Edge Response Values and the Left Edge Response Value Slope and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
      Parameters:
      leftValue - Left Edge Response Value
      leftSlope - Left Edge Response Slope
      rightValue - Right Edge Response Value
      stateSegmentBestFitResponse - Segment's Best Fit Weighted Response Values
      Returns:
      The Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
    • jackDCoeffDEdgeParams

      public WengertJacobian jackDCoeffDEdgeParams​(LatentStateResponseModel precedingLatentStateResponseModel, java.lang.String manifestMeasure, double rightStateValue, SegmentBestFitResponse stateSegmentBestFitResponse, double rightStateManifestSensitivity, SegmentBestFitResponse manifestSensitivitySegmentBestFitResponse)
      Calibrate the coefficients from the prior Segment and the Response Value at the Right Predictor Ordinate and calculate the Jacobian of the Segment's Response Basis Function Coefficients to the Edge Parameters
      Parameters:
      precedingLatentStateResponseModel - Previous Predictor/Response Segment
      manifestMeasure - Manifest Measure whose Sensitivity is sought
      rightStateValue - Response Value at the Right Predictor Ordinate
      stateSegmentBestFitResponse - Segment's Best Fit Weighted Response Values
      rightStateManifestSensitivity - Response Value Manifest Sensitivity at the Right Predictor Ordinate
      manifestSensitivitySegmentBestFitResponse - Segment's Best Fit Weighted Response Value Manifest Sensitivity
      Returns:
      The Jacobian
    • monotoneType

      public Monotonocity monotoneType()
      Indicate whether the given segment is monotone. If monotone, may optionally indicate the nature of the extrema contained inside (maxima/minima/infection).
      Returns:
      The monotone Type
    • clipLeftOfPredictorOrdinate

      public LatentStateResponseModel clipLeftOfPredictorOrdinate​(double predictorOrdinate)
      Clip the part of the Segment to the Right of the specified Predictor Ordinate. Retain all other constraints the same.
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      Returns:
      The Clipped Segment
    • clipRightOfPredictorOrdinate

      public LatentStateResponseModel clipRightOfPredictorOrdinate​(double predictorOrdinate)
      Clip the part of the Segment to the Right of the specified Predictor Ordinate. Retain all other constraints the same.
      Parameters:
      predictorOrdinate - The Predictor Ordinate
      Returns:
      The Clipped Segment
    • displayString

      public java.lang.String displayString()
      Display the string representation for diagnostic purposes
      Returns:
      The string representation