SYSTEM_STATUS: ONLINE | CREDIT_RISK_ENGINE v1.0
// ANALYSIS_TERMINAL
CREDIT RISK
> CREDIT_RISK_ENGINE initializing... OK
> Merton solver loaded (scipy.optimize.fsolve)... OK
> Vasicek Monte Carlo engine ready... OK
> GitHub CSV data layer (500 tickers)... OK
> Select a preset or add tickers, then RUN ANALYSIS.
// HOW TO READ THESE RESULTS
▼
Expected Loss (EL) — The average dollar amount you expect to lose annually across all Monte Carlo scenarios. Think of this as the "insurance premium" the portfolio needs to price in. A low EL means the portfolio is predominantly investment-grade.
Unexpected Loss (UL) — The standard deviation of the loss distribution. Higher UL means losses are more unpredictable — this is what banks hold capital against, not EL.
Credit VaR — At 99% confidence: in the worst 1% of economic scenarios, losses will exceed EL by this amount. Basel II uses 99.9% for regulatory capital. Higher ρ (correlation) always increases Credit VaR.
Expected Shortfall (ES) — The average loss in the tail beyond VaR. ES is a coherent risk measure (unlike VaR) and is used in Basel III/FRTB for market risk.
Distance to Default (DD) — How many standard deviations the firm's assets are from the default point. DD > 3 = Safe, DD 1–3 = Watch, DD < 1 = Distressed. AAPL/MSFT typically show DD > 14.
Why do IG portfolios show $0.00? — This is mathematically correct. Apple's implied PD from the Merton model is ~10⁻⁵⁸ (essentially zero). EL = PD × LGD × Notional ≈ $0. To see meaningful numbers, use the HY or MIXED presets, or increase the PD multiplier in the stress test.
//
RUN ANALYSIS TO SEE COMPANY RISK PROFILES
// HOW TO READ THE LOSS DISTRIBUTION
▼
Green bars — Normal loss scenarios. Most of the time (99% of scenarios at 99% CI), losses will land in this region. The peak near zero is typical for well-rated portfolios.
Red bars — Tail losses beyond the Credit VaR threshold. These are the extreme scenarios where the economy deteriorates severely and multiple companies default simultaneously.
Fat tail vs thin tail — Increase the correlation ρ slider and re-run. You will see the distribution spread rightward and the red tail get fatter. This is the Vasicek model demonstrating systematic risk: when ρ is high, defaults cluster together in bad scenarios.
2008 analogy — Before the crisis, banks used ρ ≈ 0.10–0.20. In reality, ρ spiked to 0.60–0.80 as all names defaulted together. Set ρ = 0.70 and observe how the distribution transforms.
//
RUN ANALYSIS TO SEE LOSS DISTRIBUTION
// HOW TO READ CDO TRANCHE PRICING
▼
Equity tranche (0%–3%) — First-loss position. Absorbs every dollar of loss up to 3% of total notional. Highest yield, highest risk. In a typical investment-grade portfolio, the equity tranche absorbs nearly all the expected loss.
Mezzanine tranche (3%–7%) — Only starts taking losses after the equity tranche is wiped out. Rated BBB/BB typically. The mezzanine tranche was the "hidden bomb" in 2008 CDOs — rated A or AA but exposed to catastrophic losses when ρ spiked.
Senior tranche (7%–100%) — Only takes losses if more than 7% of the entire portfolio defaults. Rated AAA. Under normal ρ (0.10–0.20), this tranche has near-zero expected loss. Under crisis ρ (0.60+), it becomes exposed.
The 2008 lesson — Rating agencies modeled AAA tranches using ρ ≈ 0.30. Realized ρ was 0.80+. The Gaussian copula assigned near-zero probability to scenarios where AAA tranches suffered losses. Those scenarios materialized. This tool lets you see exactly why.
How to use — Run with ρ = 0.20 (normal), note the senior tranche EL. Then run stress test with ρ = 0.60. The senior tranche expected loss will jump dramatically, illustrating why correlation assumptions in CDO pricing are critical.
//
RUN ANALYSIS TO SEE CDO TRANCHE PRICING
// HOW TO READ THE STRESS TEST
▼
What the stress test does — Runs the exact same Monte Carlo simulation twice: once with your base parameters, once with shocked parameters. The comparison shows how sensitive your portfolio is to correlation and PD deterioration.
Correlation shock (ρ) — Raising ρ from 0.20 to 0.50 represents moving from normal market conditions to a mild recession. Raising to 0.70+ represents a 2008-style systemic crisis where all firms' fortunes are highly correlated with the macroeconomy.
PD multiplier — Multiplies every company's implied Probability of Default by the chosen factor. A 2× multiplier means each firm is twice as likely to default — representing a recession scenario. A 4× multiplier is a severe stress.
Basel III connection — Regulators require banks to run stress tests with similar shocks. The results determine how much additional capital a bank must hold above the base Credit VaR. A stressed CVaR 200% above base would typically trigger regulatory capital add-ons.
Recommended scenario — Run with ρ = 0.20 base, ρ = 0.60 stressed, PD multiplier = 3×. This approximates the 2008 financial crisis scenario and shows how dramatically expected losses can shift in systemic stress events.
//
RUN STRESS TEST TO SEE BASE VS STRESSED COMPARISON
// ρ SENSITIVITY — CVaR vs CORRELATION (0.0 → 0.9)
Shows how Credit VaR rises as systematic correlation ρ increases. The steep rise at high ρ is the 2008 mechanism — correlated defaults amplify tail losses exponentially. Use HY or DISTRESSED preset for best results. Tip: use DISTRESSED preset for the most dramatic curve.
// KEY INSIGHT
Low ρ (0.0–0.2) — Idiosyncratic risk dominates. Diversification works. CVaR grows slowly.
Medium ρ (0.3–0.5) — Systematic risk emerges. Diversification benefit shrinks rapidly.
High ρ (0.6–0.9) — Defaults cluster simultaneously. Rating agencies used ρ≈0.30; realized 2008 ρ was 0.80+.