Financial Algorithms Cookbook | Time Value of Money

Algorithm: Calculating the Future Value

Future Value Of A Single Amount

Future Value is the amount of money that an investment made today (the present value) will grow to by some future date. Since money has time value, we naturally expect the future value to be greater than the present value. The difference between the two depends on the number of compounding periods involved and the going interest rate.

The relationship between the future value and present value can be expressed as:

FV = PV (1 + i)n

Where:

  • FV = Future Value
  • PV = Present Value
  • i = Interest Rate Per Period
  • n = Number of Compounding Periods

Future Value of Annuities

An annuity is a series of equal payments or receipts that occur at evenly spaced intervals. Leases and rental payments are examples. The payments or receipts occur at the end of each period for an ordinary annuity while they occur at the beginning of each period.for an annuity due. Future Value of an Ordinary Annuity

The Future Value of an Ordinary Annuity (FVoa) is the value that a stream of expected or promised future payments will grow to after a given number of periods at a specific compounded interest.

The Future Value of an Ordinary Annuity could be solved by calculating the future value of each individual payment in the series using the future value formula and then summing the results. A more direct formula is:

FVoa = PMT [((1 + i)n - 1) / i]

Where:

  • FVoa = Future Value of an Ordinary Annuity
  • PMT = Amount of each payment
  • i = Interest Rate Per Period
  • n = Number of Periods

Future Value of an Annuity Due (FVad)

The Future Value of an Annuity Due is identical to an ordinary annuity except that each payment occurs at the beginning of a period rather than at the end. Since each payment occurs one period earlier, we can calculate the present value of an ordinary annuity and then multiply the result by (1 + i).

FVad = FVoa (1+i)

Where:

  • FVad = Future Value of an Annuity Due
  • FVoa = Future Value of an Ordinary Annuity
  • i = Interest Rate Per Period

Putting it all togeather gives us the below algorithm.

def  futureValue(i, PV, PMT, n, inAdv=False, continous=False):
  i /= 100.0
  nFractionPart,nIntegerPart  = modf(n)
  discount = pow(1.0+i, -nIntegerPart)
  if continous:
    pvs =pow((1.0+i),nFractionPart) 
  else:
    pvs =(1.0+ i*nFractionPart) 
  if inAdv:
    PMT *=(1.0+i)
  fv = -(PMT *((1.0-discount)/i)+PV*pvs)/(discount)
  return fv

Example

You are saving 500 a month (at the beginning of each month) into a new deposit account that pays 6.25 annual interest compounded monthly. How much will you have after 2 years?

PV=0
PMT = -500
n= 2*12
i = 6.35/12.0
futureValue(i, PV, PMT, n, inAdv=True)
>>12826.91

References

  • Gallager, T; Andrew Jr., J., Financial Management: Principals and Practices, Upper Saddle River, NJ: Prentice Hall, 1996
  • HP-12C Business Calculator Owner's Manual, Hewlett Packard, 1984
  • HP-10B Business Calculator Owner's Manual, Hewlett Packard, 1994