You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-12Lines changed: 71 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,87 @@
1
1
# README
2
2
## Overview
3
-
This Python package provides an implementation of the Smith-Wilson yield curve fitting algorithm for interpolations and extrapolations of zero-coupon bond rates. This algorithm is used for the extrapolation of [EIOPA risk-free term structures](https://eiopa.europa.eu/Publications/Standards/Technical%20Documentation%20(31%20Jan%202018).pdf) in the Solvency II framework. Details are available in the Technical Paper [QIS 5 Risk-free interest rates](https://eiopa.europa.eu/Publications/QIS/ceiops-paper-extrapolation-risk-free-rates_en-20100802.pdf). Examples of extrapolated yield curves including the parameters applied can be found [here](https://eiopa.europa.eu/Publications/Standards/EIOPA_RFR_20190531.zip).
3
+
This Python package implements the Smith-Wilson yield curve fitting algorithm. It allows for interpolations and extrapolations of zero-coupon bond rates. This algorithm is used for the extrapolation of [EIOPA risk-free term structures](https://eiopa.europa.eu/Publications/Standards/Technical%20Documentation%20(31%20Jan%202018).pdf) in the Solvency II framework. Details are available in the Technical Paper [QIS 5 Risk-free interest rates](https://eiopa.europa.eu/Publications/QIS/ceiops-paper-extrapolation-risk-free-rates_en-20100802.pdf). Examples of extrapolated yield curves including the parameters applied can be found [here](https://eiopa.europa.eu/Publications/Standards/EIOPA_RFR_20190531.zip).
4
4
<br /><br />
5
5
6
-
## Implementation
7
-
The algorithm has been implemented in vectorized form with numpy. This should guarantee good performance. All functions are in [core.py](https://github.com/simicd/smith-wilson-py/blob/master/smithwilson/core.py).
6
+
## How to use the package
7
+
1. To use the Smith-Wilson fitting algorithm, first import the Python package and specify the inputs. In the example below the inputs are zero-coupon rates with annual frequency up until year 25. The UFR is 2.9% and the convergence parameter alpha is 0.128562. The `terms` list defines the list of maturities, in this case `[1.0, 2.0, 3.0, ..., 25.0]`
8
+
```py
9
+
import smithwilson as sw
10
+
11
+
# Input - Switzerland EIOPA spot rates with LLP of 25 years
A complete example can be found in [main.py](https://github.com/simicd/smith-wilson-py/blob/master/main.py)
67
+
<br /><br />
68
+
69
+
## Algorithm
70
+
The algorithm is fully vectorized and uses numpy, making it very performant. The code is in [core.py](https://github.com/simicd/smith-wilson-py/blob/master/smithwilson/core.py).
8
71
9
72
The function `fit_smithwilson_rates()` expects following parameters:
10
-
- Observed rates
73
+
- Observed rates
11
74
- Observed maturities
12
75
- Target maturities
13
-
- Convergence parameter alpha
76
+
- Convergence parameter alpha
14
77
- Ultimate forward rate (UFR)
15
78
16
-
The observed rates and maturities are assumed to be before the Last LiquidPoint (LLP). The targeted maturity vector can
17
-
contain both, more granular maturity structure (interpolation) or terms after the LLP (extrapolation).
79
+
The observed rates and maturities are assumed to be before the Last Liquid Point (LLP). The targeted maturity vector can
80
+
contain any set of maturities (e.g. more granular maturity structure (interpolation) or terms after the LLP (extrapolation)).
18
81
<br /><br />
19
82
20
83
21
-
The fitting algorithm of the Smith-Wilson method calculates first the Wilson-matrix (EIOPA, 2010, p. 16):
84
+
The Smith-Wilson fitting algorithm calculates first the Wilson-matrix (EIOPA, 2010, p. 16):
@@ -34,10 +97,6 @@ With the Smith-Wilson parameter `ζ` and Wilson-matrix `W`, the zero-coupon bond
34
97
In the last case, `t` can be any maturity vector, i.e. with additional maturities to extrapolate rates.
35
98
<br /><br />
36
99
37
-
## Usage
38
-
To use the Smith-Wilson fitting algorithm import the Python package and call `fit_smithwilson_rates()` with the required parameters. An example can be found in [main.py](https://github.com/simicd/smith-wilson-py/blob/master/main.py)
Copy file name to clipboardExpand all lines: setup.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
setuptools.setup(
7
7
name="smithwilson",
8
-
version="0.1.0",
8
+
version="0.2.0",
9
9
author="Dejan Simic",
10
10
author_email="dejan.simic",
11
11
description="Implementation of the Smith-Wilson yield curve fitting algorithm in Python for interpolations and extrapolations of zero-coupon bond rates",
0 commit comments