Hello:
Sorry for the late follow-up but I was on vacation, but I think the
following might help someone.
The solution for a rate is a root finding problem. As a result the
problem can be difficult or impossible to solve if certain values
occur. Therefore the root finding techniques sometimes fail, or go on
forever. Here is the way to explain the problem.
Assume a two period problem then the present value of the flows equal:
PV = PMT/(1+r)^1 + PMT/(1+r)^2
This can be solved for r by re-arranging the terms:
PV - PMT/(1+r)^1 + PMT/(1+r)^2 = 0
rewriting and changing symbols and allowing for the possibility that
the PMT's are not the same (a = PV; b = PMT period 1; c = PMT period
2):
PV - PMT/(1+r)^1 + PMT/(1+r)^2 = a - b/(1+r)^1 + c/(1+r)^2
This would also work if b = c .
Then multiplying through by (1+r)^2:
a(1+r)^2 + b(1+r) + c = 0
now let (1+r) = x
ax^2 + bx + c = 0
This is quadratic formula which can be solved for x by the quadratic
formula:
x = (- b +/- sqrt(b^2 - 4ac))/2a
provided that (4ac) < (b^2), otherwise we cannot find an answer in the
real number domain. Also it is possible that more than one answer can
exist because of the (+/-) factor.
Now Descartes Rule of Signs tells us that there will one real root if
the sign change on the coefficients is one, if more than one we could
get a variety of roots ranging from the number of sign changes down to
zero. (e.g. -++, - - +, or ++- is one sign change; -+-, or +-+ is two
sign changes)So the "standard cash flows" are an outflow, followed by
inflows or an inflow followed by outflows. This would mean one sign
change and therefore one real root.
Suppose we have the following cash flows:
Per 1 -4
Per 2 +1
Per 3 +3
You can see by inspection that the rate of return is 0%, but it turns
out that there is another answer that mathematically cannot be
rejected, it is -175%. The solution using the quadratic formula:
-4 + 1/(1+r) + 3/(1+r)^2 = 0
Multiply through by (1+r)^2
-4*(1+r)^2 + 1*(1+r) + 3 = 0
Let x = (1+r)
-4*x^2 + 1x + 3 = 0
Solving using the quadratic:
{-1 +/- sqrt(1^2 - 4*-4*3)}/(2*-4)
gives us x = 1 and x = -.75
Or an r of 0% and an r of -175%
Now if you expand the number of periods you run into a problem. There
is a cubic formula for solving a 3 period problem and if you have a 4
period problem you know that is two quadratics and you could solve if
you can factor it into the two quadratics. Now expand to 5 periods and
you know that is a quadratic and a cubic, can you factor it? (If I
recall correctly someone a long time ago proved that there could not be
a general formula for a 5th degree equation.) And it just keeps going.
So mathematicians quickly determined that the best way to solve these
types of problems is to use numerical analysis, which is a way to guess
at the answer. Of course they quickly developed very good method of
making this guessing process very efficient. Newton-Rhapson or
bisection both give very quick answers if the problem is well behaved,
as it would be if you had constant payments as in a loan, which insures
that either the cash flows are - + + + + + + or from the borrowers
standpoint + - - - - - - - either one generally results in a quick
answer. Interestingly while something like Newton-Rhapson might do it
in fewer guesses than bisection but that does not mean that it is
faster. A long time ago on a mainframe I worked with both solution
algorithms and found that in terms of CPU time bisection was faster,
even though it took many more guesses.
But given the general problem of finding roots Descartes rules of signs
tells us it is possible that no solution exists, or that many solutions
exist. Both of these possibilities have to be addressed in a root
finding technique, which is what Excel's "rate" and "irr" are. (I
suspect that it uses the same root finder for both functions. In
general you don't want the root finder to hang. Change the cash flows
a little and you can see what happens.
With the following the rate is 0% and 25%, which is the correct one?
Per 1 -4
Per 2 +9
Per 3 -5
With the following there is no rate in the real number domain. The
function never crosses the abscissa, which is you might say the
definition of the root of an equation. This will drive a badly written
root finder into a loop.
Per 1 +4
Per 2 -9
Per 3 +5.5
So it is necessary to handle these situations. On the above problems
Excel returns #NUM for the latter and for the former the answer you get
depends on the guess rate you give it. Here are some results and the
guess rate:
Guess IRR or Rate
0% 0%
10% 0%
11% 0%
12% 25%
13% 25%
15% 25%
100% 25%
150% 0%
As you can see the guess rate does not always produce the result you
would think.
Finally it is very unlikely that the root(s) of the equation will turn
out to be even numbers. Therefore the routine to find the root could
run a very long time as it tries to drive the result to exactly zero.
Therefore there is usually a test to see if the answer is close enough
to some defined error allowance or it simply stops after some number of
estimates. Excel appears to use both techniques.
mich wrote:
Pieter Vandenberg