Leader

Wednesday 8 April 2015

Alternative function: Future value of lump sum

See also the time value of money for other related Matlab functions.

Download
fvLump.m

Introduction
The future value (FV) of a single lump sum of cash is its present value (PV, see also pvLump.m and npvflow.m) plus interest earned over a period of time. Interest can be earned in two ways - simple interest or compound. Simple interest is linear and is a proportion of the original amount applied at the end of the time period. Compound interest, which is mostly commonly used, increases in an exponential fashion as it is added at each time period and adds to the amount on which the interest is applied in the next period. fvLump provides an alternative to fvdisc in the financial toolbox.

Simple interest
FV = PV * (1+r*t)

Compounding interest
FV = PV * (1+r)^t

Where = interest rate and = number of time periods.

These equations are available in fvLump. For calculating the future value of a cash flow, for example, when saving a regular amount of money and earning interest, see nfvFlow.m.




Examples
How much money would you have if you kept £1,000 in a savings account for 10 years? The annual (compounding) interest rate is 3%
FV = 1000 * (1+0.03)^10 = £1344.

Matlab code: fvLump(1000, 0.03, 10, 2)


What is the future value of £50,000 saved for 5 years at an annual interest rate of 4%? The interest compounds monthly.
In this case, we need to work with monthly periods. The monthly interest rate is the annual rate divided by 12, and there are 5*12 months in 5 years.
FV = 50000 * (1+0.04/12)^(5*12) = £61,050.

Matlab code: fvLump(50000, 0.04/12, 5*12, 2)


How much more money would you earn when interest compounds, compared to when it doesn't compound, on £5,000 over 25 years? The annual interest rate is 3.77%.
Simple interest: 5000 * (1+0.0377*25) = £9,713
Compound interest: 5000 * (1+0.0377)^25 = £12,611
Difference = 12611-9713 = £2,898 better off with compound interest.

Matlab code: fvLump(5000, 0.0377, 25, 2) - fvLump(5000, 0.0377, 25, 1)


Code run-through
function fv = fvLump(lumpSum, rate, periods, interestType)

fvLump takes four inputs, the present value of the lump sum (lumpSum), the interest rate (rate), the number of periods (periods), and interestType which indicates the type of interest, where 1= simple and 2= compound. It returns the future value as an output (fv).

c=lumpSum;
t=periods;
r=rate;

switch interestType
    case 1
        % Simple interest
        fv = c * (1+r*t);
    case 2
        % Compound interest
        fv = c * (1+r)^t;
end

A switch/case block checks interestType and applies the correct equation, depending on the type of interest requested.

No comments:

AdSense