Calculation catalog › Monte Carlo
Monte carlo lasting and depleted path counts
Two path counts the Monte Carlo page works out from the engine's summary: how many simulated paths lasted to the end of the plan ("Why this number?") and how many ran out of money (the first-depletion chart's accessible label).
Field: Lasting and depleted path counts worked out on the Monte Carlo page Unit: count Basis: no dollar basis Computed by: UI transformation Status: Complete chain
Appears in: monte-carlo-page (WhySuccessPanel "What it counts": "lasted to the end of the plan in N of the M simulated markets"); monte-carlo-page ("When depleting plans run out" chart aria-label "Histogram of first-depletion years for the N paths that ran out of money.")
Calculation records
-
Lasting and depleted path counts Formula record, justified by derivation
Purpose: How many simulated markets carried the plan to its end and how many ran out of money, as the Monte Carlo page prints them.
Statement: montecarlo/run.ts#aggregateMonteCarlo publishes MonteCarloSummary.lastingPathCount, the number of paths whose investable assets never run out (depletionYear null), counted in the same pass that counts downsideRisk.failingPathCount, the paths that do run out. Every path is one or the other, so the two add up to pathCount, successRate is lastingPathCount divided by pathCount, and the failing count equals the sum of depletionYearCounts. The explanation panel prints the lasting count ("lasted to the end of the plan in N of the M simulated markets") and the first-depletion chart's label prints the failing count. Five failing and five lasting paths give 5 and 5; 150 failing among 1,000 give 850 and 150; a path that falls short of its required spending floor without running out still lasted. Units: counts of paths. Rounding: none.
Formula:
lasting = #{paths with no depletion year}; depleted = #{paths with a depletion year} = Σ count(year); lasting + depleted = pathCount-
depletion year: The first year a path's investable assets run out, or none (unit: calendar year) (domain: a year of the plan, or none) -
pathCount: Number of simulated paths (unit: count) (domain: integer, at least 0)
Timing: once per aggregation
Rounding: none
Limits:
- Lasting means the investable assets never ran out; a path can last and still fall short of its required or target spending, which the layered success rates count.
Provenance: derived by
claude, implemented byclaude.Independent review:
codexGates (6 of 6 pass): fixture registers a test: pass; pins resolve: pass; families exist: pass; worksheet exists: pass; mutation receipt exists: pass; provenance independent: pass
Worksheet: monte-carlo-lasting-and-depleted-path-counts.md Mutation receipt: monte-carlo-lasting-and-depleted-path-counts.mutation.md
Evidence tests: run.lastingPaths.evidence.test.ts
Implemented in: run.ts
Is the number of: monte-carlo-lasting-and-depleted-path-counts
-
Transformations
- Lasting paths: montecarlo/run.ts#aggregateMonteCarlo publishes MonteCarloSummary.lastingPathCount, the paths whose depletionYear is null, which explainPanels.tsx#WhySuccessPanel prints.
- Depleted paths: downsideRisk.failingPathCount, counted in the same pass and equal to Σ depletionYearCounts[].count, which the depletion chart's aria-label prints (MonteCarloPage.tsx#MonteCarloPage); lastingPathCount + failingPathCount = pathCount.
The evidence links on this page (each record's worksheet, mutation receipt, evidence tests
and implementation, and the source links) are pinned to engine commit
2624dbdba9fd, committed 2026-10-11.
The live calculation index and
output-family census links point at the repository's main
branch, so you can check this snapshot against them.