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 Details

    • BondCalibrator

      public BondCalibrator​(BondComponent bond, boolean bApplyCouponExtension) throws java.lang.Exception
      Constructor: Construct the calibrator from the parent bond.
      Parameters:
      bond - Parent
      bApplyCouponExtension - 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.Exception
      Calibrate the bond yield from the market price using the root bracketing technique.
      Parameters:
      valParams - Valuation Parameters
      csqs - Bond Market Parameters
      vcp - Valuation Customization Parameters
      iWorkoutDate - JulianDate Work-out
      dblWorkoutFactor - Work-out factor
      dblPrice - 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.Exception
      Calibrate the bond Z Spread from the market price using the root bracketing technique.
      Parameters:
      valParams - Valuation Parameters
      csqs - Bond Market Parameters
      vcp - Valuation Customization Parameters
      iZeroCurveBaseDC - The Discount Curve to derive the zero curve off of
      iWorkoutDate - JulianDate Work-out
      dblWorkoutFactor - Work-out factor
      dblPrice - 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.Exception
      Calibrate the Bond OAS from the Market Price using the Root Bracketing Technique.
      Parameters:
      valParams - Valuation Parameters
      csqs - Bond Market Parameters
      vcp - Valuation Customization Parameters
      iZeroCurveBaseDC - The Discount Curve to derive the zero curve off of
      iWorkoutDate - JulianDate Work-out
      dblWorkoutFactor - Work-out factor
      dblPrice - 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.Exception
      Calibrate the bond Z Spread from the market price. Calibration is done by bumping the discount curve.
      Parameters:
      valParams - Valuation Parameters
      csqs - Bond Market Parameters
      iWorkoutDate - JulianDate Work-out
      dblWorkoutFactor - Work-out factor
      dblPrice - 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.Exception
      Calibrate the bond Z Spread from the market price. Calibration is done by bumping the Zero Curve.
      Parameters:
      valParams - Valuation Parameters
      csqs - Bond Market Parameters
      iWorkoutDate - JulianDate Work-out
      dblWorkoutFactor - Work-out factor
      dblPrice - 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.Exception
      Calibrate the bond Credit Basis from the market price
      Parameters:
      valParams - Valuation Parameters
      csqs - Bond Market Parameters
      iWorkoutDate - JulianDate Work-out
      dblWorkoutFactor - Work-out factor
      dblPrice - Price to be calibrated to
      bFlat - TRUE - Calibrate to Flat Curve
      Returns:
      The calibrated Credit Basis
      Throws:
      java.lang.Exception - Thrown if the Credit Basis cannot be calibrated