Investment Science - Bond Portfolio Immunization Example

Tuesday, September 21, 2010

Based on the knowledge we gained from the previous posts on Bond portfolio immunization, it's time to look into a comprehensive example on Bond Portfolio immunization which directly brings me to an interesting problem from Investment Science by Luenberger on bond portfolio immunization - Problem 3.12

Problem 3.12

(Bond Selection) Consider the four bonds having annual payments as shown in the below table, they are traded to produce a 15% yield.
 
 
(a) Determine the price of each bond

We know that for all the bonds, Yield λ = 15%, m = 1


For Bond A, F = 1000, C = 100, n = 3
For Bond B, F = 1000, C = 50, n = 3
For Bond C, F = 1000, C = 0, n = 3 (Zero coupon bond of 3 year duration)
For Bond D, F = 1000, C = 0, n = 1 (Zero coupon bond of 1 year duration)

Based on the Bond price formula discussed in the previous article, we find that,

Price of bond A, PA = $885.832, PB = $771.671, PC = $657.516 and PD = $869.565

(b) Determine the duration of each bond (not the Modified Duration)

From on the Bond duration formula discussed in the previous article, we find that

Duration of bond A, DA = 2.716, DB = 2.836, DC = 3 and DD = 1

(c) Which bond is most sensitive to a change in yield?

From the Bond Priced Sensitivity formula discussed in the previous article, we find that bond C is more sensitive to a change in yield (of course, it's a zero coupon bond with 3 year duration)

(d) Suppose you owe $2000 at the end of 2 years. Concern about interest rate risk suggests that a porfolio consisting of the bonds and the obligation should be immunized, If VA, VB, VC and VD are the total values of bonds purchased of types A, B, C and D, respectively, what are the necessary constraints to implement the immunization? [Hint: There are two equations. (Do not Solve.)]

From the bond portfolio immunization constraints discussed in the previous article, we find that

Present Value of the obligation P = 2000 / (1.15 ^ 2) = $1512.287

If VA , VB , VC and VD represents the value of each bond (which is equal to the price of the bond multiplied by the number of quantities of the bond purchased, see this article)

VA + VB + VC + VD = P = $1512.287
DA * VA + DB * VB + DC * VC + DD * VD = 2 * 1512.287 or

2.716 * VA + 2.836 * VB + 3 * VC + VD = 3024.574

(e) In order to immunize the portfolio, you decide to use bond C and another bond, Which other bond should you choose? Find the amounts (in total value) of each of these to purchase

We know that one of the immunization constraints is that the average duration of the bond portfolio should be greater than or equal to the duration of the obligation, in this case if we select bond D with C, then the average duration (3 + 1) / 2 = 2 matches the duration of the obligation which is exactly 2 years, therefore we select bond C and bond D, then from the bond portfolio immunization constraint in section (d), we have

VC + VD = 1512.287
3 * VC + VD = 3024.574

Solving, we get, VC = VD = $756.14

Therefore, number of shares of bond C = VC / PC = 756.14 / 657.516 = 1.15
Number of shares of bond D = VD / PD = 756.14 / 869.565 = 0.869

Therefore if one buys 1.15 shares of bond C and 0.869 shares of bond D, the bond portfolio will be immunized.

(f) You decided in (e) to use bond C in the immunization. Would other choices, including perhaps a combination of bonds, lead to lower cost?

Obviously not, based on the bond portfolio immunization constraints since the sum of the total value of the bonds should be equal to the present value of the obligation (see section (d)), alternate choice of bonds will not lead to lower cost, but one should make sure that the average duration of the bonds in the portfolio should be greater than or equal to the duration of the obligation.

A big post indeed, if we understand this, we can immunize any bond portfolio and ensure that we will never lose money.

Acknowledgements: Thanks to Prof. Luenberger for posting this problem in his valuable text book on Investment Science and Prof. Charles Feinstein for his lucid explanation of the bond portfolio immunization concept, this is one of the valuable lessons we learned in bond investments.

Investment Science: The Price of a bond and it's duration using excel/spreadsheet

Saturday, September 18, 2010

In this post, we will compute the price of a bond and it's duration using a an excel/spreadsheet, as always I use openoffice for my spreadsheet computations and you can always import the openoffice spreadsheet as a Windows compatible excel file.

For calculating the price of the bond and it's duration, we will take a sample problem from Investment Science by Luenberger (Problem 3.10)

Problem 3.10 Find the price and duration of a 10-year, 8% bond that is trading at a yield of 10%.

Based on the formula for the price of a bond and it's duration as discussed in the previous article, we know that for the above case

The price of the bond P = $83.537
Duration of the bond D = 6.84

The same can be calculated quite easily using the below excel/spreadsheet which can be re-used to calculate the price/duration of any bond.



Investment Science: Bond Price Sensitivity

Tuesday, September 14, 2010

Before looking into a practical example on immunizing a bond portfolio, let's look at an important concept related to bonds, the Bond - price sensitivity, as we know that the price of a bond is affected by changes in yield and in this post we will look into the mathematical formula for computing the change in price of a bond with respect to a given change in yield.

The bond price sensitivity formula is given below


Where

P = Price of the bond
D = Macaulay Duration of the bond
λ = Yield to Maturity (YTM)
m = Number of coupon periods
dP = Change in price
dλ = Change in yield

The above formula can also be written as


Where DM is the modified duration of the bond.


As we said before, zero coupon bonds are more sensitive to changes in yield than the coupon bonds, let's see how the price of the bond gets affected for a small change in yield.

For this example, first we will consider a 30-year, 8% bond that is trading at a yield of 10% with yearly coupon payments.

For this bond, based on the bond price formula discussed in the previous article, we get,

P = $81.146 and D = 10.646 (refer to the duraton formula)

Assume that the yield increases by 1% (dλ = 0.01) in the above scenario in which case based on the above formula for Bond - sensitivity, we have

dP = -1/1.1 * 10.646 * 81.146 * 0.01 = -7.853 or the price reduces by 9.68% (-7.853/81.146) if the yield increases by 1%.

Consider a 10-year, zero coupon bond that is trading at a yield of 10%, for this bond,

P = $5.7308 and D = 30

For a 1% increase in yield (dλ = 0.01), we have

dP = -1/1.1 * 30 * 5.7308 * 0.01 = -1.562 or the price reduces by 27.25% (compared to 9.68% for the coupon bond)

Hence zero coupon bonds of longer duration are more sensitive to changes in yield, with this knowledge, we are all set to explore a real world example on bond portfolio immunization in the next article.

MS&E 242S in Stanford - A Quality course in Investment Science

Saturday, September 11, 2010

If you are following my recent posts, they are related to Investment Science - the recent course I completed in Stanford, just want to write a little about that and also on the importance of understanding about investments.

The MS&E 242S is offered through SCPD (a program which accepts working professionals to study part time there) in Stanford, though initially I was uncomfortable in grasping some of the investment  terminologies, but now I am very keen to write about those because I want to keep a reference of the important concepts of investment science which can be put into practical use.

Let me give you a short summary of what this course is about.

1. What will you learn?
2. Which part of it I liked the most?
3. References to this course
4. Where to enroll to this course

1. What will you learn? Well it's mainly about the scientific principles and practical applications of investment science which will help you to make good investment decisions like deciding among several investment options, understanding different kinds of investments, investment decisions under uncertainty and so on, everything clearly elucidated with classic real world examples

2. Which part of it I liked the most? Well it's everything because I wasn't aware of those concepts before I took this course but what fascinated me the most is the techniques to immunize an investment portfolio (specific to bond investments) against factors that affect the value of the investments over time (like interest rates, yields), ideally that should inspire anyone to research more on the techniques to immunize different kind of investments, because at the end of that day no one wants to lose money....

3. References to this course: One of the best books on this subject is Investment Science by Luenberger, ideally it should be on your bookshelf if you are keen on investment related studies, but it's also a very good read to understand different concepts in investments which you may hear in day to day life like Mortgages, auto loans, long term growth of an investment , modern investment portfolio and so on, you will learn more on solving some problems at the end of each chapter.

4. How to enroll in this course: It's offered in different quarters, but check this page for more details.

Investment Science: Bond Portfolio Immunization

Thursday, September 9, 2010

In this article, we will look into an important concept in bond investments, which is immunizing a bond portfolio, assume that you have a future obligation (or a financial need) to meet with your current bond investments and ensure that the future obligation is met irrespective of market conditions (changes in yield/interest rates), or in other words you want to immunize your bond portfolio against changes in yield.

Immunizing a bond portfolio is something which has practical applications in investment science in that it can be mathematically proven that when you immunize your bond portfolio, you will be protected against changes in yield (whether they go up or down), though we don't need to dig deep into the mathematics of it, in this article we will see the necessary conditions to be met for immunizing your bond portfolio.

It can be easily said that zero coupon bonds are the first choice solution for immunizing without having a portfolio, if you have a financial obligation of F after a duration of D years, you can buy a zero coupon bond with it's present value P which will pay it's face value F after D years, but assume that zero coupon bonds are not available, in which case you need to invest in a bond portfolio to meet your needs.

For the sake of simplicity, assume that there are two bonds available with

Bond 1: Price = P1 , Duration = D1
Bond 2: Price = P2 , Duration = D2

Consider that you have an obligation F (with a present value of P) after D years which you wish to meet by investing in the above two bonds, then the required conditions for bond portfolio immunization are

Step 1: The duration of the obligation D should be such that


(The weighted duration of the bonds should be greater than or equal to the duration of the obligation)

Step 2: Compute the present value of the obligation


Where 'm' is the number of coupon periods in an year, λ is the market yield.

Step 3: Buy 'x' shares of Bond 1 and 'y' shares of bond 2 such that


Therefore based on the above equations, if you have a future obligation F with a present value of P and duration D, you can meet your obligation by investing in 'x' shares of Bond 1 and 'y' shares of Bond 2 subject to the above constraints to protect against changes in yield, the above criteria for bond portfolio immunization can easily be extended to 'n' bonds.

I know it's may not be easy to understand this important concept without an example, we will look into a more practical example on how to immunize a bond portfolio in the next article.

Techtalks: What's this blog about?

Tuesday, September 7, 2010

Yes, you got the question right, a question I wanted to answer for a long time, though in my introduction, I gave a prelude of what this blog is all about, let me give a more in-depth overview in the form of a series of Question/Answers.

1. What's this blog about?
2. What's in it for me?
3. Why should I subscribe to this blog and what's the value?
4. What's your commitment to Techtalks what about the future of this blog?

1. What's this blog about?

As the name say's its all - Techtalks, the articles of this blog will be related to several subjects varying from technology, management, troubleshooting, FAQ, programming, useful code, technical tips, best practices, definitions, problem solving and so on, also I write about some technical stuff which I use frequently in my day-to-day work which serves as a personal reference to me and may be useful for others as well.

2. What's in it for me?

Good question, the chances are that if you landed on to this blog, that means you may have found something which you've been looking for here, be it some useful code or a troubleshooting tip or a reference to an article or some information you've been looking for, and that answers the question, What's in it for me, you've found some value here and that's what we strive to achieve.

3. Why should I subscribe to this blog and what's the value?

First of all thanks for subscribing to this blog, this means you are interested in following the articles (may be in your area of interest) in this blog, in general I write about several stuff which may be useful at some point to someone, in fact I myself refer this blog for at times when I want to refer some solutions, that being said I understand that it's hard for someone to follow all articles in a diverse blog like this focussing on different areas, but the main point is

"You will learn something from your subscription some day"

Take my words, I subscribe to multiple blogs focussing on different areas (the most prominent of them is about.com), but some days I get articles which are of interest to me, when I read those as a subscriber, I feel glad that I subscribed to that particular blog, same thing happens with every other blog, though it's hard to subscribe to many blogs and follow all articles, but sooner than later you may find something which will be of interest to you.

4. What's your commitment to Techtalks what about the future of this blog?

My commitment is "I will post an interesting article to this blog everyday", take this word from me, there are lot's of interesting stuff to write about in different domains and share those with readers and we have plans to expand this blog in future to make it more professional, productive and user friendly for the readers, so there are lots of fun ahead, keep watching and posting your comments.

Last but not the least, I get mails/blog comments from several readers who have their own questions/doubts on some articles, I will to respond to those in my free time, but chances are that the answer you 've been looking for may already be there (typical example is my post related to Socket programming which attracted several readers), also feel free to send constructive feedbacks/corrections to me as and when appropriate.

Setting up an NFS share on Linux

In this post, we will see how to setup an NFS share in linux and access remote directories shared from the NFS server from an NFS client machine.

Assuming that you have an NFS server with an IP 10.5.150.1 and NFS client 10.5.150.2, the steps to share and access the NFS shared directory is as follows.

1. Lets assume that the NFS directory you want to share is /export/NFS-Server/share in the NFS server box.
[root@10.5.150.1]# pwd
/export/NFS-Server/share
[root@10.5.150.1]# ls -l
total 0
-rw-r--r-- 1 root root 0 Sep  6 14:08 nfs_server_file.txt
[root@10.5.150.1]#
2. If you want to grant read/write permissions for this directory, then edit /etc/exports and add the directory entry you want to share with the read/write permissions as shown below.
[root@10.5.150.1]# chmod 777 /export/NFS-Server/share/
[root@10.5.150.1]# cat /etc/exports
# Generated by Allstart on Wed Sep  1 04:53:40 2010
/export/NFS-Server/share   *(rw)
# Put custom additions below (Do not change/remove this line)
[root@10.5.150.1]#
Note: You can additionally configure the /etc/hosts.allow and /etc/hosts.deny for increased security for the NFS share, but those details are outside the scope of this article.

3. Once the directory is shared in the NFS server, restart NFS service for the share to be active.
[root@10.5.150.1]# /etc/init.d/nfs stop
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                  [  OK  ]
Shutting down NFS quotas:                                  [  OK  ]
Shutting down NFS services:                                [  OK  ]
[root@10.5.150.1]# /etc/init.d/nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@10.5.150.1]#
4. Now the NFS share can be accessed from the client system which can be mounted to the shared directory on the NFS server.

(Assuming that the directory is mounted on /export/NFS-Client/share on the NFS client 10.5.150.2)
[root@10.5.150.2]# pwd
/
[root@10.5.150.2]# mkdir -p /export/NFS-Client/share
[root@10.5.150.2]# ls -l /export/NFS-Client/share/
total 0
[root@10.5.150.2]# mount 10.5.150.1:/export/NFS-Server/share/ /export/NFS-Client/share/
[root@10.5.150.2]# cd /export/NFS-Client/share/
[root@10.5.150.2]# ls -l
total 0
-rw-r--r-- 1 root root 0 Sep  6 17:38 nfs_server_file.txt
[root@10.5.150.2]# touch new-file.txt
[root@10.5.150.2]# ls -l
total 0
-rw-r--r-- 1 65534 65534 0 Sep  6 17:40 new-file.txt
-rw-r--r-- 1 root  root  0 Sep  6 17:38 nfs_server_file.txt
[root@10.5.150.2]# umount -f /export/NFS-Client/share/
[root@10.5.150.2]# ls -l /export/NFS-Client/share/
total 0
[root@10.5.150.2]# 

Investment Science: The price of a bond and it's relationship to the Present Value formula

Monday, September 6, 2010

In this article, we will see the relationship between the price of a bond and the present value (of an investment/annuity) formula, we will take both types of bonds into account, namely the zero-coupon bond and coupon bond.

We know that the price of a bond is given by


where

P = Price of the bond
F = Face value of the bond
C = Coupon payment per year
m = Number of periods in an year the coupon is paid (Typically m = 2 or coupons are paid every 6 months)
n = Number of coupon periods left (with m coupon periods per year)
λ = Yield to maturity

For a zero coupon bond (C = 0), therefore the above formula becomes


We know the relationship between the Present value and the Future value of an investment (compounded at 'm' periods per year at an interest rate 'r' for 'n' years) is given by



Note the similarities, the price of a zero coupon bond is the face value discounted by it's yield to maturity (YTM),  something similar to the above present value/future value relationship.

The zero coupon bonds typically have longer durations and they are more sensitive to changes in yield than the coupon bonds.

For a coupon bond, the price is given by



We know that the Present value (P) of an annuity which pays an amount A every individual period (an year) for 'n' years at an yearly interest rate 'r' is given by


The first term in the price of the coupon bond can be considered as a part which discounts the face value of the bond (similar to the present value/future value relationship as shown above) and the second term can be considered as the part which discounts the coupon payments which occurs every period (till the bond maturity date), similar to the Present value of an annuity formula.

The above similarities will help one easily understand how the price of a bond is derived.

Investment Science: Duration of a bond

Sunday, September 5, 2010


In this post, we will look into the formula for the duration of a bond, in simple terms, the duration of a bond reflects the sensitiveness of the price of the bond with respect to changes in interest rates or duration measures (dP/dλ) (Percentage change in price over changes in yield) of the bond, duration is mentioned in years and in general bonds with longer duration are more sensitive to changes in yield than bonds with shorter durations.

In this article, we will look into the formula for the Macaulay duration of a bond with a simple example on computing the same to get a quick understanding of the duration of a bond, in further posts, we will explore more on the duration of a bond and how it plays an important role when considering a bond portfolio to meet a given obligation.

The Macaulay duration of a bond is given by

Where

m = Number of coupon periods per year
c = Coupon rate per period
y = Yield per period
n = Number of coupon periods left (with m coupon periods per year)

To compute the Macaulay duration of a bond, we will solve a problem from
Investment Science by Luenberger (Problem 3.10)

Problem 3.10 Find the price and duration of a 10-year, 8% bond that is trading at a yield of 10%.

Here

m = 2 (By default, assume that coupon payments happen every 6 months or 2 periods per year)
C = Coupon payment = 8% of 100 = $8 (By default, assume the face value of the bond F = 100)
Coupon rate per period c = 8%/2 = 4% = 0.04
Yield per period y = 10%/2 = 5% = 0.05
Number of coupon periods remaining, n = 10, n * m = 20

The price of the bond is given by (Refer the article on the price and yield of a bond)

P = $87.537

Based on the above formula, the duration of the bond is given by



D = 6.84


Duration of a zero coupon bond:
What will be the duration of a 10-year, zero coupon bond that is trading at a yield of 10%? It is 10 years (Check the formula for additional proof).

How to keep your system working in Windows 7 when your close your laptop lid

Saturday, September 4, 2010

The reason I am writing this post is because of the frustration I had at times when I started some tasks in my laptop (especially the number of ssh sessions I open through Putty in my VPN connection) expecting it to keep running after I go sleep, but to my surprise often when I resume working, I notice the following.

1. The system goes to sleep state.
2. My VPN connection through Internet goes down when I resume working and so on.

Though we can control the system behavior when closing the laptop lid, but I realized that that alone may not suffice if one wants to keep the system working without any slight change in behavior due to system power settings, therefore select the safest option in Power settings when you are away and you need to keep your computer working on for hours and days without any interruptions.

1. Click Start (The bottom leftmost button with Windows symbol in your laptop) -> Control Panel -> Hardware and Sound -> Change what the power buttons do

2. Select the following settings for different options as shown below (see the figure below as well):

2.1 When I press the power button: Select Shut down for both On Battery and Plugged in options
2.2 When I press the sleep button: Select Do nothing for both On Battery and Plugged in options
2.3 When I close the lid: Select Do nothing for both On Battery and Plugged in options


Note: I am not arguing that it's the best option, but it works for me.

Investment Science: Sum of a Geometric series and applications in computing Net Present Value

Thursday, September 2, 2010

In this post, we will see two very simple, yet powerful shortcuts for calculating the Net Present Value (NPV) of a cash flow, though you may have learnt these formulas already, but they are very useful when finding the Net Present Value of a cash flow stream, especially for long cash flow streams spanning multiple periods.

1. Sum of a geometric series from 0 to n (n +1 terms):

Given a constant 'a' and a constant ratio 'r'


Example:

Consider a cash flow stream (40, 40, 40, 40) at an yearly interest rate 10%, the present value of this cash flow stream is given by


Through the above geometric series formula (with a = 40, r = 1/1.1 and n = 4), it's given by


2. Sum of a geometric series from 1 to n: 

Given a constant 'a' and a constant ratio 'r'


Example:

Consider a cash flow stream (-10, 40, 40, 40) at an yearly interest rate 10%, the present value of this cash flow stream is given by


Through the above geometric series formula, we get (add -10 to the sum of geometric series from 1 to n with a = 40, r = 1/1.1 and n = 3)


Thus, the sum of a geometric progression has a practical application when computing the Net Present Value of a cash flow stream.

Investment Science: The price of a bond and it's yield

In the previous post, we saw an introduction about bonds, in this post we will see the formula for the price of a bond, before that we will introduce what is called the yield of a bond.

The Yield to Maturity (YTM) of a bond is the internal rate of return of a bond at it's market price, the price of a bond and it's yield are inversely proportional, if the price goes down, the yield goes up and vice-versa. A par-bond is one where the yield is equal to the interest rate (coupon rate).

Given the above definition, the price of a bond (P) is given by,


where

P = Price of the bond
F = Face value of the bond
C = Coupon payment per year
m = Number of periods in an year the coupon is paid (Typically m = 2 or coupons are paid every 6 months)
n = Number of coupon periods left (with m coupon periods per year)
λ = Yield to maturity

Lets look at an example from
Investment Science by Luenberger to calculate the price of a bond (Problem 3.9).

Problem 3.9

An 8% bond with 18 years to maturity has a yield of 9%. What is the price of this bond.

In this problem, it is implied that the face value of the bond F = $100 (unless specified otherwise).

m = 2 (Unless explicitly specified, coupons are paid every 6 months in an year)
 
λ = 9%, λ/2 = 4.5%
n = 18, n * m = 36
C = 8% or the coupon payment paid per year = 8% * 100 = $8

Substituting the above values in the Bond price formula, we get


P = $91.164



Copyright © 2016 Prasanna Seshadri, www.prasannatech.net, All Rights Reserved.
No part of the content or this site may be reproduced without prior written permission of the author.