Main Content

Analyzing and Computing Cash Flows

Introduction

Financial Toolbox™ cash-flow functions compute interest rates and rates of return, present or future values, depreciation streams, and annuities.

Some examples in this section use this income stream: an initial investment of $20,000 followed by three annual return payments, a second investment of $5,000, then four more returns. Investments are negative cash flows, return payments are positive cash flows.

Stream = [-20000,  2000,  2500,  3500, -5000,  6500,...
            9500,  9500,  9500];

Interest Rates/Rates of Return

This example shows how to compute the internal rate of return of the cash stream using irr.

Specify the income stream as an initial investment of $20,000 followed by three annual return payments, a second investment of $5,000, then four more returns. Investments are negative cash flows, return payments are positive cash flows.

Stream = [-20000,  2000,  2500,  3500, -5000,  6500, ...
            9500,  9500,  9500];

Use irr to compute the internal rate of return of the cash stream.

ROR = irr(Stream)
ROR = 
0.1172

The rate of return is 11.72%.

The internal rate of return of a cash flow may not have a unique value. Every time the sign changes in a cash flow, the equation defining irr can give up to two additional answers. An irr computation requires solving a polynomial equation, and the number of real roots of such an equation can depend on the number of sign changes in the coefficients. The equation for internal rate of return is

eqn1250274604.gif

where Investment is a (negative) initial cash outlay at time 0, cfn is the cash flow in the nth period, and n is the number of periods. irr finds the rate r such that the present value of the cash flow equals the initial investment. If all the cfns are positive there is only one solution. Every time there is a change of sign between coefficients, up to two additional real roots are possible.

Another toolbox rate function, effrr, calculates the effective rate of return given an annual interest rate (also known as nominal rate or annual percentage rate, APR) and number of compounding periods per year. To find the effective rate of a 9% APR compounded monthly, enter

Rate = effrr(0.09, 12)
Rate = 
0.0938

The Rate is 9.38%.

A companion function nomrr computes the nominal rate of return given the effective annual rate and the number of compounding periods.

Present or Future Values

This example shows how to compute the present or future value of cash flows at regular or irregular time intervals with equal or unequal payments.

To compute the present or future value, you can use the following functuions: fvfix, fvvar, pvfix, and pvvar. The -fix functions assume equal cash flows at regular intervals, while the -var functions allow irregular cash flows at irregular periods.

Specify the income stream as an initial investment of $20,000 followed by three annual return payments, a second investment of $5,000, then four more returns. Investments are negative cash flows, return payments are positive cash flows.

Stream = [-20000,  2000,  2500,  3500, -5000,  6500, ...
            9500,  9500,  9500];

Use irr to compute the internal rate of return of the cash stream.

ROR = irr(Stream)
ROR = 
0.1172

Compute the net present value of the sample income stream for which you computed the internal rate of return. This exercise also serves as a check on that calculation because the net present value of a cash stream at its internal rate of return should be zero. Enter

NPV = pvvar(Stream, ROR)
NPV = 
-3.6835e-11

The NPV is very close to zero. The answer usually is not exactly zero due to rounding errors and the computational precision of the computer. Note, other toolbox functions behave similarly. The functions that compute a bond's yield, for example, often must solve a nonlinear equation. If you then use that yield to compute the net present value of the bond's income stream, it usually does not exactly equal the purchase price, but the difference is negligible for practical applications.

Depreciation

This example shows how to compute standard depreciation schedules using depgendb.

The following code depreciates an automobile worth $15,000 over five years with a salvage value of $1,500. It computes the general declining balance using two different depreciation rates: 50% (or 1.5), and 100% (or 2.0, also known as double declining balance).

Decline1 = depgendb(15000, 1500, 5, 1.5)
Decline1 = 1×5
103 ×

    4.5000    3.1500    2.2050    1.5435    2.1015

Decline2 = depgendb(15000, 1500, 5, 2.0)
Decline2 = 1×5
103 ×

    6.0000    3.6000    2.1600    1.2960    0.4440

These results indicate the actual depreciation amount for the first four years and the remaining depreciable value as the entry for the fifth year.

Annuities

This example shows how to work with annuities using annurate.

The following code shows how to compute the interest rate associated with a series of loan payments when only the payment amounts and principal are known. For a loan whose original value was $5000.00 and which was paid back monthly over four years at $130.00/month:

Rate = annurate(4*12, 130, 5000, 0, 0)
Rate = 
0.0094

The function returns a rate of 0.0094 monthly, or about 11.28% annually.

You can use a present-value function (pvfix) to compute the initial principal when the payment and rate are known. For a loan paid at $300.00/month over four years at 11% annual interest:

Principal = pvfix(0.11/12, 4*12, 300, 0, 0)
Principal = 
1.1607e+04

The function returns the original principal value of $11,607.43.

You can compute an amortization schedule using amortize for a loan or annuity. For example, the original value was $5000.00 and was paid back over 12 months at an annual rate of 9%.

[Prpmt, Intpmt, Balance, Payment] = amortize(0.09/12, 12, 5000, 0, 0)
Prpmt = 1×12

  399.7574  402.7556  405.7762  408.8196  411.8857  414.9748  418.0872  421.2228  424.3820  427.5648  430.7716  434.0024

Intpmt = 1×12

   37.5000   34.5018   31.4812   28.4378   25.3717   22.2825   19.1702   16.0346   12.8754    9.6925    6.4858    3.2550

Balance = 1×12
103 ×

    4.6002    4.1975    3.7917    3.3829    2.9710    2.5560    2.1379    1.7167    1.2923    0.8648    0.4340    0.0000

Payment = 
437.2574

See Also

| | | | | |

Topics