java.lang.Object
net.finmath.marketdata.products.AbstractAnalyticProduct
net.finmath.marketdata.model.bond.Bond
- All Implemented Interfaces:
AnalyticProduct
,Product
Implements the valuation of a bond (zero-coupon, fixed coupon or floating coupon)
with unit notional of 1 using curves:
- a forward curve, if the bond has floating rate coupons
- a discount curve as a base curve for discounting
- a survival probability curve for additional credit risk related discount factor
- a basis factor curve for additional bond related discount factor
Schedule
.
The effective bond curve is a combination of the discount curve (risk free curve), the basis factor curve
(which could be considers as an additional industry specific factor) and the issuer specific
survival probalbilty. The effective discount factor is the product of the three:
discountFactor * survivalProbabilityFactor * basisFactorFactor
You may set the arguments for the survival probability curve and the basis factor curve to null.- Version:
- 1.1
- Author:
- Moritz Scherrmann, Chrisitan Fries
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a fixed coupon bond using a single discount curve only.Bond(Schedule schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon)
Creates a fixed coupon bond without recovery rate.Bond(Schedule schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double recoveryRate)
Creates a fixed coupon bond with recovery rate.Bond(Schedule schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread)
Creates a fixed or floating bond without recovery rate.Bond(Schedule schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread, double recoveryRate)
Creates a bond. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getAccruedInterest(double time, AnalyticModel model)
Returns the accrued interest of the bond for a given time.double
getAccruedInterest(LocalDate date, AnalyticModel model)
Returns the accrued interest of the bond for a given date.double
getCouponPayment(int periodIndex, AnalyticModel model)
Returns the coupon payment of the period with the given index.double
double
double
double
getSpread(double bondPrice, Curve referenceCurve, AnalyticModel model)
Returns the spread value such that the sum of cash flows of the bond discounted with a given reference curve with the additional spread coincides with a given price.double
getValue(double evaluationTime, AnalyticModel model)
Return the valuation of the product using the given model.double
getValueWithGivenSpreadOverCurve(double evaluationTime, Curve referenceCurve, double spread, AnalyticModel model)
Returns the value of the sum of discounted cash flows of the bond where the discounting is done with the given reference curve and an additional spread.double
getValueWithGivenYield(double evaluationTime, double rate, AnalyticModel model)
Returns the value of the sum of discounted cash flows of the bond where the discounting is done with the given yield curve.double
getYield(double bondPrice, AnalyticModel model)
Returns the yield value such that the sum of cash flows of the bond discounted with the yield curve coincides with a given price.toString()
Methods inherited from class net.finmath.marketdata.products.AbstractAnalyticProduct
getValue, getValue
-
Constructor Details
-
Bond
public Bond(Schedule schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread, double recoveryRate)Creates a bond.- Parameters:
schedule
- ScheduleFromPeriods of the bond.discountCurveName
- Name of the discount curve.forwardCurveName
- Name of the forward curve, leave empty if this is a fix coupon bond or a zero-coupon bond.survivalProbabilityCurveName
- Name of the survival probability curve.basisFactorCurveName
- Name of the basis factor curve.fixedCoupon
- The fixed coupon of the bond expressed as absolute value.floatingSpread
- The floating spread of the bond expressed as absolute value.recoveryRate
- The recovery rate of the bond.
-
Bond
public Bond(Schedule schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double recoveryRate)Creates a fixed coupon bond with recovery rate.- Parameters:
schedule
- ScheduleFromPeriods of the bond.discountCurveName
- Name of the discount curve.survivalProbabilityCurveName
- Name of the survival probability curve.basisFactorCurveName
- Name of the basis factor curve.fixedCoupon
- The fixed coupon of the bond expressed as absolute value.recoveryRate
- The recovery rate of the bond.
-
Bond
public Bond(Schedule schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread)Creates a fixed or floating bond without recovery rate.- Parameters:
schedule
- ScheduleFromPeriods of the bond.discountCurveName
- Name of the discount curve.forwardCurveName
- Name of the forward curve, leave empty if this is a fix coupon bond or a zero-coupon bond.survivalProbabilityCurveName
- Name of the survival probability curve.basisFactorCurveName
- Name of the basis factor curve.fixedCoupon
- The fixed coupon of the bond expressed as absolute value.floatingSpread
- The floating spread of the bond expressed as absolute value.
-
Bond
public Bond(Schedule schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon)Creates a fixed coupon bond without recovery rate.- Parameters:
schedule
- ScheduleFromPeriods of the bond.discountCurveName
- Name of the discount curve.survivalProbabilityCurveName
- Name of the survival probability curve.basisFactorCurveName
- Name of the basis factor curve.fixedCoupon
- The fixed coupon of the bond expressed as absolute value.
-
Bond
Creates a fixed coupon bond using a single discount curve only.- Parameters:
schedule
- ScheduleFromPeriods of the bond.discountCurveName
- Name of the discount curve.fixedCoupon
- The fixed coupon of the bond expressed as absolute value.
-
-
Method Details
-
getValue
Description copied from interface:AnalyticProduct
Return the valuation of the product using the given model. The model has to implement the modes ofAnalyticModel
.- Specified by:
getValue
in interfaceAnalyticProduct
- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.model
- The model under which the product is valued.- Returns:
- The value of the product using the given model.
-
getCouponPayment
Returns the coupon payment of the period with the given index. The analytic model is needed in case of floating bonds.- Parameters:
periodIndex
- The index of the period of interest.model
- The model under which the product is valued.- Returns:
- The value of the coupon payment in the given period.
-
getValueWithGivenSpreadOverCurve
public double getValueWithGivenSpreadOverCurve(double evaluationTime, Curve referenceCurve, double spread, AnalyticModel model)Returns the value of the sum of discounted cash flows of the bond where the discounting is done with the given reference curve and an additional spread. This method can be used for optimizer.- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.referenceCurve
- The reference curve used for discounting the coupon payments.spread
- The spread which should be added to the discount curve.model
- The model under which the product is valued.- Returns:
- The value of the bond for the given curve and spread.
-
getValueWithGivenYield
Returns the value of the sum of discounted cash flows of the bond where the discounting is done with the given yield curve. This method can be used for optimizer.- Parameters:
evaluationTime
- The evaluation time as double. Cash flows prior and including this time are not considered.rate
- The yield which is used for discounted the coupon payments.model
- The model under which the product is valued.- Returns:
- The value of the bond for the given yield.
-
getSpread
Returns the spread value such that the sum of cash flows of the bond discounted with a given reference curve with the additional spread coincides with a given price.- Parameters:
bondPrice
- The target price as double.referenceCurve
- The reference curve used for discounting the coupon payments.model
- The model under which the product is valued.- Returns:
- The optimal spread value.
-
getYield
Returns the yield value such that the sum of cash flows of the bond discounted with the yield curve coincides with a given price.- Parameters:
bondPrice
- The target price as double.model
- The model under which the product is valued.- Returns:
- The optimal yield value.
-
getAccruedInterest
Returns the accrued interest of the bond for a given date.- Parameters:
date
- The date of interest.model
- The model under which the product is valued.- Returns:
- The accrued interest.
-
getAccruedInterest
Returns the accrued interest of the bond for a given time.- Parameters:
time
- The time of interest as double.model
- The model under which the product is valued.- Returns:
- The accrued interest.
-
getSchedule
-
getDiscountCurveName
-
getForwardCurveName
-
getSurvivalProbabilityCurveName
-
getBasisFactorCurveName
-
getFixedCoupon
public double getFixedCoupon() -
getFloatingSpread
public double getFloatingSpread() -
getRecoveryRate
public double getRecoveryRate() -
toString
-