ON NUMERICAL STABILITY OF RECURSIVE PRESENT
VALUE COMPUTATION METHOD

arXiv:cs/0611049v2 [cs.CE] 28 Feb 2007

ARGYN KUKETAYEV
Abstract. We analyze numerical stability of a recursive computation scheme
of present value (PV) amd show that the absolute error increases exponentially
for positive discount rates. We show that reversing the direction of calculations
in the recurrence equation yields a robust PV computation routine.

1. Introduction
The concept of time value of money is so important in finance (see chapter 7
in [2]), that it is not surprising that the present value (PV) computations are very
common in finance and accounting. This work focuses on one of the definitions of
PV, which is similar to equation (7-7) in chapter 7 of [2].
Definition 1. Present Value (PV) of future cashflows is defined as follows:
(1.1)

P V (r) =

N
X

Cm
(1
+
r)m
m=1

where Cm is the cashflow amount in month m, N is the month number of last
non-zero cashflow, r is a monthly discount rate, or required rate of return. Cash
outflows are negative, and cash inflows are positive.
Definition 2. Net Present Value (NPV) of cashflows is defined as follows :
(1.2)

N P V (r) = C0 + P V (r)

where an initial cash outflow is C0 , i.e. month zero. Cash outflows are negative,
and cash inflows are positive.
Of course, the most trivial method of calculation of PV is by direct summation
Cm
of discounted cashflows (1+r)
m , i.e. just like in the definition. However, it is easy
to to derive a recurrence equation. First, let us define a present value of the subset
of a given cashflow as follows.
Definition 3. The partial PV of a cashflow is defined by equation:
(1.3)

P Vk =

N
X

m=k+1

Cm
(1 + r)m

Obviously, P V0 is PV of an entire cashflow excluding initial payment, i.e. P V0 ≡
P V (r). From the time value point of view, P Vk is nothing but the present value of
the remaining cashflows at month k (exclusive). Knowing a partial PV in previous
month, it is easy to calculate it for the current month using the recurrence equation:
(1.4)

P Vk = (1 + r) · P Vk−1 − Ck

Date: November 10, 2006.
1991 Mathematics Subject Classification. Primary 65G50, Secondary 65-04 .
Key words and phrases. present value pv recursive recurrent numerical instability.
1

2

ARGYN KUKETAYEV

This formula can easily be derived as follows:
P Vk =

N
X

m=k+1

N
X
Cm
Cm
=
(1
+
r)
− Ck
(1 + r)m
(1 + r)m
m=k

2. Recurrent PV computation use case
We believe that the equation 1.4 is used in practice. Consider the Table 1 in
Appendix B of [1]. The document was published by Financial Accounting Standards
Board (http://www.fasb.org/) and it sets a guideline on amortization of certain fees
and costs associated with loan origination. We refer to chapter 15 and page 688 in
[2] for discussion of amortization, amortization schedule and loan origination fees.
Table 1 is essentially a fragment of the above mentioned table with insignificant
modifications. We used Google Spreadsheet application [3] to create this table by
implementing FAS 91 rules in the worksheet. We show it here in order to make a
point that the recursive PV computation algorithm is actually used in practice and
also to explain why it is needed.
Table 1. Amortization Based on Contractual Payment Term
(1)
Year Cash (Out)
Inflow
-$98,000.00
1
$16,274.54
2
$16,274.54
3
$16,274.54
4
$16,274.54
5
$16,274.54
6
$16,274.54
7
$16,274.54
8
$16,274.54
9
$16,274.54
10
$16,274.54
Total
amortization

(2)
Stated
Interest

(3)
(4)
Amortization Interest
Income

(7)
Carrying
Amount
98,000.00
10,263.52 91,988.98
9,633.99 85,348.43
8,938.53 78,012.42
8,170.23 69,908.11
7,321.46 60,955.04
6,383.81 51,064.31
5,347.96 40,137.72
4,203.62 28,066.80
2,939.43 14,731.69
1,542.85 0.00

10,000.00
9,372.55
8,682.35
7,923.13
7,087.99
6,169.33
5,158.81
4,047.24
2,824.51
1,479.50

263.52
261.44
256.18
247.10
233.48
214.48
189.15
156.38
114.92
63.34
$2,000.00

We have to introduce the concept of the internal rate of return (IRR) (see page
202 in [2]) in order to deconstruct Table 1.
Definition 4. Internal rate of return (IRR) of cashflows is a rate r, which makes
NPV(r) equal to zero and is defined by the following equation:
(2.1)

N P V (irr) =

N
X

Cm
≡0
(1
+
irr)m
m=0

In the Table 1 column (1) contains cashflow amounts for each year. In FAS
91 examples years are used instead of months. It does not change anything in
principle if we assume that years are months, for the time being. In our notation
C0 = −98, 000.00 and N = 10. Next, the IRR is calculated for this cashflow and it
is approximately 10.47%. Now, column (7) (carrying amount) is actually P Vk (irr),
e.g. carrying amount in year 9:
16, 274.54
C10
=
= 14, 731.69
N P V9 (irr) =
1 + irr
1 + 0.1047
The following is an excerpt from the description to Table 1 in [1]:

ON NUMERICAL STABILITY OF RECURSIVE PV COMPUTATION METHOD

3

Computations:
Column (1): Contractual payments
Column (2): Column (5) for prior year × the loan’s stated interest
rate (10%)
Column (3): Column (4) - Column (2)
Column (4): Column (7) for prior year × the effective interest rate
(10.4736%)b
Column (5): Column (5) for prior year - (Column (1) - Column
(2))
Column (6): Initial net fees - amortization to date
Column (7): Column (5) - Column (6)
In this description IRR is referred to as effective interest rate. Also, in our copy
of this table we omitted columns (5) and (6) in order to save the space. We leave
it to the reader to prove that carrying amount is equivalent to PV (definition 1.3),
and that it is computed recursively (equation 1.4) starting from the top of the table.
We shall call this algorithm forward recursive PV computation scheme, as opposed
to backwards scheme, which will be described later. The table itself is often called
amortization schedule.
Why not compute carrying amounts directly using PV formula 1.1? Consider
the following use case. A company may have a huge portfolio of loans, maybe
500,000 loans. Long-term loans, such as mortgages, may have scheduled terms
of 30 years (360 months) or even more. Often more than one fee is amortized.
Direct calculation of NPV for each month in the schedule yields excessive redundant
summation of the same discounted cashflow amounts over and over. Therefore, it
is very desirable to have a recursive PV computation method at hand.
3. Numerical instability of forward recursive PV computation for
positive IRR
Let us analyze absolute error accumulation when using forward PV computation(eq. 1.4). The following equations describe accumulation of rounding errors in
floating-point addition/subtraction and multiplication.
(3.1)

∆a⊕b ≈ ∆a + ∆b

(3.2)

∆a⊗b ≈ ∆a · |b| + ∆b · |a|

These equations are commonly used in analysis of error propagation. Essentially, they are equivalent to the notion of accumulation of absolute errors in summation/subtraction operations, and accumulation of relative errors in multiplication/division operations. One can derive them using partial derivatives as follows
(see 2.11 in [4])
∂
∂
(a · b)| · ∆a + | (a · b)| · ∆b
∂a
∂b
Applying these equations to equation 1.4, we can deduct the following

(3.3)

(3.4)

∆a⊗b ≈ |

∆P Vk ≈ |1 + r| · ∆P Vk−1 + |P Vk−1 | · ∆r + ∆Ck

We shall assume that ∆Ck ≡ 0, i.e. cashflow amounts are precisely accurate.
Also, P V0 ≡ C0 , because we used irr as a discount rate. Therefore, ∆P V0 ≡ 0 and
the following is true
(3.5)

∆P V1 ≈ P V0 · ∆r ≡ |C0 | · ∆r

(3.6)

∆P V2 ≈ |1 + r| · |C0 | · ∆r + |P Vk−1 | · ∆r

4

ARGYN KUKETAYEV

(3.7)

∆P V3 ≈ |1 + r|2 · |C0 | · ∆r + |1 + r| · |P Vk−1 | · ∆r + |P Vk−1 | · ∆r

and so on. It is easy to show by simple mathematical induction that the absolute
error of present value has a term, which increases exponentially with k for positive
rates r:
(3.8)

∆P Vk ≈ |1 + r|k−1 · |C0 | · ∆r

Note that ∆r can not be zero, because it is computed by numerically solving equation 2.1. Therefore, we state that the forward recursive PV computation is numerically unstable for r > 0.
In order to demonstrate our finding, let us compute P Vk for every year in Table 1
using direct summation formula 1.3, then compute the rate of year-on-year increase
of the difference between this value and the carrying amount. The results are shown
in Table 21. If we assume that direct P Vk computation by equation 1.3 is a better
estimate of true present value, then column (9) confirms the correctness of our error
analysis as per equation 3.8.
Table 2. Amortization Error Accumulation Exhibit
(8)
Year P Vk (as in 1.3)
- Column (7)
1 0.000000000509317
2 0.000000000567525
3 0.000000000640284
4 0.000000000698492
5 0.000000000778527
6 0.000000000858563
7 0.000000000945874
8 0.0000000010441
9 0.000000001149601
10 0.000000001269882

(9)
% increase from
previous year
11.43%
12.82%
9.09%
11.46%
10.28%
10.17%
10.38%
10.10%
10.46%

4. Backward recursive PV computation is robust for positive IRR
Let us look at equation 1.4 and its absolute error formula 3.8. There seem to be
two problems.
• Every next present value is being multiplied by factor 1 + r, so the absolute
error of P Vk should increase every month by percentage equal to r for
positive rates.
• P Vk itself is decreasing toward the end of the schedule until it finally reaches
zero.
Combined, these two factors should magnify the relative error of the present at
every step of the calculations.
A heuristic suggests considering to reverse the recurrence equation 1.4
1
(P Vk + Ck )
1+r
We shall call the new recurrence equation a backward recursive computation
method. It seems to address both mentioned issues.
(4.1)

P Vk−1 =

1Note that the discount rate in this sample is 10.47%.

ON NUMERICAL STABILITY OF RECURSIVE PV COMPUTATION METHOD

5

• Its next step is evaluated by division of the previous value by 1 + r, subsequently the absolute error of the present values should not be magnified.
• The sum in the second factor generally increases on every step, i.e. unlike
1.4 it does not add to relative errors of computed values.
Like we did it earlier for forward method, let us conduct a simple error prop1
agation analysis. First, we shall define the absolute error of 1+r
using equation
3.3
1
≈
∆ 1+r

(4.2)

∆r
(1 + r)2

Now, we can estimate the error of the backward recursive computation as follows,
again, assuming ∆Ck ≡ 0
(4.3)

∆P Vk−1 ≈

|P Vk | · ∆r
∆P Vk
+
|1 + r|
(1 + r)2

Note, that P VN ≡ 0 and ∆P VN ≡ 0, because we are using IRR as a discount
rate. Now we can find out absolute errors of first steps of backward computation.
(4.4)

(4.5)

(4.6)

∆P VN −1 ≈

∆P VN −2 ≈

0
0 · ∆r
=0
+
|1 + r| (1 + r)2

0
|P VN −1 | · ∆r
|P VN −1 | · ∆r
=
+
|1 + r|
(1 + r)2
(1 + r)2

∆P VN −3 ≈

|P VN −2 | · ∆r
|P VN −1 | · ∆r
+
|1 + r|3
(1 + r)2

and so on. We can generalize these equations for positive discount rates r using
mathematical induction as follows


|P Vk+2 | · ∆r
|P Vk+1 | · ∆r
+
O
(4.7)
∆P Vk ≈
(1 + r)2
|1 + r|3
As expected, for positive discount rates r, there are no exponentially increasing
terms. The only increasing factor of ∆P Vk is of order P Vk+1 . However, it does not
magnify the relative error, because we know that generally P Vk > P Vk+1 .
N −m+1 |·∆r
. Similar
For negative discount rates r, ∆P VN −k will have terms like |P V|1+r|
k−m
1
to forward computation with positive r, the factor |1+r|k−m increases exponentially
with k. However, as it was stated earlier, P Vk decreases toward the end of an
amortization schedule. Therefore, in backward computation P VN −m+1 in numerator should compensate, at least partially, the shrinking denominator |1 + r|k−m .
In order to test our findings, we produced tables 1 and 2 using backward computation scheme. As expected, we did not observe exponential increase of absolute
errors in recursively computed present values. In order to deal with this instability,
as it is suggested by theoretical error propagation analysis, it is necessary to increase an accuracy of IRR calculation, i.e., in other words, decrease ∆r . However,
the exponential character of absolute error accumulation and the finite precision of
floating-point arithmetics limits the remedial power of this approach.
Conclusion 1. We demonstrated numerical instability of forward recursive present
value computation method. We showed that this method is well known and might be
used in accounting and financial software. We stated that backward recursive present
value computation method is robust, and suggested to consider using it instead of
forward method for positive discount rates.

6

ARGYN KUKETAYEV

References
[1] Summary of Statement No. 91 Accounting for Nonrefundable Fees and Costs Associated with Originating or Acquiring Loans and Initial Direct Costs of Leases, FASB,
http://www.fasb.org/st/summary/stsum91.shtml
[2] F.J.Fabozzi, P.P.Peterson, Financial Management and Analysis, 2nd Ed.,(J. Wiley, 2003).
[3] Google Spreadsheet, http://docs.google.com/
[4] R.W.Hamming, Numerical methods for scientists and engineers(McGraw-Hill Book Company,
1962).
E-mail address, Argyn Kuketayev: jawabean@gwu.edu

