-
Compound Interest Part 1 6
-
Lecture1.1
-
Lecture1.2
-
Lecture1.3
-
Lecture1.4
-
Lecture1.5
-
Lecture1.6
-
-
Compound Interest Part 2 3
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
-
Present Value 4
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
Lecture3.4
-
-
Annuities 6
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
Lecture4.4
-
Lecture4.5
-
Lecture4.6
-
-
Perpetuities 2
-
Lecture5.1
-
Lecture5.2
-
-
Bonds 6
-
Lecture6.1
-
Lecture6.2
-
Lecture6.3
-
Lecture6.4
-
Lecture6.5
-
Lecture6.6
-
-
Dividend Discount Model 3
-
Lecture7.1
-
Lecture7.2
-
Lecture7.3
-
-
Risk 8
-
Lecture8.1
-
Lecture8.2
-
Lecture8.3
-
Lecture8.4
-
Lecture8.5
-
Lecture8.6
-
Lecture8.7
-
Lecture8.8
-
-
Capital Asset Pricing Model 6
-
Lecture9.1
-
Lecture9.2
-
Lecture9.3
-
Lecture9.4
-
Lecture9.5
-
Lecture9.6
-
Finding r
Finding r¶
To find r we are going to have a much tougher time since there is no easy equation solution. To solve it we need to experiment. Let’s set the parameters below and try out different values of r and see if it will get us to match the values. In this lesson we are going to just try a couple values, but there are more advanced methods that you can use that we won’t introduce here. I made the example easy to work out by guessing very 1% within a limited range.
#Set up the parameters
PV = 768.3479521244554
F = 1000
c = .02
n = 10
We can predict the present value for something like say 2% and see what the difference between the actual and predicted is.
#Let's try to see what our PV would be if r=2%
predicted = bond_value(F,c,n,.02)
print(predicted)
1000.0
If we check the difference we see it is not very close.
print(predicted-PV)
231.65204787554455
What we could do is test different rates and see which one gets us closest to the PV we are given
rates = [x/100 for x in range(1,13)]
print(rates)
print()
values = [bond_value(F,c,n,x) for x in rates]
print(values)
[0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12]
[1094.7130453070167, 1000.0, 914.6979716322417, 837.7820844128994, 768.3479521244554, 705.596517943412, 648.8209229533697, 597.3951160635131, 550.7639609188691, 508.4346315436251, 469.9691189972911, 434.97769715891326]
If we look for the absolute value in the difference between present value and predicted, this will help us find the closest fit.
#Differences
diff = [abs(x-PV) for x in values]
print(diff)
[326.3650931825613, 231.65204787554455, 146.35001950778621, 69.43413228844395, 0.0, 62.751434181043464, 119.5270291710857, 170.95283606094233, 217.58399120558636, 259.9133205808304, 298.37883312716434, 333.3702549655422]
#Find the the minimum error
print(min(diff))
0.0
#Get the index of it
i = diff.index(min(diff))
print(i)
4
#And find the rate that got us there
print(rates[i])
0.05
After doing this, we see that we have the correct rate r to get the present value we saw before!
print(PV)
print(bond_value(FV,cr,n,rates[i]))
768.3479521244554
768.3479521244554