esgfwdrates: Instantaneous forward rates

View source: R/ycfwdrates.R

esgfwdratesR Documentation

Instantaneous forward rates

Description

Computes instantaneous forward rates from zero rates using various interpolation methods.

Usage

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

Arguments

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:

  • "annual" (default)

  • "semi-annual"

  • "quarterly"

  • "monthly"

  • "weekly"

  • "daily"

method

Interpolation method. One of:

  • "fmm" (default)

  • "periodic"

  • "natural"

  • "monoH.FC"

  • "hyman"

  • "HCSPL"

  • "SW"

...

Additional arguments passed to interpolation functions

Details

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.

Value

A time series object containing the instantaneous forward rates

Examples

# 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")


Techtonique/ESGtoolkit documentation built on June 11, 2025, 6:24 p.m.