Skip to content

Commit 7c188c4

Browse files
committed
Explicitly export functions and update docs
1 parent 5b5989b commit 7c188c4

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

.github/workflows/python-package.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,5 @@ jobs:
7676
TWINE_USERNAME: __token__
7777
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
7878
run: |
79-
twine upload -r testpypi dist/*
80-
81-
# twine upload dist/*
79+
twine upload dist/*
80+
# For testing only: twine upload -r testpypi dist/*

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This Python package implements the Smith-Wilson yield curve fitting algorithm. I
44
<br /><br />
55

66
## 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]`
7+
1. Install the package with `pip install smithwilson`
8+
2. 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]`
89
```py
910
import smithwilson as sw
1011

@@ -22,7 +23,7 @@ This Python package implements the Smith-Wilson yield curve fitting algorithm. I
2223

2324
```
2425

25-
1. Specify the targeted output maturities. This is the set of terms you want to get rates fitted by Smith-Wilson.
26+
3. Specify the targeted output maturities. This is the set of terms you want to get rates fitted by Smith-Wilson.
2627
Expand the set of rates beyond the Last Liquid Point (e.g. extrapolate to 150 years with annual frequency):
2728
```py
2829
# Extrapolate to 150 years
@@ -41,14 +42,17 @@ This Python package implements the Smith-Wilson yield curve fitting algorithm. I
4142
terms_target = [0.25, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0]
4243
```
4344

44-
1. Call the Smiwth-Wilson fitting algorithm. This returns the rates as numpy vector with each element corresponding to the maturity in `terms_target`
45+
4. Call the Smiwth-Wilson fitting algorithm. This returns the rates as numpy vector with each element corresponding to the maturity in `terms_target`
4546
```py
4647
# Calculate fitted rates based on actual observations and two parametes alpha & UFR
4748
fitted_rates = sw.fit_smithwilson_rates(rates_obs=rates, t_obs=terms,
48-
t_target=terms_target, alpha=alpha, ufr=ufr)
49+
t_target=terms_target, ufr=ufr,
50+
alpha=alpha) # Optional
4951
```
5052

51-
1. To display the results and/or processing them it can be useful to turn them into a table, here using the pandas library:
53+
The convergence parameter alpha is optional and will be estimated if not provided. The parameter determines the convergence speed of the yield curve towards the Ultimate Forward Rate (UFR). The parameter is estimated by finding the smallest value such that the difference between forward rate at convergence maturity and UFR is smaller than 1bps.
54+
55+
5. To display the results and/or processing them it can be useful to turn them into a table, here using the pandas library:
5256
```py
5357
# Ensure pandas package is imported
5458
import pandas as pd
@@ -102,6 +106,3 @@ In the last case, `t` can be any maturity vector, i.e. with additional maturitie
102106

103107
[EIOPA (2018). Technical documentation of the methodology to derive EIOPA’srisk-free interest rate term structures](https://eiopa.europa.eu/Publications/Standards/Technical%20Documentation%20(31%20Jan%202018).pdf); p.37-46
104108
<br /><br />
105-
106-
## Author
107-
[Dejan Simic](https://www.linkedin.com/in/dejsimic/)

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
name="smithwilson",
88
version="0.2.0",
99
author="Dejan Simic",
10-
# author_email="dejan.simic",
1110
description=
1211
"Implementation of the Smith-Wilson yield curve fitting algorithm in Python for interpolations and extrapolations of zero-coupon bond rates",
1312
long_description=long_description,

smithwilson/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
from smithwilson.core import *
1+
from smithwilson.core import calculate_prices, fit_convergence_parameter, fit_smithwilson_rates, ufr_discount_factor, fit_parameters, wilson_function

0 commit comments

Comments
 (0)