Skip to main content

A package to extrapolate forward rates using the EIOPA Smith-Wilson method.

Project description

This package ...

This package can be used to extrapolate forward rates, spot rates and other outputs using the method developed by EIOPA for the extrpolation of risk-free term structures. Mathematical details can be found here: https://www.eiopa.europa.eu/document/download/0ab82697-40a6-49ad-930f-211b649c1be9_en?filename=EIOPA-BoS-24-099-Report-on-the-Calculation-of-the-UFR-for-2025.pdf. Using as input observed forward rates for the next 20 (or other value) years, the code extrapolates these rates for a given timeframe, e.g., 80 years. The other necessary inputs are explained below.

Code Origin

The entirety of this code was written by Kilian de Ridder. The code reproduces the VBA code EIOPA provides for use in excel.

Main function, inputs and outputs

The main function is: extrapolate_with_sw(rates_obs, ufr, t2, Tau, extrapolation_target, nrofcoup, instrument, alfamin)

Inputs

rates_obs: is a vector of observed liquid yields, e.g., for the next twenty years. ufr (ultimate forward rate): the rate the extrapolation of forward rates should ultimately converge to t2: the convergence maturity, that is, the point at which fitted forward rates should have converged to the ufr, where we specify how close this convergence needs to be. Tau: The convergence tolerance in basis points. The fitted forward rates are constrained to be less or equal than Tau basis points away from the ufr at the convergence maturity. extrapolation_target: the maturity until which our extrapolation should be executed. nrofcoup: The number of coupons payments per year, if there are any. Put 1 (or anything else) for coupon-less instruments, the nrofcoup will be set to 1 by the code. instrument: arguments are "Zero", "Bond", "Swap". "Zero" is for any instruments without coupon payments, for example, payments that have to be made at one point in time without prior interest payments. "Bond" and "Swap" for those instruments with coupon payments inbetween. alfamin: The minimum convergence speed, should be set to 0.05 according to EIOPA.

Outputs

The function returns a pandas DataFrame with 7 columns and (extrapolation_target + 1) rows. The columns are: maturities discount factor spot intensity spot rate forward intensity forward rate cc forward rate ac And thus reproduce the outputs the vba code in excel also produces.

How to use the package

  1. Install the package and import it using import smithwilson2.smithwilson2 as sw
  2. Specify the above inputs, using alfamin = 0.05 and the current ufr published by EIOPA (e.g., 0.33).
  3. Call the extrapolate_with_sw(rates_obs, ufr, t2, Tau, extrapolation_target, nrofcoup, instrument, alfamin) function, e.g. output = (rates_obs, ufr, t2, Tau, extrapolation_target, nrofcoup, instrument, alfamin) print(output) This output can thne easily be written to a csv file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smithwilson2-0.0.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smithwilson2-0.0.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file smithwilson2-0.0.1.tar.gz.

File metadata

  • Download URL: smithwilson2-0.0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for smithwilson2-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c1fd9e4fd01dcadac2eafdb785a7c556bee1666fc4229e3799bd26bdffc0d459
MD5 947cf5a7174fc2096eb5a77d1f8025c1
BLAKE2b-256 2ce27f95ee530bc7c974825e5511293515b2e06aaa97bd35fd212892cc2435df

See more details on using hashes here.

File details

Details for the file smithwilson2-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: smithwilson2-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for smithwilson2-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78f1ff86edf45de126467da7ddbfb028cb6d52003e4b0912c6b83253d311716d
MD5 d1a1623812a9330dca23465b5c44a023
BLAKE2b-256 1f0e0f0fe9f6ba228577119d70a02cd123f9eba7f01d08ca7eb8ead8d77512dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page