yc_forward: Extract Forward Rates

View source: R/forward.R

yc_forwardR Documentation

Extract Forward Rates

Description

Compute forward rates from a yield curve. Can compute either instantaneous forward rates or forward-forward rates between two tenors.

Usage

yc_forward(curve, maturities = NULL, horizon = NULL)

Arguments

curve

A yc_curve object.

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).

Details

The instantaneous forward rate is derived as:

f(m) = r(m) + m \cdot r'(m)

Value

A data frame with columns maturity and forward_rate.

Examples

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)

yieldcurves documentation built on March 26, 2026, 5:06 p.m.