Class Bond
- All Implemented Interfaces:
FiniteDifferenceProduct<FiniteDifferenceInterestRateModel>, FiniteDifferenceInterestRateProduct, Product
This class is the reduced-scope PDE analogue of the analytic bond products in finmath. It is intentionally restricted to deterministic cashflows:
- zero-coupon bonds,
- fixed-coupon bonds,
- deterministic redemption at maturity.
The class does not yet support floating coupons, credit-risk survival curves, basis-factor curves, or recovery payments.
Let T_i denote the payment dates of the schedule, \delta_i
the corresponding accrual factors, c the fixed coupon rate,
N the notional, and R the redemption paid on the final
payment date. The deterministic cashflow paid at T_i is
C_i = N c \delta_i
for intermediate periods, and
C_n = N c \delta_n + R
on the final payment date.
In the event-based finite-difference framework this is represented through jumps of the value function at payment dates:
V(T_i^{-},x) = V(T_i^{+},x) + C_i.
The current implementation uses the one-dimensional theta-method solver and therefore requires a one-dimensional finite-difference interest-rate model.
- Author:
- Alessandro Gnoatto
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]applyEventCondition(double time, double[] valuesAfterEvent, FiniteDifferenceInterestRateModel model) Applies the event condition at a given event time.doublegetCashflow(int periodIndex) Returns the deterministic cashflow paid at the given period index.double[]Returns the event times of the product.doubleReturns the fixed coupon rate.doubleReturns the maturity, equal to the last payment date of the schedule.doubleReturns the notional.doubleReturns the redemption amount paid on the final payment date.Returns the payment schedule.double[]getValue(double evaluationTime, FiniteDifferenceInterestRateModel model) Returns the value.double[][]Returns the value.static BondofZeroCouponBond(double maturity) Creates a zero-coupon bond with unit notional.static BondofZeroCouponBond(double maturity, double notional) Creates a zero-coupon bond.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FiniteDifferenceInterestRateProduct
getModelClassMethods inherited from interface FiniteDifferenceProduct
getValue
-
Constructor Details
-
Bond
Creates a fixed-coupon bond with redemption equal to the notional.- Parameters:
schedule- The payment schedule.fixedCoupon- The fixed coupon rate.notional- The notional.
-
Bond
Creates a deterministic-cashflow bond.- Parameters:
schedule- The payment schedule.fixedCoupon- The fixed coupon rate.notional- The notional.redemption- The redemption paid on the final payment date.
-
-
Method Details
-
ofZeroCouponBond
Creates a zero-coupon bond with unit notional.- Parameters:
maturity- The maturity.- Returns:
- A zero-coupon bond.
-
ofZeroCouponBond
Creates a zero-coupon bond.- Parameters:
maturity- The maturity.notional- The notional paid at maturity.- Returns:
- A zero-coupon bond.
-
getValue
Description copied from interface:FiniteDifferenceProductReturns the value.- Specified by:
getValuein interfaceFiniteDifferenceProduct<FiniteDifferenceInterestRateModel>- Parameters:
evaluationTime- The value.model- The value.- Returns:
- The value.
-
getValues
Description copied from interface:FiniteDifferenceProductReturns the value.- Specified by:
getValuesin interfaceFiniteDifferenceProduct<FiniteDifferenceInterestRateModel>- Parameters:
model- The value.- Returns:
- The value.
-
getEventTimes
public double[] getEventTimes()Description copied from interface:FiniteDifferenceInterestRateProductReturns the event times of the product.Event times are the dates where the backward induction may have to apply a jump or another event condition, for example because of coupon accrual, coupon payment, fixing, exercise, callability, or redemption.
Products without intermediate events may return an empty array.
- Specified by:
getEventTimesin interfaceFiniteDifferenceInterestRateProduct- Returns:
- The event times of the product.
-
applyEventCondition
public double[] applyEventCondition(double time, double[] valuesAfterEvent, FiniteDifferenceInterestRateModel model) Description copied from interface:FiniteDifferenceInterestRateProductApplies the event condition at a given event time.The input array
valuesAfterEventrepresents the continuation values immediately after the event time, that isV(t^{+},x).
The returned array represents the values immediately before the event time, that is
V(t^{-},x).
The ordering of the entries must match the state-space ordering of the underlying finite-difference model.
The default implementation leaves the continuation values unchanged.
- Specified by:
applyEventConditionin interfaceFiniteDifferenceInterestRateProduct- Parameters:
time- The event time.valuesAfterEvent- The continuation values immediately after the event.model- The finite-difference interest-rate model.- Returns:
- The values immediately before the event.
-
getSchedule
-
getFixedCoupon
public double getFixedCoupon()Returns the fixed coupon rate.- Returns:
- The fixed coupon rate.
-
getNotional
public double getNotional()Returns the notional.- Returns:
- The notional.
-
getRedemption
public double getRedemption()Returns the redemption amount paid on the final payment date.- Returns:
- The redemption amount.
-
getMaturity
public double getMaturity()Returns the maturity, equal to the last payment date of the schedule.- Returns:
- The maturity.
-
getCashflow
public double getCashflow(int periodIndex) Returns the deterministic cashflow paid at the given period index.- Parameters:
periodIndex- The period index.- Returns:
- The cashflow paid at the corresponding payment date.
-
toString
-