Simulation Engine Overview
The simulator.engine package orchestrates Monte Carlo scenarios on top of the statistical parameter layer:
SimulationRunnerties together stochastic parameters for principal, rate, and term with schedule builders and metric calculators.DeterministicDealSimulatormirrors the runner logic for a single set of deal inputs, producing a reproducible baseline that the runner reuses.schedulesexposes vectorised helpers for amortisation and lease cash flows, plus default truncation utilities.collateralimplements configurable contribution and yield rules for cash-collateral accounts.exposurecombines balances, collateral, liquidation, and revenue offsets to produce net exposure timelines.metricsprovides financial KPIs (NPV, IRR, DSCR) that operate directly on generated schedules.operating_incomeencapsulates reusable income-generation strategies so deterministic and stochastic simulators can attach operating cash flows before computing DSCR.portfolioaggregates multiple deals, supports optional Gaussian-copula risk factors, and reports scenario-level metrics alongside summary statistics.
For a visual depiction of how these components interact, see monte_carlo_flow.md.