GithubHelp home page GithubHelp logo

bonds's Introduction

Bond price sensitivity

This repo offers an interactive way for studying the bond price sensitivity as a function of:

  • coupon rate
  • time-to-maturity (TTM)
  • yield

Requirements

This code is tested to run correctly with

  • R version 3.6.1 (2019-07-05)
  • RStudio Version 1.2.1335 Older versions could also work. Two packages are direct dependencies:
    • manipulate - for interactive plot
    • testthat - in case you want to run the Unit Tests

The latest R version can be downloaded from here, while the latest RStudio from here.

How to use

Sourcing or running interactive_bonds.R should generate the interactive plot like this:

Bond price

The example is completly theoretical as it assumes that at time when when the bond with coupon rate c (and selected TTM and coupon frequency) is issued, we select the required Yield. If the yield matches the coupon rate the price matches the face value (expresed as percentage) and there is no risk. However, if some new interest rate is applied ( see x-axes on top), we can observe the new theoretical price (in second y- axis). In addition the script calculates the Macaulay’s duration, modified duration, convexity and convexity effect.

bonds's People

Contributors

mjeshtri avatar

Stargazers

 avatar

Watchers

 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.