10.12.2019 Views

Python for Finance

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Bond and Stock Valuation

We could manually calculate those missing values. First, a Δ is estimated:

……..(13)

Here, Δ is the incremental value between v2(the ending value) and v1 (the beginning

value), and n is the number of internals between those two values. The Δfor the

above case is (6-2)/3=1.33333. Thus, the next value will be v1+Δ=2+1.33333=3.33333.

For the preceding example, related to the term structure of interest rates, from years

6 to 9, there is no data. The code and output are shown here:

>>> import pandas as pd

>>> import numpy as np

>>> nan=np.nan

>>> x=pd.Series([2,nan,nan,nan,nan,2.53])

>>>x.interpolate()

The output is shown here:

>>>

0 2.000

1 2.106

2 2.212

3 2.318

4 2.424

5 2.530

dtype: float64

>>>

The term structure of interest rates is very important since it serves as a benchmark

to estimate Yield to Maturity (YTM) for corporate bonds. YTM is the period return

if the bond holder holds until the bond expires. Technically speaking, YTM is the

same as Internal Rate of Return (IRR). In the financial industry, the spread, defined

as the difference between YTM of a corporate bond over the risk-free rate, is used to

estimate the discount rate for corporate bonds. The spread is a measure of the default

risk. Thus, it should be closely correlated with the credit rating of the company and

of the bond.

[ 162 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!