Class CreditCurve

java.lang.Object
org.drip.state.credit.CreditCurve
All Implemented Interfaces:
Curve, LatentState
Direct Known Subclasses:
ExplicitBootCreditCurve

public abstract class CreditCurve
extends java.lang.Object
implements Curve
CreditCurve is the stub for the survival curve functionality. It extends the Curve object by exposing the following functions:
  • Set of curve and market identifiers
  • Recovery to a specific date/tenor, and effective recovery between a date interval
  • Hazard Rate to a specific date/tenor, and effective hazard rate between a date interval
  • Survival to a specific date/tenor, and effective survival between a date interval
  • Set/unset date of specific default
  • Generate scenario curves from the base credit curve (flat/parallel/custom)
  • Set/unset the Curve Construction Inputs, Latent State, and the Manifest Metrics
  • Serialization/De-serialization to and from Byte Arrays
  • Set the Specific Default Date
  • Remove the Specific Default Date
  • Calculate the survival to the given date
  • Calculate the survival to the given tenor
  • Calculate the time-weighted survival between a pair of 2 dates
  • Calculate the time-weighted survival between a pair of 2 tenors
  • Calculate the recovery rate to the given date
  • Calculate the recovery rate to the given tenor
  • Calculate the time-weighted recovery between a pair of dates
  • Calculate the time-weighted recovery between a pair of tenors
  • Calculate the hazard rate between a pair of forward dates
  • Calculate the hazard rate to the given date
  • Calculate the hazard rate to the given tenor
  • Create a flat hazard curve from the inputs

Module Product Core Module
Library Fixed Income Analytics
Project Latent State Inference and Creation Utilities
Package Credit Latent State Curve Representation
Author:
Lakshmi Krishnamurthy
  • Method Details

    • label

      public LatentStateLabel label()
      Description copied from interface: Curve
      Get the Curve Latent State Identifier Label
      Specified by:
      label in interface Curve
      Returns:
      The Curve Latent State Identifier Label
    • currency

      public java.lang.String currency()
      Description copied from interface: Curve
      Get the Currency
      Specified by:
      currency in interface Curve
      Returns:
      Currency
    • epoch

      public JulianDate epoch()
      Description copied from interface: Curve
      Get the Epoch Date
      Specified by:
      epoch in interface Curve
      Returns:
      The Epoch Date
    • setSpecificDefault

      public boolean setSpecificDefault​(int specificDefaultDate)
      Set the Specific Default Date
      Parameters:
      specificDefaultDate - Date of Specific Default
      Returns:
      TRUE if successful
    • unsetSpecificDefault

      public boolean unsetSpecificDefault()
      Remove the Specific Default Date
      Returns:
      TRUE if successful
    • survival

      public abstract double survival​(int date) throws java.lang.Exception
      Calculate the survival to the given date
      Parameters:
      date - Date
      Returns:
      Survival Probability
      Throws:
      java.lang.Exception - Thrown if the survival probability cannot be calculated
    • survival

      public double survival​(JulianDate dt) throws java.lang.Exception
      Calculate the survival to the given date
      Parameters:
      dt - Date
      Returns:
      Survival Probability
      Throws:
      java.lang.Exception - Thrown if the survival probability cannot be calculated
    • survival

      public double survival​(java.lang.String tenor) throws java.lang.Exception
      Calculate the survival to the given tenor
      Parameters:
      tenor - Tenor
      Returns:
      Survival Probability
      Throws:
      java.lang.Exception - Thrown if the survival probability cannot be calculated
    • effectiveSurvival

      public double effectiveSurvival​(int date1, int date2) throws java.lang.Exception
      Calculate the time-weighted survival between a pair of 2 dates
      Parameters:
      date1 - First Date
      date2 - Second Date
      Returns:
      Survival Probability
      Throws:
      java.lang.Exception - Thrown if the survival probability cannot be calculated
    • effectiveSurvival

      public double effectiveSurvival​(JulianDate date1, JulianDate date2) throws java.lang.Exception
      Calculate the time-weighted survival between a pair of 2 dates
      Parameters:
      date1 - First Date
      date2 - Second Date
      Returns:
      Survival Probability
      Throws:
      java.lang.Exception - Thrown if the survival probability cannot be calculated
    • effectiveSurvival

      public double effectiveSurvival​(java.lang.String tenor1, java.lang.String tenor2) throws java.lang.Exception
      Calculate the time-weighted survival between a pair of 2 tenors
      Parameters:
      tenor1 - First tenor
      tenor2 - Second tenor
      Returns:
      Survival Probability
      Throws:
      java.lang.Exception - Thrown if the survival probability cannot be calculated
    • recovery

      public abstract double recovery​(int date) throws java.lang.Exception
      Calculate the recovery rate to the given date
      Parameters:
      date - Date
      Returns:
      Recovery Rate
      Throws:
      java.lang.Exception - Thrown if the Recovery rate cannot be calculated
    • recovery

      public double recovery​(JulianDate date) throws java.lang.Exception
      Calculate the recovery rate to the given date
      Parameters:
      date - Date
      Returns:
      Recovery Rate
      Throws:
      java.lang.Exception - Thrown if the Recovery rate cannot be calculated
    • recovery

      public double recovery​(java.lang.String tenor) throws java.lang.Exception
      Calculate the recovery rate to the given tenor
      Parameters:
      tenor - Tenor
      Returns:
      Recovery Rate
      Throws:
      java.lang.Exception - Thrown if the Recovery rate cannot be calculated
    • effectiveRecovery

      public double effectiveRecovery​(int date1, int date2) throws java.lang.Exception
      Calculate the time-weighted recovery between a pair of dates
      Parameters:
      date1 - First Date
      date2 - Second Date
      Returns:
      Time-weighted recovery
      Throws:
      java.lang.Exception - Thrown if the recovery cannot be calculated
    • effectiveRecovery

      public double effectiveRecovery​(JulianDate date1, JulianDate date2) throws java.lang.Exception
      Calculate the time-weighted recovery between a pair of dates
      Parameters:
      date1 - First Date
      date2 - Second Date
      Returns:
      Time-weighted recovery
      Throws:
      java.lang.Exception - Thrown if the recovery cannot be calculated
    • effectiveRecovery

      public double effectiveRecovery​(java.lang.String tenor1, java.lang.String tenor2) throws java.lang.Exception
      Calculate the time-weighted recovery between a pair of tenors
      Parameters:
      tenor1 - First Tenor
      tenor2 - Second Tenor
      Returns:
      Time-weighted recovery
      Throws:
      java.lang.Exception - Thrown if the recovery cannot be calculated
    • hazard

      public double hazard​(JulianDate date1, JulianDate date2) throws java.lang.Exception
      Calculate the hazard rate between a pair of forward dates
      Parameters:
      date1 - First Date
      date2 - Second Date
      Returns:
      Hazard Rate
      Throws:
      java.lang.Exception - Thrown if the hazard rate cannot be calculated
    • hazard

      public double hazard​(JulianDate date) throws java.lang.Exception
      Calculate the hazard rate to the given date
      Parameters:
      date - Date
      Returns:
      Hazard Rate
      Throws:
      java.lang.Exception - Thrown if the hazard rate cannot be calculated
    • hazard

      public double hazard​(java.lang.String tenor) throws java.lang.Exception
      Calculate the hazard rate to the given tenor
      Parameters:
      tenor - Tenor
      Returns:
      Hazard Rate
      Throws:
      java.lang.Exception - Thrown if the hazard rate cannot be calculated
    • flatCurve

      public abstract CreditCurve flatCurve​(double flatNodeValue, boolean singleNode, double recovery)
      Create a flat hazard curve from the inputs
      Parameters:
      flatNodeValue - Flat hazard node value
      singleNode - Uses a single node for Calibration (True)
      recovery - (Optional) Recovery to be used in creation of the flat curve
      Returns:
      New CreditCurve instance
    • setInstrCalibInputs

      public void setInstrCalibInputs​(ValuationParams valuationParams, boolean flat, MergedDiscountForwardCurve discountCurve, GovvieCurve govvieCurve, CreditPricerParams creditPricerParams, CalibratableComponent[] calibratableComponentArray, double[] calibrationQuoteArray, java.lang.String[] calibrationMeasureArray, LatentStateFixingsContainer latentStateFixingsContainer, ValuationCustomizationParams valuationCustomizationParams)
      Set the calibration inputs for the CreditCurve
      Parameters:
      valuationParams - Valuation Params
      flat - Flat calibration desired (True)
      discountCurve - Base Discount Curve
      govvieCurve - Govvie Curve
      creditPricerParams - PricerParams
      calibratableComponentArray - Array of calibration instruments
      calibrationQuoteArray - Array of calibration quotes
      calibrationMeasureArray - Array of calibration measures
      latentStateFixingsContainer - Latent State Fixings Container
      valuationCustomizationParams - Quoting Parameters
    • setCCIS

      public boolean setCCIS​(CurveConstructionInputSet curveConstructionInputSet)
      Description copied from interface: Curve
      Set the Curve Construction Input Set Parameters
      Specified by:
      setCCIS in interface Curve
      Parameters:
      curveConstructionInputSet - The Curve Construction Input Set Parameters
      Returns:
      TRUE - Inputs successfully Set
    • calibComp

      public CalibratableComponent[] calibComp()
      Description copied from interface: Curve
      Retrieve the Calibration Components
      Specified by:
      calibComp in interface Curve
      Returns:
      Array of Calibration Components
    • manifestMeasure

      public CaseInsensitiveTreeMap<java.lang.Double> manifestMeasure​(java.lang.String instrument)
      Description copied from interface: Curve
      Retrieve the Manifest Measure Map of the given Instrument used to construct the Curve
      Specified by:
      manifestMeasure in interface Curve
      Parameters:
      instrument - The Calibration Instrument's Code whose Manifest Measure Map is sought
      Returns:
      The Manifest Measure Map of the given Instrument used to construct the Curve