Future value & compounding frequencies

Bond Valuation and Analysis in Python

Joshua Mayhew

Options Trader

Compound interest with multiple cash flows

  • USD 1,000 deposit
  • 3% interest rate paid monthly
  • USD 100 top ups (extra deposits) at the end of each month
  • How much do we have after 3 months?
Bond Valuation and Analysis in Python

Compound interest with multiple cash flows

deposit_fv = 1000 * (1 + 0.03) ^ 3

topup_1_fv = 100 * (1 + 0.03) ^ 2
topup_2_fv = 100 * (1 + 0.03) ^ 1
topup_3_fv = 100
print(deposit_fv + topup_1_fv + topup_2_fv + topup_3_fv)
1401.82
print(deposit_fv + topup_1_fv + topup_2_fv + topup_3_fv - 1000 - 100 - 100 - 100)
101.82
Bond Valuation and Analysis in Python

The future value function

  • Previous approach can get very repetitive
  • NumPy Financial can help simplify these calculations
import numpy_financial as npf

?npf.fv
Signature: npf.fv(rate, nper, pmt, pv)

Given: * an interest `rate` compounded once per period, of which there are
* `nper` total
* a (fixed) payment, `pmt`
* a present value, `pv`
Return: the value at the end of the `nper` periods
Bond Valuation and Analysis in Python

The future value function

  • Rate: 3% per period (per month)
  • Number of periods: 3 months
  • Payment: USD -100 top ups at the end of each month
  • PV: USD -1,000 deposit
Bond Valuation and Analysis in Python

The future value function

npf.fv(rate=0.03, nper=3, pmt=-100, pv=-1000)
1401.82
Bond Valuation and Analysis in Python

Compounding frequencies

How much do we have after 10 years investing $1,000 (no top-ups) at:

  • 5% annual interest paid annually
  • 5% annual interest paid monthly
  • 5% annual interest paid daily
Bond Valuation and Analysis in Python

Compounding frequencies

  • The rate is divided by the frequency and the number of periods multiplied by the frequency
# Using annual compounding frequency
npf.fv(rate=0.05, nper=10, pmt=0, pv=-1000)
1628.89
# Using monthly compounding frequency
npf.fv(rate=0.05/12, nper=10*12, pmt=0, pv=-1000)
1647.01
# Using daily compounding frequency
npf.fv(rate=0.05/365, nper=10*365, pmt=0, pv=-1000)
1648.66
Bond Valuation and Analysis in Python

Let's practice!

Bond Valuation and Analysis in Python

Preparing Video For Download...