interest-rate-models
Classic interest rate models in Python: short-rate models (Vasicek, CIR, Ho-Lee, Hull-White, G2++) and full-curve models (Heath-Jarrow-Morton, LIBOR Market Model) behind one interface, with analytic bond and option pricing where it exists and exact or discretized Monte Carlo simulation everywhere.
Full documentation: interest-rate-models.readthedocs.io
Installation
pip install interest-rate-models
Requires Python >= 3.13.
Quick start
import numpy as np
from interest_rate_models import DiscountCurve, get_model
# Market curve: pillar maturities and continuously-compounded zero rates
curve = DiscountCurve.from_zero_rates(
times=np.array([0.5, 1.0, 2.0, 5.0, 10.0]),
zero_rates=np.array([0.030, 0.032, 0.034, 0.037, 0.039]),
)
# No-arbitrage short-rate model fitted to the curve
hw = get_model("hull-white", curve=curve, a=0.1, sigma=0.01)
print(hw.bond_price(0.0, 5.0)) # reproduces curve.discount(5.0)
print(hw.bond_option(1.0, 5.0, strike=0.85, kind="call"))
# Equilibrium model calibrated to the curve
vasicek = get_model("vasicek", kappa=0.5, theta=0.04, sigma=0.01)
params = vasicek.calibrate(curve, r0=0.03)
# Full-curve models
lmm = get_model("lmm", curve=curve, tenor=0.5, n_periods=10, vol=0.20)
print(lmm.cap_price(strike=0.035))
The factory accepts "vasicek", "cir", "ho-lee", "hull-white", "g2++", "hjm", and "lmm". See the documentation for each model's dynamics, formulas, parameters, and configuration.
Contributing
Contributions, bug reports, and feature requests are welcome. Open an issue or submit a PR on GitHub.
License
MIT
Release files for interest-rate-models 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| interest_rate_models-0.1.0.tar.gz | 80.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| interest_rate_models-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 114.1 kB
Release files / interest_rate_models-0.1.0.tar.gz
| Download URL | interest_rate_models-0.1.0.tar.gz |
|---|---|
| Size | 80.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db818468266421e06f1f60f81f988ce72d31f42a8d473fe025c9bd1bd2fc1c77
|
|
BLAKE2b-256 checksum How to use checksums |
7090b8abd40fb8a3f67e0a1f379bd4c324f5d4818930c4f87d27a800425eb863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency logRelease files / interest_rate_models-0.1.0-py3-none-any.whl
| Download URL | interest_rate_models-0.1.0-py3-none-any.whl |
|---|---|
| Size | 33.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3e5c47d591ce5f74c7697d5b84225376ad8fdaa94262a670ef6619c73fc6e24
|
|
BLAKE2b-256 checksum How to use checksums |
d96847fbfbd82a539fbcba4187df8d662ddd910444fd5b5aad02d8bdb8bfb942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 30, 2026.
Transparency log