10.12.2019 Views

Python for Finance

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Time Value of Money

The output is shown here:

Appendix F – graphical presentation of NPV

profile with two IRRs

Since the direction of cash flow changes twice, we might have two IRRs:

import scipy as sp

import matplotlib.pyplot as plt

cashflows=[504,-432,-432,-432,832]

rate=[]

npv=[]

x=[0,0.3]

y=[0,0]

for i in range(1,30):

rate.append(0.01*i)

npv.append(sp.npv(0.01*i,cashflows))

plt.plot(x,y),plt.plot(rate,npv)

plt.show()

[ 104 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!