Sub topic 6
Why the iteration converges and how fast
This chapter explains why Excel's iterative calculation settles on an answer for an average-balance interest loop. It also shows how to estimate how many passes that takes and when it would fail to settle. It assumes you can build a debt schedule with a cash flow waterfall and read the formulas IF, MIN, MAX and AVERAGE. It also assumes you have enabled iterative calculation for a loop like the one in the previous chapter.
The loop as a function
Each pass of the iteration takes the current interest figure and produces a new one. Written as a function, the loop from the chapter example is:
- Closing balance = Opening − (CFADS − Interest)
- New interest = Rate × (Opening + Closing) / 2
Substitute the first line into the second:
new_interest = rate/2 * (2*opening - cfads) + (rate/2) * old_interestThis has the form new = a + ρ × old, with two constants:
a = rate/2 × (2 × opening − cfads)ρ = rate/2, the slope of the new interest against the old interest.
For opening 500, CFADS 100 and rate 8%, a = 36 and ρ = 0.04. The iteration is new = 36 + 0.04 × old.
A value that maps to itself is a fixed point. Here that means I = 36 + 0.04 × I, so I = 36 / 0.96 = 37.5. This is the same answer the algebraic solution gives later in the tutorial. The iteration is a way of finding the fixed point by repeated substitution.
Why the error shrinks
Let I* be the fixed point and e_k = I_k − I* the error after pass k. Subtract the fixed-point equation from the iteration:
I_(k+1) − I* = ρ × (I_k − I*)So e_(k+1) = ρ × e_k. Each pass multiplies the error by ρ. If |ρ| < 1, the error shrinks toward zero from any starting value. If |ρ| ≥ 1, it does not shrink.
The intuition is economic. Interest changes the closing balance by exactly the amount of interest, and the interest rate then charges only half a period of interest on that change. A one-unit error in interest therefore becomes a rate/2 error in the next interest figure. With a rate of 8%, that is 0.04 units.
Watching it happen
Starting from zero interest, the first passes give:
| Pass | Interest after pass | Error versus 37.5 | Change from previous pass |
|---|---|---|---|
| 0 (start) | 0.000000 | 37.500000 | |
| 1 | 36.000000 | 1.500000 | 36.000000 |
| 2 | 37.440000 | 0.060000 | 1.440000 |
| 3 | 37.497600 | 0.002400 | 0.057600 |
| 4 | 37.499904 | 0.000096 | 0.002304 |
| 5 | 37.499996 | 0.000004 | 0.000092 |
The error falls by a factor of 25 each time (1/0.04). The change between passes falls by the same factor. That is why the change is a useful stopping signal: it is a scaled copy of the error.
Measuring the rate yourself
The next script runs the same iteration. It prints the interest, the change, and the ratio of consecutive changes. The ratio should equal ρ = rate/2.
def trace_iteration(opening, cfads, rate, tol=1e-9, max_iter=100):
interest = 0.0
prev_change = None
for i in range(1, max_iter + 1):
closing = opening - cfads + interest
new_interest = rate * (opening + closing) / 2
change = abs(new_interest - interest)
ratio = "" if prev_change is None else f"{change / prev_change:.4f}"
print(f"{i:3d} {new_interest:14.9f} {change:12.3e} {ratio}")
if change < tol:
return new_interest, i
prev_change = change
interest = new_interest
raise RuntimeError("did not converge")
interest, passes = trace_iteration(500.0, 100.0, 0.08)
print(round(interest, 6), passes)The ratio column shows 0.0400 on every line after the first. The script stops after 9 passes with interest 37.5. The ratio is constant because the loop is linear. In a larger model it is only approximately constant, and measuring it is a practical way to check how well the model is behaving.
How many passes you need
The first change is |a − 0|, because you start from zero. After that, the change shrinks by ρ per pass. The change on pass k is therefore change_1 × ρ^(k−1). Setting this below a tolerance and solving gives:
passes ≈ 1 + ceil( ln(tol / change_1) / ln(ρ) )For the example, change_1 = 36, ρ = 0.04 and tol = 1e-9. The formula gives ln(2.78e-11) / ln(0.04) = 7.55, which rounds up to 8, so 9 passes in total.
The table below applies the formula to the same schedule (opening 500, CFADS 100) at other interest rates, with a tolerance of 1e-9.
| Rate | ρ = rate/2 | Passes needed |
|---|---|---|
| 8% | 0.04 | 9 |
| 20% | 0.10 | 12 |
| 50% | 0.25 | 20 |
| 100% | 0.50 | 40 |
| 190% | 0.95 | 537 |
| 210% | 1.05 | never converges |
Two points follow from the table. First, at realistic rates the loop settles in about ten passes, far below Excel's default limit of 100. Second, the count grows slowly until ρ gets close to 1. Convergence speed depends on ρ, not on the size of the balances. A debt ten times larger needs about the same number of passes. The scale of the numbers only changes how large the first change is, and that enters the formula through a logarithm.
What changes ρ in a real model
The example has one loop with one interest rate. In a full model, ρ is the total sensitivity of the next interest figure to the current one. The following features move it.
- Period length. If the model is monthly and the rate is annual, the interest on a period is
rate/12 × balance, so ρ israte/24. Shorter periods converge faster. - Tax. If CFADS is after tax and interest is deductible, a higher interest figure reduces tax. The balance then rises by less than the extra interest, so ρ falls to roughly
rate/2 × (1 − tax rate). - Several loops. A revolver, a sweep tranche, interest income on cash and a fee on the average drawn balance can all feed back. Their sensitivities add. Add up each loop's rate and weighting to estimate the combined ρ. For realistic rates the sum stays well below 1.
- Interest on opening balances. There is no feedback, so ρ is 0. The calculation settles in one pass, which is why the opening-balance method has no convergence problem.
What the MIN and MAX limits do
The repayment formula MIN(Debt_Open, MAX(0, CFADS − Interest)) has two limits, and either can bind during the iteration.
- If the MAX binds (CFADS is below interest), repayment is 0 and the closing balance equals the opening balance. Interest becomes
rate × opening. It no longer depends on the old interest, so the slope is 0 and the loop settles in one pass. - If the MIN binds (debt is fully repaid), the closing balance is 0 and interest is
rate × opening / 2. The slope is again 0.
Between these limits the slope is rate/2. The function is piecewise linear, with slope between 0 and ρ everywhere. The error therefore still shrinks by at least a factor ρ per pass, even when the iteration crosses a kink. The convergence argument holds. The closed-form formula from the algebraic chapter does not, because it assumes the unconstrained slope.
Excel's stopping rule and what it hides
Excel has two settings under File → Options → Formulas:
- Maximum Iterations, default 100.
- Maximum Change, default 0.001.
Excel recalculates the circular cells repeatedly and stops when either condition is met: the largest change in any circular cell falls below Maximum Change, or the pass count reaches Maximum Iterations. It gives no warning when it stops on the pass limit, so a model that fails to converge returns the last, wrong value without any signal.
Three habits follow.
- Check the tolerance against your units. Maximum Change is an absolute number. If the model is in thousands, 0.001 means $1. If it is in millions, 0.001 means $1,000. That is probably acceptable for interest but not for a check cell that expects exact zeros.
- Know the leftover error. When the iteration stops with change
c, the remaining error is aboutc × ρ / (1 − ρ). At ρ = 0.04 that is about0.042 × c. Stopping at a change of 0.001 leaves an error near 0.00004. The change itself is therefore a conservative proxy for accuracy. - Expect warm starts. Excel begins from the values already in the cells, not from zero. After a small input change, the first change is small, and fewer passes are needed. A model that has been broken by an error (the next chapters cover this) loses that warm start.
Common mistakes when judging convergence
- Treating convergence as a property of the model size. It depends on ρ, which depends on rates, period length and the weighting of the balance in the interest formula.
- Raising Maximum Iterations to "fix" a problem. If |ρ| < 1 and the loop is healthy, 100 passes is more than enough. If the loop keeps changing at pass 100, the cause is almost always a formula error or an extra feedback path, not a shortage of passes.
- Checking only that the numbers look reasonable. Compare the interest cell against
rate × AVERAGE(open, close)directly. The validation chapter builds this into a check cell. - Assuming the pass limit is a safety net. Excel does not flag it. A check cell that tests the loop's own identity is the only reliable signal.
Exercises
Exercise
A model has opening debt 1,000, CFADS 200 and an annual rate of 10%, with average-balance interest and no tax. Starting from zero interest, what is the interest after pass 1 and after pass 2, and what value does the loop converge to?
Show answer
The map is new = (rate/2) × (2 × opening − cfads) + (rate/2) × old = 0.05 × 1,800 + 0.05 × old = 90 + 0.05 × old. After pass 1 interest is 90. After pass 2 it is 90 + 4.5 = 94.5. The fixed point is 90 / 0.95 = 94.7368 (rounded). The error shrinks by a factor of 0.05 each pass.
Exercise
The same model is converted from annual to monthly periods with the same 10% annual rate, so the periodic rate is 10%/12. Is the loop slower or faster to converge, and what is the new ρ?
Show answer
Faster. For average-balance interest, ρ is the periodic rate divided by 2, which is (0.10 / 12) / 2 = 0.004167. That is far smaller than 0.05, so the error shrinks by about 240 times per pass instead of 20 times, and only a few passes are needed.
Exercise
Excel stops an iteration with a change between passes of 0.001 on a loop with ρ = 0.04. Roughly how far is the interest figure from the true fixed point, and why can you trust the result?
Show answer
The remaining error is about change × ρ / (1 − ρ) = 0.001 × 0.04 / 0.96 ≈ 0.00004. Because each pass shrinks the error by ρ, the next change is already 25 times smaller than the last, so the error left after the final pass is a small fraction of the change that triggered the stop.