Saturday, June 19, 2010

A plot of Yield vs Bond Prices

Been sick for the last week so I've decided to take the weekend off from social activities and spend it at home. There is only so much time one can spend in bed so I've gotten out of bed and decided to get back into some programming and study some finance. I decided to do some basic study in bonds since it seemed simple enough, at least compared to learning options and Black-Scholes equation (I have a basic understanding of the formula, it's just an implementation and testing problem and writing software to make calculations easier).

The mathematics of modeling bond prices is fairly simple using a discounted cash flow (DCF) model based on some internal rate of return (IRR). Basically, a bond is a security with (or without) a fixed interest payment at some interval (annually, semi-annually or quarterly) and finally the redemption of the bond at the end of the term. Calculating and comparing the value of one bond against others requires the comparison of yield to decide if you want to select one bond over another.

In mathematical notation the DCF for the present value of cash flow is summarized as:

$\color{white}PV =\sum_{t}P_t(1+IRR)^-^t$

Where:
  • $\color{white}P_t$ is the cash flow at some point in time $\color{white}t$
  • $\color{white}IRR$ is the internal rate of return
  • $\color{white}PV$ is the present value of all future cash flows
The pricing of the bond represents its present value and what is required to be done is the calculation of the IRR, resulting in the determination of the yield of the bond. Unfortunately, calculation of the yield is not a simple process-- the PV equation is often a problem of multiple polynomial order. To find the solution to this problem a solver is required, which basically is a glorified "guess and checker" to find the right solution to the yield that satisfies the present value of the bond.

This is of course is possible to do in Excel with the use of its solver module. The problem, however is tedious when you want to calculate over a range of possible bond prices to understand the sensitives of yield vs bond prices as the solver needs to be rerun for every bond price and every IRR needs to be saved and then plotted for.

With a bit of some spare time on my hands, I decided to write a simple solver and plot over a range of different bond prices to understand the relationship of yield vs bond price over 3 different bond interest (coupon?) rates for a 5 year bond. The result is illustrated in the graph below (click for a larger view):

What this graph illustrates is the inverse relationship between yield and price of a bond. The higher the cost of a bond, the lower the yield, which of course should be obvious when you think about it since you get less return when you pay more to buy a bond.

The graph also explains the cursory impact of Federal Bank interest rates on the bond market-- what it means is that increasing interest rates will generally force bond prices lower because future cash flows are valued less with higher interest rates. The reverse is also true when interest rates are decreased, bringing bond prices upwards.

Though quantitative valuation of bond pricing can be done mathematically to get nice numbers, investors must also be confident with the company to repay its bonds. Confidence or risk is also a factor affects the yield of a bond. Companies that are considered low risk, generally garner lower yields as there is stronger demand for their bonds thus pushing the price of the bond upwards. Companies that are considered riskier generally have less demand and their bond prices tend to be lower. The market in this sense sets the interest rate at which a company borrow cash as the yields for newly written bonds must be at least equal or greater than the bonds being currently traded-- if yields are lower than currently traded bonds, then there is no incentive to buy the new bonds.

There are inherent dangers of relying strictly on mathematical models for bond pricing as the qualitative aspects of bond pricing, mainly the confidence factor is not well represented in the numerical analysis and this is a source of significant risk. The recent economic crisis had also caused a crash in the bond market as confidence for many companies to continually repay their debt dropped, leading to depressed bond prices and an opportunity to acquire bonds with very high yields, so long as you were able to pick the correct companies.

Though it would be smart to sell of bond assets before an economic crash, bonds appear to be fairly safe so long as the underlying company does not go bankrupt or default. Supposing that you bought a 5 year bond just before for a decent yield at 7% or something before an economic crash and assume that the company is well off enough to survive for at least the next 5 years, you are guaranteed to get your money back with interest when the bond matures. For the matter of equities, you have no guarantees if stock prices will recover within that time span. In this regard, bonds are fairly stable when compared to buying stock equity.

The next step will be to find sources of data on where I can look up the specific details of bonds on the market, in addition to their payment schedule to refine and develop more accurate pricing calculations. I assume that many quants have done this already since the bond pricing is time sensitive as a result of the DCF model. The birth of "snatching nickels from under a steam roller" was a result of quants trying to pick up small profits through arbitration in the bond markets... however the amount of capital that had to be moved around to pick up these small "nickels" was immense, meaning that sudden large movements in the bond market would be catastrophic if an institution was caught. Some of the details of this can be found in Black Swan, a book by Taleb.

2 comments:

Sacha said...

Justin,

Strongly recommend you get a copy of Fabozzi's "Handbook of Fixed Income Securities" and gloss through it. I believe it is even available as an e-book in case if your Japanese library doesn't have a copy. The Vancouver Public Library does.

Paladiamors said...

Thanks for the recommendation. Found a copy and will flip through it.