Skip navigation links
finMath lib documentation
net.finmath.marketdata.model.bond

## Class Bond

• All Implemented Interfaces:
AnalyticProductInterface, Product

public class Bond
extends AbstractAnalyticProduct
implements AnalyticProductInterface
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
Support for day counting is provided via the class implementing ScheduleInterface.
Author:
Moritz Scherrmann, Chrisitan Fries
• ### Constructor Summary

Constructors
Constructor and Description
Bond(ScheduleInterface schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon)
Creates a fixed coupon bond without recovery rate.
Bond(ScheduleInterface schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double recoveryRate)
Creates a fixed coupon bond with recovery rate.
Bond(ScheduleInterface schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread)
Creates a fixed or floating bond without recovery rate.
Bond(ScheduleInterface schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread, double recoveryRate)
Creates a bond.
• ### Method Summary

All Methods
Modifier and Type Method and Description
double getAccruedInterest(double time, AnalyticModelInterface model)
Returns the accrued interest of the bond for a given time.
double getAccruedInterest(LocalDate date, AnalyticModelInterface model)
Returns the accrued interest of the bond for a given date.
String getBasisFactorCurveName()
double getCouponPayment(int periodIndex, AnalyticModelInterface model)
Returns the coupon payment of the period with the given index.
String getDiscountCurveName()
double getFixedCoupon()
double getFloatingSpread()
String getForwardCurveName()
double getRecoveryRate()
ScheduleInterface getSchedule()
double getSpread(double bondPrice, CurveInterface referenceCurve, AnalyticModelInterface 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.
String getSurvivalProbabilityCurveName()
double getValue(double evaluationTime, AnalyticModelInterface model)
Return the valuation of the product using the given model.
double getValueWithGivenSpreadOverCurve(double evaluationTime, CurveInterface referenceCurve, double spread, AnalyticModelInterface 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, AnalyticModelInterface 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, AnalyticModelInterface 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.
String toString()
• ### Methods inherited from class net.finmath.marketdata.products.AbstractAnalyticProduct

getValue, getValue
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
• ### Methods inherited from interface net.finmath.modelling.Product

getDescriptor, getValue, getValues
• ### Constructor Detail

• #### Bond

public Bond(ScheduleInterface schedule,
String discountCurveName,
String forwardCurveName,
String survivalProbabilityCurveName,
String basisFactorCurveName,
double fixedCoupon,
double floatingSpread,
double recoveryRate)
Creates a bond.
Parameters:
schedule - Schedule 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(ScheduleInterface schedule,
String discountCurveName,
String survivalProbabilityCurveName,
String basisFactorCurveName,
double fixedCoupon,
double recoveryRate)
Creates a fixed coupon bond with recovery rate.
Parameters:
schedule - Schedule 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(ScheduleInterface schedule,
String discountCurveName,
String forwardCurveName,
String survivalProbabilityCurveName,
String basisFactorCurveName,
double fixedCoupon,
double floatingSpread)
Creates a fixed or floating bond without recovery rate.
Parameters:
schedule - Schedule 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(ScheduleInterface schedule,
String discountCurveName,
String survivalProbabilityCurveName,
String basisFactorCurveName,
double fixedCoupon)
Creates a fixed coupon bond without recovery rate.
Parameters:
schedule - Schedule 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.
• ### Method Detail

• #### getValue

public double getValue(double evaluationTime,
AnalyticModelInterface model)
Description copied from interface: AnalyticProductInterface
Return the valuation of the product using the given model. The model has to implement the modes of AnalyticModelInterface.
Specified by:
getValue in interface AnalyticProductInterface
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

public double getCouponPayment(int periodIndex,
AnalyticModelInterface model)
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,
CurveInterface referenceCurve,
double spread,
AnalyticModelInterface 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

public double getValueWithGivenYield(double evaluationTime,
double rate,
AnalyticModelInterface model)
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

public double getSpread(double bondPrice,
CurveInterface referenceCurve,
AnalyticModelInterface 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.
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

public double getYield(double bondPrice,
AnalyticModelInterface 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.
Parameters:
bondPrice - The target price as double.
model - The model under which the product is valued.
Returns:
The optimal yield value.
• #### getAccruedInterest

public double getAccruedInterest(LocalDate date,
AnalyticModelInterface model)
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

public double getAccruedInterest(double time,
AnalyticModelInterface model)
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

public ScheduleInterface getSchedule()
• #### getDiscountCurveName

public String getDiscountCurveName()
• #### getForwardCurveName

public String getForwardCurveName()
• #### getSurvivalProbabilityCurveName

public String getSurvivalProbabilityCurveName()
• #### getBasisFactorCurveName

public String getBasisFactorCurveName()
• #### getFixedCoupon

public double getFixedCoupon()
• #### getFloatingSpread

public double getFloatingSpread()
• #### getRecoveryRate

public double getRecoveryRate()
• #### toString

public String toString()
Overrides:
toString in class Object
Skip navigation links
Copyright © 2017 Christian P. Fries.

Copyright © 2018. All rights reserved.