WebCab Bonds
v2.01
(J2SE Edition)

webcab.lib.finance.bonds
Class CalculatingZeroRates

java.lang.Object
  |
  +--webcab.lib.finance.bonds.CalculatingZeroRates
All Implemented Interfaces:
Serializable

public class CalculatingZeroRates
extends Object
implements Serializable

Within this class we offer:

  1. Evaluation of the zero rate for a given maturity from the corresponding zero bond.
  2. Bootstrap method which allows the zero rate for a given maturity to be deduced by an iterative procedure from coupon paying bonds and zero rates of a shorter maturity.
  3. Construction of the zero rate curve from a finite set of zero rates of differing maturities in accordance to the convention that the zero rate curve is linear between the given zero rates and constant outside the range of maturities.
Using this functionality we are able to derive first (i.e. using 1, 2) a set the implied zero rates and then using these rates construct to entire zero rate curve.

Application of the zero Rate

The n-year zero (coupon) rate is the rate of interest earned on an investment which is issued (i.e. starts) today and matures (i.e. ends) in exactly n-years. The zero rate is a convenient short hand way to compare the return from interest based investments without needing to go into details concerning the coupon payment structure and compounding conventions used.

See Also:
Serialized Form

Constructor Summary
CalculatingZeroRates()
          Creates a new instance.
 
Method Summary
 double zeroRateBootstrap(Date evaluationDate, Date maturityDate, double[] couponPayments, Date[] couponPaymentDates, double[] zeroRates, double marketPrice, double principleSum, BusinessCalendar businessCalendar)
          Evaluates the zero rate from the price and coupon structure of the bond using the bootstrap method.
 double zeroRateBootstrap(double time2Maturity, double[] couponPayments, double[] time2Coupons, double[] zeroRates, double marketPrice, double principleSum)
          Evaluates the zero rate from the price and coupon structure of the bond using the bootstrap method.
 double zeroRateCurve(double[] zeroRates, Date evaluationDate, Date[] maturityDates, double maturityRequired, BusinessCalendar businessCalendar)
          Evaluates a zero rate of a given maturity by constructing the zero rate curve from known zero rates.
 double zeroRateCurve(double[] zeroRates, double[] maturities, double maturityRequired)
          Evaluates a zero rate of a given maturity by constructing the zero rate curve from known zero rates.
 double zeroRateFromZeroBond(Date evaluationDate, Date maturityDate, double principleSum, double marketPrice, BusinessCalendar businessCalendar)
          Evaluates the continuously compounded zero rate implied from the market price of a zero coupon bond.
 double zeroRateFromZeroBond(double time2Maturity, double principleSum, double marketPrice)
          Evaluates the continuously compounded zero rate implied from the market price of a zero coupon bond.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalculatingZeroRates

public CalculatingZeroRates()
Creates a new instance.

Method Detail

zeroRateFromZeroBond

public double zeroRateFromZeroBond(Date evaluationDate,
                                   Date maturityDate,
                                   double principleSum,
                                   double marketPrice,
                                   BusinessCalendar businessCalendar)
Evaluates the continuously compounded zero rate implied from the market price of a zero coupon bond. Recall that a zero coupon bind is a bond which does not pay any coupons.

Remarks:

  1. This procedure can be applied to the construction of the zero rate curve (i.e. the zero rate against the maturity).
  2. Risk arbitrage will ensure that a class of interest rate assets which exhibit is similar risk profile will all have similar zero rate curves. Therefore, for classes of assets such a US Treasury bonds (i.e. all have zero risk of default) will all have zero rate which lie on the same zero curve.

Parameters:
principleSum - the principle sum of the bond (also known as the face value)
marketPrice - the market price of the bond
evaluationDate - the date when the zero rate of the bond is being evaluated.
maturityDate - the date when the bond matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
Returns:
The continuously compounded zero rate in decimal format (i.e. 0.01 = 1 percent).

zeroRateFromZeroBond

public double zeroRateFromZeroBond(double time2Maturity,
                                   double principleSum,
                                   double marketPrice)
Evaluates the continuously compounded zero rate implied from the market price of a zero coupon bond. Recall that a zero coupon bind is a bond which does not pay any coupons.

Remarks:

  1. This procedure can be applied to the construction of the zero rate curve (i.e. the zero rate against the maturity).
  2. Risk arbitrage will ensure that a class of interest rate assets which exhibit is similar risk profile will all have similar zero rate curves. Therefore, for classes of assets such a US Treasury bonds (i.e. all have zero risk of default) will all have zero rate which lie on the same zero curve.

Parameters:
time2Maturity - the time in years expressed in decimal format (i.e. 6 months = 0.5) until the bond matures
principleSum - the principle sum of the bond (also known as the face value)
marketPrice - the market price of the bond
Returns:
The continuously compounded zero rate in decimal format (i.e. 0.01 = 1 percent).

zeroRateBootstrap

public double zeroRateBootstrap(Date evaluationDate,
                                Date maturityDate,
                                double[] couponPayments,
                                Date[] couponPaymentDates,
                                double[] zeroRates,
                                double marketPrice,
                                double principleSum,
                                BusinessCalendar businessCalendar)
Evaluates the zero rate from the price and coupon structure of the bond using the bootstrap method. It allows the zero rate to be deduced from the market price of a coupon paying bond for the maturity of the coupon paying bond. The zero rates of maturities corresponding to the time from the coupon payment until the maturity of the bond must be known.

Remark: This procedure can to applied to the construction of the zero rate curve (i.e. the zero rate against the maturity of the interest rate asset).

Parameters:
couponPayments - an array where the first term corresponds to the first coupon and the second term corresponds to the second coupon and so on...
zeroRates - an array where the first term corresponds to the zero rate of the maturity of the first coupon payment and the second term corresponds to the zero rate of the second coupon payment. Note that, each of the zero rates for each maturity is given in decimal format (for example, 5 percent = 0.05).
marketPrice - the market price of the coupon paying bond
principleSum - the principle sum of the coupon paying bond which is repaid at the maturity of the bond
couponPaymentDates - an array of dates where the first element corresponds to the payment date of the first coupon and the second element corresponds to the payment date of the second coupon and so on...
evaluationDate - the date when the bonds zero rate is evaluated
maturityDate - the date when the bond matures
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
Returns:
The zero rate of the bond in decimal format (i.e. 0.01 = 1 percent).

zeroRateBootstrap

public double zeroRateBootstrap(double time2Maturity,
                                double[] couponPayments,
                                double[] time2Coupons,
                                double[] zeroRates,
                                double marketPrice,
                                double principleSum)
Evaluates the zero rate from the price and coupon structure of the bond using the bootstrap method. It allows the zero rate to be deduced from the market price of a coupon paying bond for the maturity of the coupon paying bond. The zero rates of maturities corresponding to the time from the coupon payment until the maturity of the bond must be known.

Remark: This procedure can to applied to the construction of the zero rate curve (i.e. the zero rate against the maturity of the interest rate asset).

Parameters:
time2Maturity - the time in years expressed in decimal format (i.e. 3 years 6 months = 3.5) until the bond matures
couponPayments - an array where the first term corresponds to the first coupon and the second term corresponds to the second coupon and so on...
time2Coupons - an array where the first term corresponds to the time until the first coupon payment and the second term corresponds to the time until the second payments and so on...
zeroRates - an array where the first term corresponds to the zero rate of the maturity of the first coupon payment and the second term corresponds to the zero rate of the second coupon payment. Note that, each of the zero rates for each maturity is given in decimal format (for example, 5 percent = 0.05).
marketPrice - the market price of the coupon paying bond
principleSum - the principle sum of the coupon paying bond which is repaid at the maturity of the bond
Returns:
The zero rate of the bond in decimal format (i.e. 0.01 = 1 percent).

zeroRateCurve

public double zeroRateCurve(double[] zeroRates,
                            Date evaluationDate,
                            Date[] maturityDates,
                            double maturityRequired,
                            BusinessCalendar businessCalendar)
Evaluates a zero rate of a given maturity by constructing the zero rate curve from known zero rates. In particular, we apply the (usual) convention that the zero curve in linear between known points of the curve (that is, known zero rates) and is constant (i.e. flat) for maturities less than the lowest known maturity, or greater than the highest known maturity.

Parameters:
zeroRates - an array where the 1st term corresponds to the known zero rate with the lowest maturity, and the second term corresponds to the zero rate with the next lowest maturity and so on.
maturityRequired - this the maturity of the zero rate which will be returned by the method
evaluationDate - the date when the zero rate curve in constructed. Note that the zero rate curve just like the zero rates themselves will vary with time.
maturityDates - the dates which correspond to the maturities of the zero rates. That is, the first maturity date corresponds to the maturity of the zero rate with the nearest maturity, the second (date) term corresponds to the maturity of the zero rate with the next nearest maturity.
businessCalendar - The instance of a BusinessCalendar interface implementation. Specify null to select the London business calendar.
Returns:
The zero rate for the required maturity in decimal format (i.e. 1 percent = 0.01)

zeroRateCurve

public double zeroRateCurve(double[] zeroRates,
                            double[] maturities,
                            double maturityRequired)
Evaluates a zero rate of a given maturity by constructing the zero rate curve from known zero rates. In particular, we apply the (usual) convention that the zero curve in linear between known points of the curve (that is, known zero rates) and is constant (i.e. flat) for maturities less than the lowest known maturity, or greater than the highest known maturity.

Parameters:
zeroRates - an array where the 1st term corresponds to the known zero rate with the lowest maturity, and the second term corresponds to the zero rate with the next lowest maturity and so on.
maturities - an array where the 1st term corresponds to the maturity (in years) of the zero rate with the lowest maturity, the second term corresponds to the maturity (in years) of the zero rate with the next lowest maturity and so on. Note that each maturity is given in years in decimal format (i.e. 3 years 6 months = 3.5) and each of the maturities must be distinct.
maturityRequired - this the maturity of the zero rate which will be returned by the method
Returns:
The zero rate for the required maturity in decimal format (i.e. 1 percent = 0.01)

WebCab Bonds
v2.01
(J2SE Edition)