gcubed.projections.yield_curves

This module contains the 'YieldCurves class, responsible for computing long bond rates in nominal and real yield curves from projections of 1-year rates.

class YieldCurves:

Provides the functionality required to compute long nominal and real interest rates from one-year rates.

@classmethod
def calculate_long_rates( cls, term: int, rates: pandas.core.frame.DataFrame) -> pandas.core.frame.DataFrame:

Overview

Utility method that returns the compounding long rates given the yearly rates.

Arguments

term: the number of years of the term of the instrument. 2 for a 2 year bond. Valid values are:

  • 2 (for nominal short rates only)
  • 5 (for nominal short rates only)
  • 10 (for real or nominal short rates)

rates: a dataframe with a single row, containing the 1 year interest rates (nominal or real) across the columns. The row index is the variable name of the 1 year interest rate. The column indices are ordered YYYY years (as strings). Rates are interpreted as decimal values so 1% is expected to be given as 0.01.

Returns the long rates that can be computed from the one year rates. This series is shorter than the series of one year rates because the required data is not available for the last (term-1) observations. It is padded with NaN values in the returned dataframe.