Skip to content

open-source-modelling/smith-wilson_javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Popular algorithm for interpolating and extrapolating various curves such as bond yields and risk-free rates. This implementation is based on the Technical documentation of the Methodology to derive EIOPA's risk-free interest rate term structure (Version published on 12/09/2019. See Section 7).

Problem

When analysing market expectations of future rates, a common approach is to look at fixed income instruments such as government or corporate bonds that mature in the future. In practice, the maturities observable (and liquid) on the market rarely cover all the maturities that are needed.

Solution

This implementation takes as input the available market information, parameters describing the long-term behaviour of the curve and the data on desired (target) maturities for which the yields are needed.

Market information input

  • Observed yields of the zero-coupon bonds r_Obs.
  • Maturity of the observed bonds M_Obs.

SW Parameters

  • Ultimate froward rate ufr represents the rate to which the rate curve will converge as time increases.
  • Convergence speed parameter alpha controls the speed at which the curve converges towards the ufr parameter from the last liquid point (last data point available in the market information input).

Desired output

  • List of maturities for which the SW algorithm will calculate the yields M_Tar.

Note that this implementation assumes that the yields were calculated on ZCB. This assumption can be easily relaxed in future releases. The implementation is split in two parts:

  1. The available market data and the parameters are used to "calibrate" the algorithm. This returns a calibration vector that can be used to interpolate or extrapolate target maturities. This is done by calibrating the kernel functions. Look at the function SWCalibrate().
  2. The yields for ZCB with targeted maturities are Interpolated/extrapolated. Look at the function SWExtrapolate().

The syntax in the functions tries to be consistent with EIOPA technical specifications.

Getting started

Given the data on 6 ZCB with maturities of 1, 2, 4, 5, 6, and 7 years with observed yields 1%, 2%, 3%, 3.2%, 3.5% and 4% respectively. The user is interested in yields for ZCB at maturities 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20 years. The given calibration for the parameter alpha is 0.15 and the ultimate forward rate is 4%. The commands to calculate the target yields would be:

let M_Obs = [[1], [2], [4], [5], [6], [7]];
let r_Obs = [[0.01], [0.02], [0.03], [0.032], [0.035], [0.04]];

let ufr = 0.04;
let alpha = 0.15;

let M_Tar = [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [15], [20]];

b = SWCalibrate(r_Obs, M_Obs, ufr, alpha);
r = SWExtrapolate(M_Tar, M_Obs, b, ufr, alpha);
console.table(r);

Example

A running example of the algorithm can be found on this AWS deployment. http://qnity-alpha.s3-website.eu-central-1.amazonaws.com

###Note: To extrapolate the curve, it is enough to know the additional parameters(alpha, ufr), the maturities used for calibration and the vector b*Q. If this is the case, it is not difficult to modify the function SWExtrapolate() to take as input Qb instead of b. An example of this is the monthly risk free rate published by turopean Insurance and Occupational Pensions Authority (https://www.eiopa.europa.eu/tools-and-data/).