| yc_key_rate_duration | R Documentation |
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.
yc_key_rate_duration(
coupon_rate,
maturity,
curve,
key_rates = c(1, 2, 5, 10, 30),
shift = 1e-04,
face = 100,
frequency = 2
)
coupon_rate |
Numeric. Annual coupon rate as a decimal. |
maturity |
Numeric. Time to maturity in years. |
curve |
Either a |
key_rates |
Numeric vector of key rate tenors in years.
Default is |
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). |
A data frame with columns tenor and key_rate_duration.
curve <- yc_curve(c(1, 2, 5, 10, 30), c(0.03, 0.035, 0.04, 0.042, 0.045))
yc_key_rate_duration(coupon_rate = 0.04, maturity = 10,
curve = curve, key_rates = c(1, 2, 5, 10, 30))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.