preview

Use Matlab to Understand Bonds Valuation

Decent Essays

Use Matlab to get an intuitive understanding of bonds valuation.

1. Basic knowledge:
1.1 The price equation and its six contributing factors
As we know, there are six factors that determine the expected price of bonds: the par value(F), the maturity(n) the yield to maturity(y), the coupon interest(CF), the interest payment frequency(m), and the interest rates for each period(ri).

We assume that the coupon interest is fixed, then the price of bonds(P)is the discounted cash flows of each period:
P=i=1nm(CF(1+ym)i)+F(1+ym)mn=i=1nm(CF(1+rim)i)+F(1+rnm)mn

Indeed, to intuitively understand this equation is not easy. Firstly, we can see that the yield to maturity(y) is a kind of “average” of the interest rates(ri) for each …show more content…

In order to make the chart more easy to see, we change maturity to 20(That is n=20, r =[0.051:0.001:0.07]), the code is

r=[0.051:0.001:0.07]; n=1:20;plot(n,r) hold all ytm1=ytmm(r,10,100); plot(n,ytm1)

r=[0.051:0.001:0.07]; n=1:20;plot(n,r) hold all ytm1=ytmm(r,10,100); plot(n,ytm1)

The chart is
Chart 1
Interest rates(r)
YTM
Interest rates(r)
YTM

We can see from the chart that:
① The trend of Interest rates and YTM are the same.

Get Access