| yc_zero_to_par | R Documentation |
Compute par (coupon) rates from zero (spot) rates. The par rate for maturity T is the coupon rate that makes a bond price equal to par.
yc_zero_to_par(maturities, zero_rates, frequency = 1)
maturities |
Numeric vector of maturities in years. |
zero_rates |
Numeric vector of zero rates as decimals. |
frequency |
Integer. Coupon frequency per year: 1 for annual (default) or 2 for semi-annual. |
A data frame with columns maturity and par_rate.
maturities <- c(1, 2, 3, 5, 10)
zero_rates <- c(0.040, 0.042, 0.043, 0.044, 0.045)
yc_zero_to_par(maturities, zero_rates)
# Semi-annual coupons
yc_zero_to_par(c(0.5, 1, 2), c(0.04, 0.042, 0.043), frequency = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.