| yc_forward | R Documentation |
Compute forward rates from a yield curve. Can compute either instantaneous forward rates or forward-forward rates between two tenors.
yc_forward(curve, maturities = NULL, horizon = NULL)
curve |
A |
maturities |
Optional numeric vector of maturities at which to compute forward rates. If NULL, uses the curve's own maturities. |
horizon |
Optional numeric. If provided, computes the forward rate from each maturity to maturity + horizon (forward-forward rate). |
The instantaneous forward rate is derived as:
f(m) = r(m) + m \cdot r'(m)
A data frame with columns maturity and forward_rate.
maturities <- c(0.25, 0.5, 1, 2, 5, 10, 30)
rates <- c(0.052, 0.050, 0.048, 0.045, 0.042, 0.040, 0.043)
fit <- yc_nelson_siegel(maturities, rates)
yc_forward(fit)
yc_forward(fit, maturities = c(1, 5, 10), horizon = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.