# Alternative scenario laws for specialized finance

`examples/specialized_alternate_scenarios.py:run(data=None, verify_reference=True, artifact_paths=None, return_audit_artifacts=False, scenario_methods=None)` applies seven scenario constructions to five existing contractual cases: income-producing real estate, merchant project finance, single aircraft, spot-exposed ship finance and single equipment lease. Native `run_specialized_alternate_scenarios` adds optional `ledger_engine_path`. `artifact_paths` maps model resource names to frozen files. `scenario_methods` selects distinct names from `vecm`, `regime`, `factor`, `conditional`, `reverse`, `bootstrap`, `copula`; default runs all seven. All four local statistical fits and analytical checks still execute when selecting fewer financial scenarios.

The explicit synthetic training histories are held separate from the transaction scenarios. Actual Johansen VECM fits recover the declared near-[1,−1] cointegrating relation. Actual hidden-state EM identifies two distinct regimes around−2/+2. A genuinely fitted Kalman dynamic factor integrates one missing observation and improves log likelihood by more than10 over its declared initialization. Gaussian-copula estimation uses eight explicit rank pairs: three discordances among28 give Kendall tau11/14, hence Gaussian correlation `sin(pi*11/28)`. The transformed shared uniforms have an independent Cholesky oracle. The local fits are returned unmodified in optional audits; Python and R optimizer parameters/hashes are not claimed identical.

Economic replay loads immutable fitted model files. Both Python-origin and native-origin models are packaged; all eight artifacts were replayed in both languages with their original seals independently revalidated. Default replay uses the same Python-origin artifacts in both languages. This separates independent estimation diagnostics from portable fitted-model inference. VECM price effects are changes from the final observed common level. The dynamic-factor stress explicitly fixes the initial latent state at its filtered mean: posterior initial uncertainty is not integrated, and no TTC interpretation is made. Future state innovations remain explicit. Original18 weighted Gaussian-quadrature/counterparty nodes define the finite conditional sensitivity ensemble; its default mass is not an empirical default frequency or an IID Monte Carlo confidence statement. Hidden-regime draws are deliberately coupled to the declared joint scenarios, not claimed independent of counterparty states.

Joint moving blocks select aligned two-variable residual rows, with independent index and row-preservation checks. Gaussian conditioning fixes the second-year common market factor at−1 and adjusts the first-year factor by the covariance gain; it does not merely overwrite one coordinate. Reverse stress genuinely solves the minimum shock-distance problem for a30% second-year common collateral price markdown. Its optimizer result is retained and checked against the independent analytic boundary `market_2=log(.7)/.2`. Economic replay uses that analytic minimizer after verification; the full transaction loss need not equal the price markdown. The finite conditional stress laws are carried into the transaction cube with the complete chosen source sampling contract. This is separate from the original specialized example's explicitly justified stationary TTC initialization.

Each macro path becomes relative revenue/asset indices under the same declared12-decimal financial-binding convention as the original contract examples; raw macro paths remain in audits. Actual transaction simulation then performs operating cash flow, counterparty interruption, debt service, reserve use, default detection, collateral aging and discounted recovery. Seven laws × five contracts ×18scenarios produce630 independent ledger/event/loss checks. Result reports retain each transaction seal and weighted risk result. Optional audits additionally expose full execution ledgers, raw local fits, macro paths and reverse solver diagnostics. Complete report parity covers1,166numeric fields and all cube/transaction seals without exceptions; eight-model foreign replay has separate96field evidence.

Default tests run every actual local fit and analytical scenario check, then one contract under the conditional law, verifying stored cube/transaction seals and a changed-loss rejection. Set `CREDITRATINGSYSTEM_EXTENDED_TESTS=true` for all seven laws and five contracts. The full native example takes approximately26seconds on the reference environment; this exhaustive financial traversal is not part of default CRAN/GitHub tests.
