APEX Forecast — walk-forward backtest
Data: Northwind Design Co. demo books, frozen at 2026-06-30 (apex/test/fixtures) — synthetic demo data, not a real business
Forecast dates: 26 (every Monday, 2025-10-06 to 2026-03-30), each scored over 13 weeks = 338 predictions per model
Versions: model apex-d-1.0.0, inputs apex-pit-1.0.0, harness apex-bt-1.0.0, data fingerprint 372c275de873c19b, code fingerprint f76c0258569a2e06
Reproduce: cd ledgerly && TZ=UTC node apex/test/run-backtest.mjs
Headline
| Model | Average miss (closing cash, weeks 1–13) | Bias (+ = too high) | Predictions |
|---|
| APEX deterministic | $7,259 | $1,648 | 338 |
| Cash stays flat | $9,492 | −$5,392 | 338 |
| Recent trend continues | $9,972 | −$1,237 | 338 |
| Same weeks last year | not enough history | — | 0 |
| APEX ranges, middle (P50) | $5,546 | $214 | 338 |
- Headline forecast (P50, shown on screen since v2): misses 42% less than "cash stays flat" and 24% less than the explained (deterministic) line.
- The explained (deterministic) line misses 24% less than "cash stays flat" (90% bootstrap range 9% to 36%), and 27% less than "recent trend continues".
- APEX has the smaller 13-week average miss on 19 of 26 forecast dates against flat and 15 of 26 against trend.
- "Same weeks last year" was skipped on 26 of 26 dates: it needs a year of history before the forecast date, which these books never have.
By weeks ahead
| Week | APEX | Flat | Trend | APEX vs flat |
|---|
| 1 | $7,213 | $7,560 | $7,867 | 5% better |
| 2 | $7,878 | $7,549 | $7,636 | 4% worse |
| 3 | $7,292 | $8,855 | $9,614 | 18% better |
| 4 | $5,672 | $8,074 | $8,375 | 30% better |
| 5 | $6,742 | $9,226 | $10,773 | 27% better |
| 6 | $5,968 | $8,312 | $8,638 | 28% better |
| 7 | $6,876 | $10,914 | $11,436 | 37% better |
| 8 | $5,764 | $10,577 | $10,246 | 46% better |
| 9 | $6,488 | $11,109 | $11,785 | 42% better |
| 10 | $7,325 | $10,596 | $10,628 | 31% better |
| 11 | $8,249 | $10,375 | $11,480 | 20% better |
| 12 | $8,847 | $9,527 | $10,015 | 7% better |
| 13 | $10,051 | $10,715 | $11,147 | 6% better |
Volatile weeks vs calm weeks
"Volatile" = the quarter of weeks with the biggest actual cash swing (≥ $11,540 in a week).
| Weeks | n | APEX | Flat | Trend |
|---|
| Volatile | 89 | $7,416 | $11,754 | $10,205 |
| Calm | 249 | $7,203 | $8,683 | $9,889 |
Stability
| Forecast dates | APEX | Flat |
|---|
| Before 2026-01-05 | $7,226 | $9,945 |
| From 2026-01-05 | $7,292 | $9,038 |
Low-cash warnings
Threshold: $126,744 — the lowest quarter of actual week-end cash in the test window (no minimum was set in the books).
- APEX: 37 caught · 48 false alarms · 46 missed (caught 45% of real low weeks; 44% of warnings were right)
- Flat: 56 caught · 100 false alarms · 27 missed (caught 67% of real low weeks; 36% of warnings were right)
- Trend: 50 caught · 82 false alarms · 33 missed (caught 60% of real low weeks; 38% of warnings were right)
- APEX ranges, warning when the chance of being below is 20% or more: 75 caught · 155 false alarms · 8 missed (caught 90% of real low weeks; 33% of warnings were right)
- APEX ranges, warning at 50% or more: 46 caught · 43 false alarms · 37 missed (caught 55% of real low weeks; 52% of warnings were right)
Ranges (probabilistic model apex-p-1.0.0, 400 simulations per forecast)
An honest 80% range (P10–P90) should contain actual cash about 80% of the time; an honest 50% range (P25–P75) about 50%.
| Range | Should contain | Actually contained |
|---|
| P10–P90 | 80% | 92% (actual below P10: 4%, above P90: 4%) |
| P25–P75 | 50% | 64% |
Middle (P50) average miss $5,546 (deterministic $7,259). Average pinball loss (P10/P50/P90) $1,858.
| Week | Inside P10–P90 | Average range width |
|---|
| 1 | 65% | $12,836 |
| 2 | 85% | $16,598 |
| 3 | 85% | $18,188 |
| 4 | 88% | $20,245 |
| 5 | 96% | $22,770 |
| 6 | 96% | $25,107 |
| 7 | 96% | $27,655 |
| 8 | 96% | $28,800 |
| 9 | 92% | $29,913 |
| 10 | 100% | $30,274 |
| 11 | 100% | $31,244 |
| 12 | 96% | $31,439 |
| 13 | 96% | $31,995 |
Method
- Walk-forward, no look-ahead: each forecast date sees only records dated on or before it and entered by the end of that day (
pointInTime with knownAt). Tests prove that deleting or changing everything after the date leaves the forecast identical. - Actual cash = ledger balance of the bank accounts at the end of each forecast week.
- Miss = |forecast closing cash − actual|, averaged over all forecast dates and weeks ahead. Bias is the signed average.
- Bootstrap range: forecast dates resampled 2,000 times with a fixed seed. Neighbouring dates share up to 12 of their 13 weeks, so the true uncertainty is wider than this range.
- No what-ifs in any backtest forecast. Ranges come from the probabilistic model with a fixed seed, so they are reproducible too.
Limitations
- Synthetic data. The books were generated by FootingBooks’ own demo code. Real businesses are messier: skipped payments, one-off contracts, seasonality.
- Not a clean out-of-sample test. The model was designed and fixed (tasks 3 and 3b) while looking at these same books. The regular-payment and IRS-date rules match how the demo generates payments. Real pilot books are the honest test.
- Overlapping windows. Forecast dates a week apart share up to 12 of 13 weeks, so the results are less independent than the counts suggest, and the bootstrap range is too narrow.
- Short history. About 15 months of books: no full year before any forecast date, so "same weeks last year" could not run and year-end effects are untested.
- One business. Results say nothing yet about other kinds of business.
- Ledger, not bank. Actual cash is the bank balance in the books, not bank statements.
Per forecast date
| Date | APEX | Flat | Trend |
|---|
| 2025-10-06 | $9,455 | $13,882 | $9,057 |
| 2025-10-13 | $11,052 | $12,711 | $8,470 |
| 2025-10-20 | $6,072 | $15,222 | $15,208 |
| 2025-10-27 | $18,845 | $6,275 | $5,864 |
| 2025-11-03 | $4,458 | $9,571 | $8,620 |
| 2025-11-10 | $6,152 | $15,602 | $18,060 |
| 2025-11-17 | $4,415 | $19,428 | $20,358 |
| 2025-11-24 | $5,608 | $6,119 | $5,280 |
| 2025-12-01 | $5,112 | $4,397 | $4,753 |
| 2025-12-08 | $7,246 | $8,153 | $15,206 |
| 2025-12-15 | $5,226 | $4,980 | $4,235 |
| 2025-12-22 | $4,991 | $7,435 | $15,636 |
| 2025-12-29 | $5,300 | $5,508 | $6,151 |
| 2026-01-05 | $10,882 | $8,345 | $4,930 |
| 2026-01-12 | $5,857 | $6,701 | $7,886 |
| 2026-01-19 | $5,037 | $8,754 | $5,671 |
| 2026-01-26 | $6,044 | $10,867 | $10,462 |
| 2026-02-02 | $6,260 | $6,941 | $7,569 |
| 2026-02-09 | $11,084 | $15,381 | $10,828 |
| 2026-02-16 | $8,051 | $9,072 | $6,832 |
| 2026-02-23 | $6,911 | $9,481 | $7,374 |
| 2026-03-02 | $6,491 | $5,949 | $10,831 |
| 2026-03-09 | $6,393 | $5,581 | $5,858 |
| 2026-03-16 | $8,528 | $6,765 | $6,085 |
| 2026-03-23 | $7,228 | $9,676 | $13,344 |
| 2026-03-30 | $6,030 | $13,986 | $24,709 |