Compute key rate durations by bumping the yield curve at specific tenors. Each bump is triangular: the full shift is applied at the key rate tenor and linearly interpolated to zero at adjacent key rate tenors.
Usage
yc_key_rate_duration(
coupon_rate,
maturity,
curve,
key_rates = c(1, 2, 5, 10, 30),
shift = 1e-04,
face = 100,
frequency = 2
)Arguments
- coupon_rate
Numeric. Annual coupon rate as a decimal.
- maturity
Numeric. Time to maturity in years.
- curve
Either a
yc_curveobject or a list/data frame with componentsmaturitiesandrates.- key_rates
Numeric vector of key rate tenors in years. Default is
c(1, 2, 5, 10, 30).- shift
Numeric. Size of the rate bump in decimal (default 0.0001, i.e. 1 basis point).
- face
Numeric. Face value. Default is 100.
- frequency
Integer. Coupon frequency: 1 (annual) or 2 (semi-annual, default).