Package org.drip.state.credit
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 Summary
Modifier and Type Method Description CalibratableComponent[]
calibComp()
Retrieve the Calibration Componentsjava.lang.String
currency()
Get the Currencydouble
effectiveRecovery(int date1, int date2)
Calculate the time-weighted recovery between a pair of datesdouble
effectiveRecovery(java.lang.String tenor1, java.lang.String tenor2)
Calculate the time-weighted recovery between a pair of tenorsdouble
effectiveRecovery(JulianDate date1, JulianDate date2)
Calculate the time-weighted recovery between a pair of datesdouble
effectiveSurvival(int date1, int date2)
Calculate the time-weighted survival between a pair of 2 datesdouble
effectiveSurvival(java.lang.String tenor1, java.lang.String tenor2)
Calculate the time-weighted survival between a pair of 2 tenorsdouble
effectiveSurvival(JulianDate date1, JulianDate date2)
Calculate the time-weighted survival between a pair of 2 datesJulianDate
epoch()
Get the Epoch Dateabstract CreditCurve
flatCurve(double flatNodeValue, boolean singleNode, double recovery)
Create a flat hazard curve from the inputsdouble
hazard(java.lang.String tenor)
Calculate the hazard rate to the given tenordouble
hazard(JulianDate date)
Calculate the hazard rate to the given datedouble
hazard(JulianDate date1, JulianDate date2)
Calculate the hazard rate between a pair of forward datesLatentStateLabel
label()
Get the Curve Latent State Identifier LabelCaseInsensitiveTreeMap<java.lang.Double>
manifestMeasure(java.lang.String instrument)
Retrieve the Manifest Measure Map of the given Instrument used to construct the Curveabstract double
recovery(int date)
Calculate the recovery rate to the given datedouble
recovery(java.lang.String tenor)
Calculate the recovery rate to the given tenordouble
recovery(JulianDate date)
Calculate the recovery rate to the given dateboolean
setCCIS(CurveConstructionInputSet curveConstructionInputSet)
Set the Curve Construction Input Set Parametersvoid
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 CreditCurveboolean
setSpecificDefault(int specificDefaultDate)
Set the Specific Default Dateabstract double
survival(int date)
Calculate the survival to the given datedouble
survival(java.lang.String tenor)
Calculate the survival to the given tenordouble
survival(JulianDate dt)
Calculate the survival to the given dateboolean
unsetSpecificDefault()
Remove the Specific Default DateMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.drip.state.representation.LatentState
customTweakManifestMeasure, customTweakQuantificationMetric, parallelShiftManifestMeasure, parallelShiftQuantificationMetric, shiftManifestMeasure
-
Method Details
-
label
Description copied from interface:Curve
Get the Curve Latent State Identifier Label -
currency
public java.lang.String currency()Description copied from interface:Curve
Get the Currency -
epoch
Description copied from interface:Curve
Get 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.ExceptionCalculate 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
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.ExceptionCalculate 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.ExceptionCalculate the time-weighted survival between a pair of 2 dates- Parameters:
date1
- First Datedate2
- Second Date- Returns:
- Survival Probability
- Throws:
java.lang.Exception
- Thrown if the survival probability cannot be calculated
-
effectiveSurvival
Calculate the time-weighted survival between a pair of 2 dates- Parameters:
date1
- First Datedate2
- 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.ExceptionCalculate the time-weighted survival between a pair of 2 tenors- Parameters:
tenor1
- First tenortenor2
- 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.ExceptionCalculate 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
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.ExceptionCalculate 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.ExceptionCalculate the time-weighted recovery between a pair of dates- Parameters:
date1
- First Datedate2
- Second Date- Returns:
- Time-weighted recovery
- Throws:
java.lang.Exception
- Thrown if the recovery cannot be calculated
-
effectiveRecovery
Calculate the time-weighted recovery between a pair of dates- Parameters:
date1
- First Datedate2
- 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.ExceptionCalculate the time-weighted recovery between a pair of tenors- Parameters:
tenor1
- First Tenortenor2
- Second Tenor- Returns:
- Time-weighted recovery
- Throws:
java.lang.Exception
- Thrown if the recovery cannot be calculated
-
hazard
Calculate the hazard rate between a pair of forward dates- Parameters:
date1
- First Datedate2
- Second Date- Returns:
- Hazard Rate
- Throws:
java.lang.Exception
- Thrown if the hazard rate cannot be calculated
-
hazard
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.ExceptionCalculate 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
Create a flat hazard curve from the inputs- Parameters:
flatNodeValue
- Flat hazard node valuesingleNode
- 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 Paramsflat
- Flat calibration desired (True)discountCurve
- Base Discount CurvegovvieCurve
- Govvie CurvecreditPricerParams
- PricerParamscalibratableComponentArray
- Array of calibration instrumentscalibrationQuoteArray
- Array of calibration quotescalibrationMeasureArray
- Array of calibration measureslatentStateFixingsContainer
- Latent State Fixings ContainervaluationCustomizationParams
- Quoting Parameters
-
setCCIS
Description copied from interface:Curve
Set the Curve Construction Input Set Parameters -
calibComp
Description copied from interface:Curve
Retrieve the Calibration Components -
manifestMeasure
Description copied from interface:Curve
Retrieve the Manifest Measure Map of the given Instrument used to construct the Curve- Specified by:
manifestMeasure
in interfaceCurve
- 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
-