GithubHelp home page GithubHelp logo

eazyds / book_irds3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from attack68/book_irds3

0.0 0.0 0.0 37.79 MB

Code repository for Pricing and Trading Interest Rate Derivatives

License: GNU General Public License v3.0

Python 32.20% Jupyter Notebook 67.80%

book_irds3's Introduction

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

book_irds3's People

Contributors

attack68 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.