Fit a yield curve using cubic spline interpolation. Provides an exact fit through all observed data points with smooth interpolation between them.
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_cubic_spline(maturities, rates)
fit
#>
#> ── Yield Curve (Cubic Spline) ──────────────────────────────────────────────────
#> • Type: "zero"
#> • Maturities: 7 (0.25Y to 30Y)
#> • Rate range: 4% to 5.2%
#> • RMSE: "0" bps