image thumbnail

Smith-Wilson algorithm

version 1.0.3 (4.99 KB) by Gregor Fabjan
Smith-Wilson is a popular algorithm for approximating financial curves such as bond yields or forward rates.


Updated 22 Oct 2021

View License

Smith & Wilson is a widely used algorithm that can do both interpolation and extrapolation of rates at the same time. 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). (EIOPA is the European insurance regulator).
The implementation is split in two parts.
  1. Calibration of the kernel functions is done by the function Calibrate_b.
  2. Interpolation/extrapolation of targeted maturitites is done by the function ExtrapolateSW.
The syntax is consistent with EIOPA technical specifications.
  • Observed market data
  • Observable rates and the maturities of the market bonds.
  • 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 from the last liquid point.
  • For which maturities do we want the SW algorithm to calculate the rates.
Implementation of the Smith-Wilson algorithm
The algorithm has two parts. Calibrating the kernel using observable market prices which is done inside the function SWCalibrate and then using the calibration to calculate the target maturities with SWExtrapolate. SWHeart function calculates the so called heart of the Wilson function and is called in both SWCalibrate and SWExtrapolate. To run the algorithm, download all files in the same folder and run the main.mlx script.
A more visual Excel example of what the code does can be found on GitHub:

Cite As

Gregor Fabjan (2021). Smith-Wilson algorithm (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with R2014a and later releases
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!