| yc_discount | R Documentation |
Calculate discount factors from a yield curve assuming continuous compounding.
yc_discount(
curve,
maturities = NULL,
compounding = c("continuous", "annual", "semi_annual")
)
curve |
A |
maturities |
Optional numeric vector of maturities. If NULL, uses the curve's own maturities. |
compounding |
Character. Compounding convention: |
A data frame with columns maturity and discount_factor.
maturities <- c(1, 2, 5, 10)
rates <- c(0.045, 0.043, 0.042, 0.040)
curve <- yc_curve(maturities, rates)
yc_discount(curve)
yc_discount(curve, compounding = "annual")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.