Pricing and Trading Interest Rate Derivatives
Project description
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
- modules: this folder contains the code files that are discussed and created within the text.
- notebooks: this folder contains Jupyter Notebooks that can be executed to recreate many of the examples documented in the text, often with additional aids.
- files: this folder contains files that are cited in the bibliography of the text.
- previous_edition_material: this folder contains legacy files from previous editions of the book, mostly Excel workbooks with former examples.
- tests: this folder contains test scripts to ensure the functions continue to operate correctly as development occurred. Tests should not be considered exhaustive.
- 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:
- As a Casual Reader who is interested in using the book's material and examples but not necessarily in the codebase itself.
- As a New Learner following along with the code creation and examples in the text.
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bookirds3-1.1.1.tar.gz
.
File metadata
- Download URL: bookirds3-1.1.1.tar.gz
- Upload date:
- Size: 51.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d614896475a3ab609771396fe2825c8d083d612c57d9e7195f4efc4e835e3794 |
|
MD5 | 898e5b5395d2ebe65a81aedfe76e8692 |
|
BLAKE2b-256 | f0adb407f2e6730fbfb07b0ecb883f98b09acd59efb5e9c251747ddfe7ccbb70 |
File details
Details for the file bookirds3-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: bookirds3-1.1.1-py3-none-any.whl
- Upload date:
- Size: 39.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 544132f6f4dc7fabefca271623675211240c36168d630c3b82649c331536ecbf |
|
MD5 | 78d3ddfc98a4f154bf943854bfaf668d |
|
BLAKE2b-256 | 1523e51ccb1823b8c7f56ad9c1ea192e6608bb6ee9d689581318318002f5e210 |