Calculates the implied forward rate between pairs of points on a zero-coupon (spot) yield curve. The forward rate is the interest rate, implied by today’s yield curve, for a loan that starts at a future date - it is derived purely from no-arbitrage pricing rather than a forecast of future rates.

The rate for each maturity is obtained by linearly interpolating the supplied spot curve, so near_maturity and far_maturity do not need to coincide exactly with a maturity present in spot_rates.

The forward rate is calculated using the following formula:

\[\text{Forward Rate} = ((1 + r_{2}) ^{t_{2}} / (1 + r_{1}) ^{t_{1}}) ^{1 / (t_{2} - t_{1})} - 1\]

where:

  • r1 = Spot rate at the near maturity
  • t1 = Near maturity, in years
  • r2 = Spot rate at the far maturity
  • t2 = Far maturity, in years

Also known as: implied forward rate, forward-forward rate.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Forward Rate for you. Just ask in plain English.

Calculate the Forward Rate in Python

The Forward Rate is available in the Fixed Income module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_forward_rate as shown below.

from financetoolkit import FixedIncome

fixedincome = FixedIncome()

fixedincome.get_forward_rate(
    near_maturity=[1, 2, 3],
    far_maturity=[5, 10],
    show_input_info=False,
)

Which returns:

Near Maturity 5 10
1 0.04 0.0456
2 0.042 0.047
3 0.044 0.0483

Parameters

get_forward_rate accepts the following parameters:

  • spot_rates (pd.Series | dict, optional): The zero-coupon (spot) yield curve, indexed by maturity in years (in decimal). Defaults to a sample curve.
  • near_maturity (float | list, optional): The nearer maturity (or maturities), in years. If not provided, a range of near maturities will be used.
  • far_maturity (float | list, optional): The further maturity (or maturities), in years. If not provided, a range of far maturities will be used.
  • show_input_info (bool, optional): Whether to display input information. Defaults to True.

The Fixed Income module page introduces the module, and the sidebar lists all of its functions.

Share