esgfwdrates | R Documentation |
Computes instantaneous forward rates from zero rates using various interpolation methods.
esgfwdrates(
in.maturities,
in.zerorates,
n,
horizon,
out.frequency = c("annual", "semi-annual", "quarterly", "monthly", "weekly", "daily"),
method = c("fmm", "periodic", "natural", "monoH.FC", "hyman", "HCSPL", "SW"),
...
)
in.maturities |
Vector of input maturities |
in.zerorates |
Vector of input zero rates |
n |
Number of simulations |
horizon |
Time horizon for forward rates |
out.frequency |
Output frequency for forward rates. One of:
|
method |
Interpolation method. One of:
|
... |
Additional arguments passed to interpolation functions |
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.
A time series object containing the instantaneous forward rates
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.