public class ConstantForwardHazard extends CreditCurve
NULL_SER_STRING, VERSION
Constructor and Description |
---|
ConstantForwardHazard(byte[] ab)
CreditCurve de-serialization from input byte array
|
ConstantForwardHazard(double dblStart,
java.lang.String strName,
double[] adblHazardRate,
double[] adblHazardDate,
double[] adblRecoveryRate,
double[] adblRecoveryDate,
double dblSpecificDefaultDate)
Creates a credit curve from hazard rate and recovery rate term structures
|
Modifier and Type | Method and Description |
---|---|
boolean |
buildInterpolator()
Build the interpolator post the curve sweeping build
|
boolean |
bumpNodeValue(int iNodeIndex,
double dblValue)
Bump the node value at the node specified the index by the value
|
double |
calcHazard(JulianDate dt)
Calculates the hazard rate to the given date
|
double |
calcHazard(JulianDate dt1,
JulianDate dt2)
Calculates the hazard rate between a pair of forward dates
|
double |
calcHazard(java.lang.String strTenor)
Calculates the hazard rate to the given tenor
|
CreditCurve |
createFlatCurve(double dblFlatNodeValue,
boolean bSingleNode,
double dblRecovery)
Creates a flat hazard curve from the inputs
|
ConstantForwardHazard |
createParallelHazardShiftedCurve(double dblShift)
Creates a parallel shifted hazard curve
|
ConstantForwardHazard |
createParallelShiftedCurve(double dblShift)
Create a parallel quote shifted curve
|
CreditCurve |
createTweakedCurve(NodeTweakParams ntp)
Create the curve from the tweaked parameters
|
Serializer |
deserialize(byte[] ab)
De-serialize from a byte array.
|
java.lang.String |
displayString()
Get the display String - mostly for informational purposes
|
CalibratableComponent[] |
getCalibComponents()
Retrieve all the calibration components
|
java.lang.String[] |
getCompMeasures()
Retrieve all the calibration measures
|
double[] |
getCompQuotes()
Retrieve all the calibration quotes
|
double |
getEffectiveRecovery(double dblDate1,
double dblDate2)
Calculates the time-weighted recovery between a pair of dates
|
double |
getEffectiveRecovery(JulianDate dt1,
JulianDate dt2)
Calculates the time-weighted recovery between a pair of dates
|
double |
getEffectiveRecovery(java.lang.String strTenor1,
java.lang.String strTenor2)
Calculates the time-weighted recovery between a pair of tenors
|
double |
getEffectiveSurvival(double dblDate1,
double dblDate2)
Calculates the time-weighted survival between a pair of 2 dates
|
double |
getEffectiveSurvival(JulianDate dt1,
JulianDate dt2)
Calculates the time-weighted survival between a pair of 2 dates
|
double |
getEffectiveSurvival(java.lang.String strTenor1,
java.lang.String strTenor2)
Calculates the time-weighted survival between a pair of 2 tenors
|
java.lang.String |
getName()
Gets the curve name
|
JulianDate |
getNodeDate(int iNode)
Get the date at the node specified by the index
|
double |
getQuote(java.lang.String strInstr)
Retrieve the calibration quote of the given instrument
|
double |
getRecovery(double dblDate)
Calculates the recovery rate to the given date
|
double |
getRecovery(JulianDate dt)
Calculates the recovery rate to the given date
|
double |
getRecovery(java.lang.String strTenor)
Calculates the recovery rate to the given tenor
|
JulianDate |
getStartDate()
Get the epoch date
|
double |
getSurvival(double dblDate)
Calculates the survival to the given date
|
double |
getSurvival(JulianDate dt)
Calculates the survival to the given date
|
double |
getSurvival(java.lang.String strTenor)
Calculates the survival to the given tenor
|
boolean |
initializeCalibrationRun(double dblLeftSlope)
Initialize the Calibration Run with the Left Slope
|
static void |
main(java.lang.String[] astrArgs) |
int |
numCalibNodes()
Retrieve the number of calibration nodes
|
byte[] |
serialize()
Serialize into a byte array.
|
boolean |
setFlatValue(double dblValue)
Set the flat value across all the nodes
|
void |
setInstrCalibInputs(ValuationParams valParam,
boolean bFlat,
DiscountCurve dc,
DiscountCurve dcTSY,
DiscountCurve dcEDSF,
PricerParams pricerParam,
CalibratableComponent[] aCalibInst,
double[] adblCalibQuote,
java.lang.String[] astrCalibMeasure,
java.util.Map<JulianDate,CaseInsensitiveTreeMap<java.lang.Double>> mmFixing,
QuotingParams quotingParams)
Sets the calibration inputs for the CreditCurve
|
boolean |
setNodeValue(int iNodeIndex,
double dblValue)
Set the Value/Slope at the Node specified by the Index
|
boolean |
setSpecificDefault(double dblSpecificDefaultDate)
Sets the Specific Default Date
|
boolean |
unsetSpecificDefault()
Removes the Specific Default Date
|
getCollectionKeyValueDelimiter, getCollectionMultiLevelKeyDelimiter, getCollectionRecordDelimiter, getFieldDelimiter, getObjectTrailer
public ConstantForwardHazard(double dblStart, java.lang.String strName, double[] adblHazardRate, double[] adblHazardDate, double[] adblRecoveryRate, double[] adblRecoveryDate, double dblSpecificDefaultDate) throws java.lang.Exception
dblStart
- Curve Epoch datestrName
- Credit Curve NameadblHazardRate
- Matched array of hazard ratesadblHazardDate
- Matched array of hazard datesadblRecoveryRate
- Matched array of recovery ratesadblRecoveryDate
- Matched array of recovery datesdblSpecificDefaultDate
- (Optional) Specific Default Datejava.lang.Exception
- Thrown if inputs are invalidpublic ConstantForwardHazard(byte[] ab) throws java.lang.Exception
ab
- Byte Arrayjava.lang.Exception
- Thrown if CreditCurve cannot be properly de-serializedpublic boolean initializeCalibrationRun(double dblLeftSlope)
Curve
dblLeftSlope
- Left Slopepublic int numCalibNodes()
Curve
public JulianDate getStartDate()
Curve
public void setInstrCalibInputs(ValuationParams valParam, boolean bFlat, DiscountCurve dc, DiscountCurve dcTSY, DiscountCurve dcEDSF, PricerParams pricerParam, CalibratableComponent[] aCalibInst, double[] adblCalibQuote, java.lang.String[] astrCalibMeasure, java.util.Map<JulianDate,CaseInsensitiveTreeMap<java.lang.Double>> mmFixing, QuotingParams quotingParams)
CreditCurve
setInstrCalibInputs
in class CreditCurve
valParam
- ValuationParamsbFlat
- Flat calibration desired (True)dc
- Base Discount CurvedcTSY
- Treasury Discount CurvedcEDSF
- EDSF Discount CurvepricerParam
- PricerParamsaCalibInst
- Array of calibration instrumentsadblCalibQuote
- Array of calibration quotesastrCalibMeasure
- Array of calibration measuresmmFixing
- Fixings objectquotingParams
- Quoting Parameterspublic CalibratableComponent[] getCalibComponents()
Curve
public double[] getCompQuotes()
Curve
public java.lang.String[] getCompMeasures()
Curve
public JulianDate getNodeDate(int iNode)
Curve
iNode
- node indexpublic double getQuote(java.lang.String strInstr) throws java.lang.Exception
Curve
java.lang.Exception
public ConstantForwardHazard createParallelHazardShiftedCurve(double dblShift)
CreditCurve
createParallelHazardShiftedCurve
in class CreditCurve
dblShift
- Shift amountpublic ConstantForwardHazard createParallelShiftedCurve(double dblShift)
Curve
dblShift
- Parallel shiftpublic CreditCurve createFlatCurve(double dblFlatNodeValue, boolean bSingleNode, double dblRecovery)
CreditCurve
createFlatCurve
in class CreditCurve
dblFlatNodeValue
- Flat hazard node valuebSingleNode
- Uses a single node for Calibration (True)dblRecovery
- (Optional) Recovery to be used in creation of the flat curvepublic java.lang.String getName()
Curve
public boolean setNodeValue(int iNodeIndex, double dblValue)
Curve
iNodeIndex
- Node IndexdblValue
- Node Valuepublic boolean bumpNodeValue(int iNodeIndex, double dblValue)
Curve
iNodeIndex
- node indexdblValue
- node bump valuepublic boolean setFlatValue(double dblValue)
Curve
dblValue
- node valuepublic CreditCurve createTweakedCurve(NodeTweakParams ntp)
Curve
ntp
- Node Tweak Parameterspublic boolean setSpecificDefault(double dblSpecificDefaultDate)
CreditCurve
setSpecificDefault
in class CreditCurve
dblSpecificDefaultDate
- Date of Specific Defaultpublic boolean unsetSpecificDefault()
CreditCurve
unsetSpecificDefault
in class CreditCurve
public double getSurvival(double dblDate) throws java.lang.Exception
CreditCurve
getSurvival
in class CreditCurve
dblDate
- Datejava.lang.Exception
- Thrown if the survival probability cannot be calculatedpublic double getSurvival(JulianDate dt) throws java.lang.Exception
CreditCurve
getSurvival
in class CreditCurve
dt
- Datejava.lang.Exception
- Thrown if the survival probability cannot be calculatedpublic double getSurvival(java.lang.String strTenor) throws java.lang.Exception
CreditCurve
getSurvival
in class CreditCurve
strTenor
- Tenorjava.lang.Exception
- Thrown if the survival probability cannot be calculatedpublic double getEffectiveSurvival(double dblDate1, double dblDate2) throws java.lang.Exception
CreditCurve
getEffectiveSurvival
in class CreditCurve
dblDate1
- First DatedblDate2
- Second Datejava.lang.Exception
- Thrown if the survival probability cannot be calculatedpublic double getEffectiveSurvival(JulianDate dt1, JulianDate dt2) throws java.lang.Exception
CreditCurve
getEffectiveSurvival
in class CreditCurve
dt1
- First Datedt2
- Second Datejava.lang.Exception
- Thrown if the survival probability cannot be calculatedpublic double getEffectiveSurvival(java.lang.String strTenor1, java.lang.String strTenor2) throws java.lang.Exception
CreditCurve
getEffectiveSurvival
in class CreditCurve
strTenor1
- First tenorstrTenor2
- Second tenorjava.lang.Exception
- Thrown if the survival probability cannot be calculatedpublic double calcHazard(JulianDate dt1, JulianDate dt2) throws java.lang.Exception
CreditCurve
calcHazard
in class CreditCurve
dt1
- First Datedt2
- Second Datejava.lang.Exception
- Thrown if the hazard rate cannot be calculatedpublic double calcHazard(JulianDate dt) throws java.lang.Exception
CreditCurve
calcHazard
in class CreditCurve
dt
- Datejava.lang.Exception
- Thrown if the hazard rate cannot be calculatedpublic double calcHazard(java.lang.String strTenor) throws java.lang.Exception
CreditCurve
calcHazard
in class CreditCurve
strTenor
- Tenorjava.lang.Exception
- Thrown if the hazard rate cannot be calculatedpublic double getRecovery(double dblDate) throws java.lang.Exception
CreditCurve
getRecovery
in class CreditCurve
dblDate
- Datejava.lang.Exception
- Thrown if the Recovery rate cannot be calculatedpublic double getRecovery(JulianDate dt) throws java.lang.Exception
CreditCurve
getRecovery
in class CreditCurve
dt
- Datejava.lang.Exception
- Thrown if the Recovery rate cannot be calculatedpublic double getRecovery(java.lang.String strTenor) throws java.lang.Exception
CreditCurve
getRecovery
in class CreditCurve
strTenor
- Tenorjava.lang.Exception
- Thrown if the Recovery rate cannot be calculatedpublic double getEffectiveRecovery(double dblDate1, double dblDate2) throws java.lang.Exception
CreditCurve
getEffectiveRecovery
in class CreditCurve
dblDate1
- First DatedblDate2
- Second Datejava.lang.Exception
- Thrown if the recovery cannot be calculatedpublic double getEffectiveRecovery(JulianDate dt1, JulianDate dt2) throws java.lang.Exception
CreditCurve
getEffectiveRecovery
in class CreditCurve
dt1
- First Datedt2
- Second Datejava.lang.Exception
- Thrown if the recovery cannot be calculatedpublic double getEffectiveRecovery(java.lang.String strTenor1, java.lang.String strTenor2) throws java.lang.Exception
CreditCurve
getEffectiveRecovery
in class CreditCurve
strTenor1
- First TenorstrTenor2
- Second Tenorjava.lang.Exception
- Thrown if the recovery cannot be calculatedpublic byte[] serialize()
Serializer
serialize
in class Serializer
public Serializer deserialize(byte[] ab)
Serializer
deserialize
in class Serializer
public java.lang.String displayString()
Curve
public boolean buildInterpolator()
Curve
public static void main(java.lang.String[] astrArgs) throws java.lang.Exception
java.lang.Exception