Sub topic 6
Why the Iteration Converges and How Fast
Assume you can build a basic debt schedule and understand cash flow available for debt service (CFADS), interest, repayment, and closing debt. This chapter focuses on what happens after you enable iterative calculation for average-balance interest.
The iteration in a debt schedule
Suppose the schedule uses these relationships:
- Interest equals the interest rate multiplied by the average of opening and closing debt.
- Repayment equals CFADS minus interest.
- Closing debt equals opening debt minus repayment.
For an opening debt balance of 500, CFADS of 100, and an interest rate of 8%, the spreadsheet cannot calculate the answer in one ordinary pass. Interest depends on closing debt, while closing debt depends on repayment, and repayment depends on interest.
An iterative calculation repeats the formulas. Each pass uses the result from the previous pass.
def solve_interest_iteratively(opening, cfads, rate, tol=1e-9, max_iter=100):
interest = 0.0
for iteration in range(1, max_iter + 1):
repayment = max(0.0, cfads - interest)
closing = opening - repayment
new_interest = rate * (opening + closing) / 2
change = abs(new_interest - interest)
if change < tol:
return new_interest, closing, iteration
interest = new_interest
raise RuntimeError("did not converge")
interest, closing, iterations = solve_interest_iteratively(
opening=500.0,
cfads=100.0,
rate=0.08,
)
print(round(interest, 4))
print(round(closing, 4))
print(iterations)The result is interest of 37.5 and closing debt of 437.5. The first estimate of interest is zero. That estimate produces a repayment of 100 and closing debt of 400. The next interest estimate is 36. The process then makes smaller adjustments until the change is below the tolerance.
Why the changes get smaller
For the simple case without repayment limits, an increase in interest reduces repayment by the same amount. That increases closing debt, which increases average-balance interest.
The feedback is controlled by the rate. If the rate is 8%, a change in interest changes the next interest estimate by about 4% of the original change. The factor is approximately:
\[ \frac{\text{interest rate}}{2} \]
The division by two occurs because closing debt is averaged with opening debt. When the factor is below 1, each adjustment is smaller than the previous adjustment. This is convergence.
| Interest rate | Approximate adjustment factor | Expected behavior |
|---|---|---|
| 8% | 4% | Fast convergence |
| 50% | 25% | Slower convergence |
| 200% | 100% | No reduction in adjustment size |
In a real model, repayment floors, debt caps, minimum cash, taxes, and multiple debt tranches can change this simple behavior. The rate alone is therefore a useful guide, not a complete proof.
Measuring convergence
A spreadsheet should use a tolerance, which is the largest acceptable change between iterations. A typical check is:
=ABS(Interest_New-Interest_Old)<0.01The appropriate tolerance depends on the model's scale and reporting precision. A tolerance of 0.01 may be suitable when values are reported to the nearest whole unit. A tighter tolerance may be needed for a valuation model or a model with many downstream calculations.
Track at least these values:
- The iteration number.
- The current interest.
- The new interest.
- The absolute change.
- Whether the change is below the tolerance.
Set a maximum iteration count as a safety limit. If the model reaches that limit, report a warning instead of silently using an unfinished result.
> callout warning > A small change does not always mean the model is correct. A formula can settle at an incorrect result because a repayment limit, sign convention, or circular reference was implemented incorrectly. Check the debt roll-forward separately.
Common convergence errors
A circular model may fail to converge when:
- The feedback factor is near or above 1.
- A conditional formula switches between two states on alternating passes.
- A minimum cash rule causes repayment to jump up and down.
- Different debt tranches repay in an unstable order.
- An error value, such as
#VALUE!, enters one formula and remains in the loop.
A result that alternates between two values is oscillating rather than converging. Increasing the iteration limit will not fix that problem. Inspect the formulas that change state and test the schedule with the circular switch turned off.
Exercise
With an 8% interest rate, why does average-balance interest usually converge quickly in the simple cash-sweep example?
Show answer
The approximate feedback factor is the rate divided by two, or 4%. Each interest adjustment therefore produces a much smaller next adjustment.