public class Bond extends AbstractAnalyticProduct implements AnalyticProduct
Schedule.| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
double |
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.
|
String |
getBasisFactorCurveName() |
double |
getCouponPayment(int periodIndex,
AnalyticModel model)
Returns the coupon payment of the period with the given index.
|
String |
getDiscountCurveName() |
double |
getFixedCoupon() |
double |
getFloatingSpread() |
String |
getForwardCurveName() |
double |
getRecoveryRate() |
Schedule |
getSchedule() |
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.
|
String |
getSurvivalProbabilityCurveName() |
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.
|
String |
toString() |
getValue, getValuepublic Bond(Schedule schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread, double recoveryRate)
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.public Bond(Schedule schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double recoveryRate)
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.public Bond(Schedule schedule, String discountCurveName, String forwardCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon, double floatingSpread)
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.public Bond(Schedule schedule, String discountCurveName, String survivalProbabilityCurveName, String basisFactorCurveName, double fixedCoupon)
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.public double getValue(double evaluationTime,
AnalyticModel model)
AnalyticProductAnalyticModel.getValue in interface AnalyticProductevaluationTime - The evaluation time as double. Cash flows prior and including this time are not considered.model - The model under which the product is valued.public double getCouponPayment(int periodIndex,
AnalyticModel model)
periodIndex - The index of the period of interest.model - The model under which the product is valued.public double getValueWithGivenSpreadOverCurve(double evaluationTime,
Curve referenceCurve,
double spread,
AnalyticModel model)
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.public double getValueWithGivenYield(double evaluationTime,
double rate,
AnalyticModel model)
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.public double getSpread(double bondPrice,
Curve referenceCurve,
AnalyticModel model)
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.public double getYield(double bondPrice,
AnalyticModel model)
bondPrice - The target price as double.model - The model under which the product is valued.public double getAccruedInterest(LocalDate date, AnalyticModel model)
date - The date of interest.model - The model under which the product is valued.public double getAccruedInterest(double time,
AnalyticModel model)
time - The time of interest as double.model - The model under which the product is valued.public Schedule getSchedule()
public String getDiscountCurveName()
public String getForwardCurveName()
public String getSurvivalProbabilityCurveName()
public String getBasisFactorCurveName()
public double getFixedCoupon()
public double getFloatingSpread()
public double getRecoveryRate()
Copyright © 2019. All rights reserved.