Bond key rate duration given zero curve
KRDUR = bndkrdur(ZeroData, CouponRate,
Settle, Maturity) KRDUR = bndkrdur(ZeroData, CouponRate, Settle,
Maturity, 'Parameter1', Value1, 'Parameter2',
Value2, ...)
 Zero curve represented as a 


 Scalar MATLAB date number for the settlement date
for all the bonds and the zero data. 


 (Optional) Coupons per year of the bond. A vector of integers. Acceptable values are 0, 1, 2 (default), 3, 4, 6, and 12. 
 (Optional) Interpolation method used to obtain points from the zero curve. Acceptable values are:

 (Optional) Scalar value that zero curve is shifted up and down to compute duration. Default is .01 (100 basis points). 
 (Optional) Rates to perform the duration calculation,
specified as a time to maturity. By default, 
 (Optional) Compounding frequency of the curve. Default is semiannual. 
 (Optional) Basis of the curve, where the choices are
identical to 
 (Optional) Daycount basis of the bond instrument. A vector of integers:
For more information, see basis. 
 (Optional) Endofmonth rule. This rule applies only
when

 (Optional) Date when a bond was issued. 
 (Optional) Date when a bond makes its first coupon payment;
used when bond has an irregular first coupon period. When 
 (Optional) Last coupon date of a bond before the maturity
date; used when bond has an irregular last coupon period. In the absence
of a specified 
 (Optional) Date when a bond actually starts (the date
from which a bond cash flow is considered). To make an instrument
forwardstarting, specify this date as a future date. If you do not
specify 
 (Optional) Face or par value. Default = 100. 
Note: You must enter the optional arguments as parameter/value pairs. 
KRDUR = bndkrdur(ZeroData, CouponRate, Settle, Maturity)
KRDUR = bndkrdur(ZeroData, CouponRate, Settle, Maturity,
'Parameter1', Value1, 'Parameter2', Value2, ...)
The output argument KRDUR
is a numBonds
bynumRates
matrix
of key rate durations.
bndkrdur
computes the key rate durations
for one or more bonds given a zero curve and a set of key rates. By
default, the key rates are each of the zero curve rates. For each
key rate, the duration is computed by shifting the zero curve up and
down by a specified amount (ShiftValue
) at that
particular key rate, computing the present value of the bond in each
case with the new zero curves, and then evaluating the following:
$$krdu{r}_{i}\text{}=\text{}\frac{(P{V}_{down}\text{}\text{}P{V}_{up})}{(PV\text{}\times \text{}ShiftValue\text{}\times \text{}2)}$$
Note:
The shift to the curve is computed by shifting the particular
key rate by the 
Golub, B.W. and L.M. Tilman, Risk Management: Approaches for Fixed Income Markets Wiley, 2000.
Tuckman, B. Fixed Income Securities: Tools for Today's Markets Wiley, 2002.