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.Stringcurrency()Get the CurrencydoubleeffectiveRecovery(int date1, int date2)Calculate the time-weighted recovery between a pair of datesdoubleeffectiveRecovery(java.lang.String tenor1, java.lang.String tenor2)Calculate the time-weighted recovery between a pair of tenorsdoubleeffectiveRecovery(JulianDate date1, JulianDate date2)Calculate the time-weighted recovery between a pair of datesdoubleeffectiveSurvival(int date1, int date2)Calculate the time-weighted survival between a pair of 2 datesdoubleeffectiveSurvival(java.lang.String tenor1, java.lang.String tenor2)Calculate the time-weighted survival between a pair of 2 tenorsdoubleeffectiveSurvival(JulianDate date1, JulianDate date2)Calculate the time-weighted survival between a pair of 2 datesJulianDateepoch()Get the Epoch Dateabstract CreditCurveflatCurve(double flatNodeValue, boolean singleNode, double recovery)Create a flat hazard curve from the inputsdoublehazard(java.lang.String tenor)Calculate the hazard rate to the given tenordoublehazard(JulianDate date)Calculate the hazard rate to the given datedoublehazard(JulianDate date1, JulianDate date2)Calculate the hazard rate between a pair of forward datesLatentStateLabellabel()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 doublerecovery(int date)Calculate the recovery rate to the given datedoublerecovery(java.lang.String tenor)Calculate the recovery rate to the given tenordoublerecovery(JulianDate date)Calculate the recovery rate to the given datebooleansetCCIS(CurveConstructionInputSet curveConstructionInputSet)Set the Curve Construction Input Set ParametersvoidsetInstrCalibInputs(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 CreditCurvebooleansetSpecificDefault(int specificDefaultDate)Set the Specific Default Dateabstract doublesurvival(int date)Calculate the survival to the given datedoublesurvival(java.lang.String tenor)Calculate the survival to the given tenordoublesurvival(JulianDate dt)Calculate the survival to the given datebooleanunsetSpecificDefault()Remove the Specific Default DateMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.drip.state.representation.LatentState
customTweakManifestMeasure, customTweakQuantificationMetric, parallelShiftManifestMeasure, parallelShiftQuantificationMetric, shiftManifestMeasure
-
Method Details
-
label
Description copied from interface:CurveGet the Curve Latent State Identifier Label -
currency
public java.lang.String currency()Description copied from interface:CurveGet the Currency -
epoch
Description copied from interface:CurveGet 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:CurveSet the Curve Construction Input Set Parameters -
calibComp
Description copied from interface:CurveRetrieve the Calibration Components -
manifestMeasure
Description copied from interface:CurveRetrieve the Manifest Measure Map of the given Instrument used to construct the Curve- Specified by:
manifestMeasurein 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
-