Package org.drip.product.credit
Class BondComponent.BondCalibrator
java.lang.Object
org.drip.product.credit.BondComponent.BondCalibrator
- Enclosing class:
- BondComponent
public class BondComponent.BondCalibrator
extends java.lang.Object
The BondCalibrator implements a calibrator that calibrates the yield, the credit basis, or the Z
Spread for the bond given the price input. Calibration happens via either Newton-Raphson method,
or via bracketing/root searching.
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description BondCalibrator(BondComponent bond, boolean bApplyCouponExtension)
Constructor: Construct the calibrator from the parent bond. -
Method Summary
Modifier and Type Method Description double
calibDiscCurveSpreadFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, int iWorkoutDate, double dblWorkoutFactor, double dblPrice)
Calibrate the bond Z Spread from the market price.double
calibrateCreditBasisFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, int iWorkoutDate, double dblWorkoutFactor, double dblPrice, boolean bFlat)
Calibrate the bond Credit Basis from the market pricedouble
calibrateOASFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, int iZeroCurveBaseDC, int iWorkoutDate, double dblWorkoutFactor, double dblPrice)
Calibrate the Bond OAS from the Market Price using the Root Bracketing Technique.double
calibrateYieldFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, int iWorkoutDate, double dblWorkoutFactor, double dblPrice)
Calibrate the bond yield from the market price using the root bracketing technique.double
calibrateZSpreadFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, int iZeroCurveBaseDC, int iWorkoutDate, double dblWorkoutFactor, double dblPrice)
Calibrate the bond Z Spread from the market price using the root bracketing technique.double
calibZeroCurveSpreadFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, int iWorkoutDate, double dblWorkoutFactor, double dblPrice)
Calibrate the bond Z Spread from the market price.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
BondCalibrator
public BondCalibrator(BondComponent bond, boolean bApplyCouponExtension) throws java.lang.ExceptionConstructor: Construct the calibrator from the parent bond.- Parameters:
bond
- ParentbApplyCouponExtension
- TRUE - Apply the Coupon Extension- Throws:
java.lang.Exception
- Thrown if the inputs are invalid
-
-
Method Details
-
calibrateYieldFromPrice
public double calibrateYieldFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, int iWorkoutDate, double dblWorkoutFactor, double dblPrice) throws java.lang.ExceptionCalibrate the bond yield from the market price using the root bracketing technique.- Parameters:
valParams
- Valuation Parameterscsqs
- Bond Market Parametersvcp
- Valuation Customization ParametersiWorkoutDate
- JulianDate Work-outdblWorkoutFactor
- Work-out factordblPrice
- Price to be calibrated to- Returns:
- The calibrated Yield
- Throws:
java.lang.Exception
- Thrown if the yield cannot be calibrated
-
calibrateZSpreadFromPrice
public double calibrateZSpreadFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, int iZeroCurveBaseDC, int iWorkoutDate, double dblWorkoutFactor, double dblPrice) throws java.lang.ExceptionCalibrate the bond Z Spread from the market price using the root bracketing technique.- Parameters:
valParams
- Valuation Parameterscsqs
- Bond Market Parametersvcp
- Valuation Customization ParametersiZeroCurveBaseDC
- The Discount Curve to derive the zero curve off ofiWorkoutDate
- JulianDate Work-outdblWorkoutFactor
- Work-out factordblPrice
- Price to be calibrated to- Returns:
- The calibrated Z Spread
- Throws:
java.lang.Exception
- Thrown if the Z Spread cannot be calibrated
-
calibrateOASFromPrice
public double calibrateOASFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, ValuationCustomizationParams vcp, int iZeroCurveBaseDC, int iWorkoutDate, double dblWorkoutFactor, double dblPrice) throws java.lang.ExceptionCalibrate the Bond OAS from the Market Price using the Root Bracketing Technique.- Parameters:
valParams
- Valuation Parameterscsqs
- Bond Market Parametersvcp
- Valuation Customization ParametersiZeroCurveBaseDC
- The Discount Curve to derive the zero curve off ofiWorkoutDate
- JulianDate Work-outdblWorkoutFactor
- Work-out factordblPrice
- Price to be calibrated to- Returns:
- The Calibrated OAS
- Throws:
java.lang.Exception
- Thrown if the OAS cannot be calibrated
-
calibDiscCurveSpreadFromPrice
public double calibDiscCurveSpreadFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, int iWorkoutDate, double dblWorkoutFactor, double dblPrice) throws java.lang.ExceptionCalibrate the bond Z Spread from the market price. Calibration is done by bumping the discount curve.- Parameters:
valParams
- Valuation Parameterscsqs
- Bond Market ParametersiWorkoutDate
- JulianDate Work-outdblWorkoutFactor
- Work-out factordblPrice
- Price to be calibrated to- Returns:
- The calibrated Z Spread
- Throws:
java.lang.Exception
- Thrown if the yield cannot be calibrated
-
calibZeroCurveSpreadFromPrice
public double calibZeroCurveSpreadFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, int iWorkoutDate, double dblWorkoutFactor, double dblPrice) throws java.lang.ExceptionCalibrate the bond Z Spread from the market price. Calibration is done by bumping the Zero Curve.- Parameters:
valParams
- Valuation Parameterscsqs
- Bond Market ParametersiWorkoutDate
- JulianDate Work-outdblWorkoutFactor
- Work-out factordblPrice
- Price to be calibrated to- Returns:
- The calibrated Z Spread
- Throws:
java.lang.Exception
- Thrown if the yield cannot be calibrated
-
calibrateCreditBasisFromPrice
public double calibrateCreditBasisFromPrice(ValuationParams valParams, CurveSurfaceQuoteContainer csqs, int iWorkoutDate, double dblWorkoutFactor, double dblPrice, boolean bFlat) throws java.lang.ExceptionCalibrate the bond Credit Basis from the market price- Parameters:
valParams
- Valuation Parameterscsqs
- Bond Market ParametersiWorkoutDate
- JulianDate Work-outdblWorkoutFactor
- Work-out factordblPrice
- Price to be calibrated tobFlat
- TRUE - Calibrate to Flat Curve- Returns:
- The calibrated Credit Basis
- Throws:
java.lang.Exception
- Thrown if the Credit Basis cannot be calibrated
-