Bond Yield Curve Related Functions
About 2 min
Bond Yield Curve Related Functions
Visit the Mathema Option Pricing System for foreign exchange options and structured product valuation!
Construction Functions
Excel: =McpFixedRateBondCurveData(args1, args2, args3, args4, args5, fmt='VP|HD')
Python: McpFixedRateBondCurveData(*args)
- Function: Constructs a bond yield curve.
- Parameters:
args1~args5 or *args: Parameter groups.SettlementDate: Settlement date.MaturityDates: Array of maturity dates.Frequencies: Array of payment frequencies.Coupons: Array of coupon rates.YieldsOrDirtyPrice: Array of yields or dirty prices.DayCounter: Day count convention (enumeration value).IsYield: Boolean indicating whether the input is yield (True) or dirty price (False).BumpAmounts: Array of coupon adjustments (e.g.,0.01means adding0.01to all coupons).BUses: Array indicating whether to use the corresponding data row (YorN).Calendar: Holiday calendar object.fmt: Parameter format (default isVP|HD),Excel-specific parameters.
- Returns: Bond yield curve object.
Excel: =McpBondCurve(args1, args2, args3, args4, args5, fmt='VP|HD')
Python: McpBondCurve(*args)
- Function: Constructs a bond yield curve.
- Parameters:
args1~args5 or *args: Parameter groups, supporting two input methods:- First Method:
SettlementDate: Settlement date.Mode: Mode (default isfrb).InterpolatedVariable: Interest type (enumeration value).InterpolationMethod: Interpolation method (enumeration value).DayCounter: Day count convention (enumeration value).MaturityDates: Array of maturity dates.Frequencies: Array of payment frequencies.Coupons: Array of coupon rates.YieldsOrDirtyPrice: Array of yields or dirty prices.IsYield: Boolean indicating whether the input is yield (True) or dirty price (False).BumpAmounts: Array of coupon adjustments.BUses: Array indicating whether to use the corresponding data row (YorN).Calendar: Holiday calendar object.
- Second Method:
SettlementDate: Settlement date.CalibrationSet: Asset portfolio for curve construction (e.g., a set of VanillaSwap or Depo).InterpolatedVariable: Interest type (enumeration value).InterpolationMethod: Interpolation method (enumeration value).DayCounter: Day count convention (enumeration value).
- First Method:
fmt: Parameter format (default isVP|HD),Excel-specific parameters.
- Returns: Bond yield curve object.
Excel: =McpBondCurve2(args1, args2, args3, args4, args5)
- Function: Constructs a BondCurve object.
- Parameters:
args1~args5: Parameter groups.SettlementDate: Settlement date.InterpolatedVariable: Interest type (enumeration value).InterpolationMethod: Interpolation method (enumeration value).DayCounter: Day count convention (enumeration value).CalibrationSet: Asset portfolio object.
- Returns: BondCurve object.
Excel: =McpCalibrationSet(args)
- Function: Used to store an asset portfolio of different products (e.g., Depo, Swap, Bond) during curve construction.
- Parameters:
args: Different interest rate products.
- Returns: Asset portfolio object.
Parametric Curve Related Functions
Construction Functions
Excel: =McpParametricCurve(args1, args2, args3, args4, args5, fmt='VP|HD')
Python: McpParametricCurve(*args)
- Function: Constructs parametric curves such as NSS, NS, and CIR.
- Parameters:
args1~args5 or *args: Parameter groups, supporting two input methods:- First Method:
ReferenceDate: Reference date.MaturityDates: Array of maturity dates.Rates: Array of rates.ParamCurveModel: Curve model (e.g.,NS,NSS,CIR, default isNS).DayCounter: Day count convention (default isAct365Fixed).
- Second Method:
ReferenceDate: Reference date.MaturityDate: Array of maturity dates.Yield: Array of yields.ParamCurveModel: Curve model (e.g.,NS,NSS,CIR, default isNS).DayCounter: Day count convention (default isAct365Fixed).
- First Method:
fmt: Parameter format (default isVP),Excel-specific parameters.
- Returns: Parametric curve object.
Utility Functions
Excel: =YieldCurveZeroRate(Curve, Date)
Python: ZeroRate(endDate)
- Function: Retrieves the zero rate for a specified date from the yield curve.
- Parameters:
Curve: Yield curve object,Python API does not require this parameter.Date: Target date.
- Returns: Zero rate value.
Excel: =YieldCurveDiscountFactor(Curve, Date)
Python: DiscountFactor(*args)
- Function: Retrieves the discount factor for a specified date from the yield curve.
- Parameters:
Curve: Yield curve object.Date: Target date.*args:is a dictionary, does not require the Curve parameter, other parameters are the same as those in Excel.
- Returns: Discount factor.
Excel: =YieldCurveForwardRate(Curve, startDate, endDate, dayCounter=DayCounter.Act365Fixed, compounding=False, frequency=Frequency.NoFrequency)
Python: ForwardRate(startDate, endDate, dayCounter, compounding, frequency)
- Function: Retrieves the forward rate from the yield curve.
- Parameters:
Curve: Yield curve object,Python API does not require this parameter.startDate: Start date.endDate: End date.dayCounter: Day count convention (default isAct365Fixed).compounding: Boolean indicating whether to use compounding (default isFalse).frequency: Compounding frequency (default isNoFrequency).
- Returns: Forward rate.
Notes
- Parameter Format: The
fmtparameter specifies the parameter format, with a default value ofVPorVP|HD. - Enumeration Values: Some parameters (e.g.,
DayCounter,ParamCurveModel) are enumeration values; refer to specific definitions for details. - Default Values: Parameters not explicitly stated usually have default values, which can be adjusted as needed.
