Computes instantaneous forward rates from zero rates using various interpolation methods.
Vector of input maturities
Vector of input zero rates
Number of simulations
Time horizon for forward rates
Output frequency for forward rates. One of:
"annual" (default)
"semi-annual"
"quarterly"
"monthly"
"weekly"
"daily"
Interpolation method. One of:
"fmm" (default)
"periodic"
"natural"
"monoH.FC"
"hyman"
"HCSPL"
"SW"
Additional arguments passed to interpolation functions
A time series object containing the instantaneous forward rates
The function computes instantaneous forward rates from zero rates using various interpolation methods. It first converts zero rates to zero-coupon prices, then interpolates these prices using the specified method. The forward rates are then computed from the interpolated prices.
The function supports different output frequencies and interpolation methods to suit various needs.
# Generate sample data
maturities <- c(1, 2, 3, 5, 7, 10)
zero_rates <- c(0.01, 0.015, 0.02, 0.025, 0.03, 0.035)
# Compute forward rates with annual frequency
fwd_rates <- esgfwdrates(in.maturities = maturities,
in.zerorates = zero_rates,
n = 1000,
horizon = 10,
out.frequency = "annual",
method = "fmm")