-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Python for Finance

In Chapter 5, Bond and Stock Valuation, we have discussed the concepts of a term structure of interest rate. The term structure of interest rate is defined as the relationship between risk-free rate and time. A risk-free rate is usually defined as a default-free treasury rate. From many sources, we could get the current term structure of interest rate. For example, on 2/27/2017 from http://finance.yahoo.com/bonds, we could get the following information:
The plotted term structure of an interest rate could be more eye catching; see the following codes:
import matplotlib.pyplot as plt time=[3./12.,6./12.,2.,3.,5.,10.,30.] rate=[0.45,0.61,1.12,1.37,1.78,2.29,2.93] plt.title("Term Structure of Interest Rate ") plt.xlabel("Time (in years) ") plt.ylabel("Risk-free rate (%)") plt.plot(time,rate) plt.show()
The related graph is shown here:
To simulate future interest movement, we could apply the so-called BIS model with the following formulas...
Change the font size
Change margin width
Change background colour