-
Return and Variance 7
-
Lecture1.1
-
Lecture1.2
-
Lecture1.3
-
Lecture1.4
-
Lecture1.5
-
Lecture1.6
-
Lecture1.7
-
-
Solving Equations 5
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
Lecture2.4
-
Lecture2.5
-
-
Capital Allocation Line 6
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
Lecture3.4
-
Lecture3.5
-
Lecture3.6
-
-
Diversification 3
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
-
Investment Sets 3
-
Lecture5.1
-
Lecture5.2
-
Lecture5.3
-
-
Portfolios 7
-
Lecture6.1
-
Lecture6.2
-
Lecture6.3
-
Lecture6.4
-
Lecture6.5
-
Lecture6.6
-
Lecture6.7
-
-
Capital and Security Market Lines 3
-
Lecture7.1
-
Lecture7.2
-
Lecture7.3
-
-
Arbitrage 3
-
Lecture8.1
-
Lecture8.2
-
Lecture8.3
-
-
Dividend Discount Model 2
-
Lecture9.1
-
Lecture9.2
-
-
Fixed Income 4
-
Lecture10.1
-
Lecture10.2
-
Lecture10.3
-
Lecture10.4
-
-
Duration and Immunization 4
-
Lecture11.1
-
Lecture11.2
-
Lecture11.3
-
Lecture11.4
-
Duration
Instead of introducing the equation for duration right away, we will work through an example. We have a 3 year, 5% coupon bond with face value of 1000. If r = 8%, what is the present value?
Well, let’s first get the cash flows for each period.
Period | Cash Flow |
1 | 50 |
2 | 50 |
3 | 1050 |
Let’s get the present value of each.
flows = [50,50,1050]
period = [1,2,3]
flowsPV = [x/(1.08)**y for x,y in zip(flows,period)]
print(flowsPV)
print(sum(flowsPV))
Period | Cash Flow | PV |
1 | 50 | 46.29629629629629 |
2 | 50 | 42.86694101508916 |
3 | 1050 | 833.5238530711781 |
Now, what we want to see is what the present value of each cash flow is in terms of the total present value. This weight will be a factor in the duration equation.
weights = [x/922.6870903825636 for x in flowsPV]
print(weights)
Period | Cash Flow | PV | Weights |
1 | 50 | 46.29629629629629 | 0.05017551104687177 |
2 | 50 | 42.86694101508916 | 0.04645880652488127 |
3 | 1050 | 833.5238530711781 | 0.9033656824282469 |
The final step is multiplying these weights by the number of periods until each cash flow is realized. We will then sum these numbers to get the duration.
weightedYears = [x*y for x,y in zip(weights,period)]
print(weightedYears)
print(sum(weightedYears))
Period | Cash Flow | PV | Weights | Weighted Years |
1 | 50 | 46.29629629629629 | 0.05017551104687177 | 0.05017551104687177 |
2 | 50 | 42.86694101508916 | 0.04645880652488127 | 0.09291761304976254 |
3 | 1050 | 833.5238530711781 | 0.9033656824282469 | 2.7100970472847408 |
We get a duration of 2.853 from this bond. This duration is called Macaulay duration (other forms of duration will be covered in the fixed income course) and its equation is:
Equation
t
t = Period
w
t
= Weight in Period t
Challenge