Skip to main content

Screenshot 2022-06-23 at 17 46 54

This is the code repository for Pricing and Trading Interest Rate Derivatives (3rd Edition). This repository is minimalist for pedagogical purposes. It does not contain documentation or code comments since all explanation and every step of the construction process is discussed in relevant sections of the text material. This code is released under a GNU Public License v3. Please review this with particular regard to sections 15 and 16 on warranty and liability, of which the author offers none and assumes none respectively.

Structure of this repository

  1. modules: this folder contains the code files that are discussed and created within the text.
  2. notebooks: this folder contains Jupyter Notebooks that can be executed to recreate many of the examples documented in the text, often with additional aids.
  3. files: this folder contains files that are cited in the bibliography of the text.
  4. previous_edition_material: this folder contains legacy files from previous editions of the book, mostly Excel workbooks with former examples.
  5. tests: this folder contains test scripts to ensure the functions continue to operate correctly as development occurred. Tests should not be considered exhaustive.
  6. requirement.txt: this file contains the Python packages and their versions that were used in the creation of this repository.

How to use this repository

There are three ways I envisage any user will want to use this repository:

  1. As a Casual Reader who is interested in using the book's material and examples but not necessarily in the codebase itself.
  2. As a New Learner following along with the code creation and examples in the text.
  3. As a Developer taking the codebase in the repository and repurposing it entirely.

The Casual Reader

The casual reader who does not want to download or clone this repo can install the code package here from PyPI into their own Python environment using pip:

~$ pip install bookirds3 

This is enough to execute the code examples in the book. For example the first instance, of chapter 11 can be replicated as follows

from bookirds.curves import Curve
from datetime import datetime

curve = Curve(interpolation="log_linear", nodes={
    datetime(2022, 1, 1): 1.00,
    datetime(2022, 4, 1): 0.9975,
    datetime(2022, 7, 1): 0.9945,
})
print(curve)

Additionally, the casual reader can download any of the Jupyter Notebooks and the module_loader.py file in the same directory and execute them, provided the installed dependencies are installed,

(yourpythonenv) ~$ pip install pandas matplotlib jupyterlab

Developers and New Learners

Developers and new learners should either download or clone this repo

~$ git clone https://github.com/attack68/book_irds3.git

It is advisable to create and activate a virtual python environment, and to install of the necessary (and optional) dependencies.

book_irds3$ python3 -m venv venv
book_irds3$ . venv/bin/activate
(venv) book_irds3$ pip install -r requirements.txt

All of the example notebooks should then be executable without errors, having started Jupyter Lab,

(venv) book_irds3$ jupyter lab

For a developer to run the test suite simply execute

(venv) book_irds3$ pytest tests

Metadata

Release files for bookirds3 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bookirds3 1.1.1
File Size Uploaded Provenance
bookirds3-1.1.1.tar.gz 51.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bookirds3 1.1.1
File Interpreter ABI Platform
bookirds3-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 90.9 kB

Release files / bookirds3-1.1.1.tar.gz

Download URL bookirds3-1.1.1.tar.gz
Size 51.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d614896475a3ab609771396fe2825c8d083d612c57d9e7195f4efc4e835e3794
BLAKE2b-256 checksum
How to use checksums
f0adb407f2e6730fbfb07b0ecb883f98b09acd59efb5e9c251747ddfe7ccbb70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.5

Release files / bookirds3-1.1.1-py3-none-any.whl

Download URL bookirds3-1.1.1-py3-none-any.whl
Size 39.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
544132f6f4dc7fabefca271623675211240c36168d630c3b82649c331536ecbf
BLAKE2b-256 checksum
How to use checksums
1523e51ccb1823b8c7f56ad9c1ea192e6608bb6ee9d689581318318002f5e210
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.5

Security for bookirds3 1.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page