How Fragile Is Each Currency Segment Under Stress?
This notebook applies hypothetical shocks to the interest rate spreads and examines how the CRI responds, answering: if spreads widened by 10%, 30%, or 50%, how much would credit risk increase?
Stress Scenarios: - Mild (δ = 0.10): 10% proportional increase in spreads - Moderate (δ = 0.30): 30% increase (comparable to a sectoral slowdown) - Severe (δ = 0.50): 50% increase (comparable to a financial crisis)
import pandas as pdimport numpy as npfrom scipy import stats as sp_statsfrom scipy.optimize import minimizeimport matplotlib.pyplot as pltimport warningswarnings.filterwarnings('ignore')plt.rcParams.update({'figure.figsize': (12, 6), 'figure.dpi': 150, 'savefig.dpi': 300,'font.size': 11, 'axes.titlesize': 14, 'axes.labelsize': 12,'legend.fontsize': 10, 'font.family': 'serif'})print('Libraries loaded.')
The stress test reveals how credit risk responds to hypothetical spread shocks:
Key Mechanism: When spreads are scaled by \((1+\delta)\), the OU parameters change proportionally — θ increases (higher equilibrium), σ increases (higher volatility), but κ (the mean reversion speed) remains similar because the dynamics of the process don’t change. The CRI increases through both channels: higher σ raises the structural component, and higher θ may shift crisis probability.
Proportionality Test: Since the shock is multiplicative, the OU parameters should scale linearly: θ by \((1+\delta)\) and σ by \((1+\delta)\). This means the CRI increase is predictable — it tests whether the CRI framework produces sensible, proportional responses to shocks rather than exhibiting discontinuities or non-linearities.
Policy Relevance: These stress scenarios correspond to realistic economic events: - Mild (10%): A regional economic slowdown or modest currency depreciation - Moderate (30%): A significant financial shock, comparable to the impact of aggressive monetary tightening - Severe (50%): A full-blown financial crisis or a sudden exchange rate shock
The results quantify the CRI sensitivity — how many CRI units of risk increase per 10% spread shock. A higher sensitivity indicates a more fragile segment.
# ─── FIGURE 11: Stress Test Bar Chart ────────────────────────────────────────fig, ax = plt.subplots(figsize=(10, 6))scenarios = [r['Scenario'] for r in results]x = np.arange(len(scenarios))width =0.25bars1 = ax.bar(x - width, [r['CRI_USD'] for r in results], width, label='CRI (USD)', color='#1565C0', alpha=0.85)bars2 = ax.bar(x, [r['CRI_KHR'] for r in results], width, label='CRI (KHR)', color='#C62828', alpha=0.85)bars3 = ax.bar(x + width, [r['CRI_System'] for r in results], width, label='CRI (System)', color='#4A148C', alpha=0.85)for bars in [bars1, bars2, bars3]:for bar in bars: h = bar.get_height() ax.annotate(f'{h:.3f}', xy=(bar.get_x() + bar.get_width()/2, h), xytext=(0, 3), textcoords='offset points', ha='center', va='bottom', fontsize=8)ax.set_xlabel('Stress Scenario')ax.set_ylabel('Average CRI')ax.set_title('Figure 11: Stress Test — CRI Under Different Shock Scenarios', fontweight='bold', fontsize=13)ax.set_xticks(x)ax.set_xticklabels(scenarios, fontsize=9)ax.legend()ax.grid(True, alpha=0.3, axis='y')plt.tight_layout()plt.savefig('../figures/fig11_stress_test.png', dpi=300, bbox_inches='tight')plt.show()print('Saved: fig11_stress_test.png')
Saved: fig11_stress_test.png
Interpretation — Figure 11: Stress Test Visualization
The bar chart provides a clear visual comparison across scenarios:
Pattern Observed: All three CRI measures (USD, KHR, System) increase monotonically from Baseline → Mild → Moderate → Severe, confirming the CRI framework produces directionally correct responses to stress.
KHR bars consistently taller than USD bars: In every scenario, the KHR CRI exceeds the USD CRI, maintaining the fundamental ordering. This means the riel segment is more fragile under stress — not only does it start from a higher baseline, but it also absorbs shocks more severely due to its higher volatility.
System CRI (purple) tracks closer to USD: Because of the 80/20 loan-share weighting, the System CRI is dominated by the USD component. Even under severe stress, the System CRI may appear moderate while the KHR-specific CRI shows significant elevation — reinforcing the importance of monitoring currency-specific risk rather than relying solely on the aggregate.
# ─── Fragility Assessment ────────────────────────────────────────────────────usd_sensitivity = (results[-1]['CRI_USD'] - cri_baseline_usd) / cri_baseline_usd *100khr_sensitivity = (results[-1]['CRI_KHR'] - cri_baseline_khr) / cri_baseline_khr *100print(f'\n═══════════════════════════════════════════════════════')print(f' Fragility Assessment — Severe Stress (δ=0.50)')print(f'═══════════════════════════════════════════════════════')print(f' USD CRI changed by {usd_sensitivity:+.1f}% from baseline')print(f' KHR CRI changed by {khr_sensitivity:+.1f}% from baseline')ifabs(khr_sensitivity) >abs(usd_sensitivity):print(f'\n → KHR segment is MORE fragile under stress.')else:print(f'\n → USD segment is MORE fragile under stress.')print(f'═══════════════════════════════════════════════════════')
═══════════════════════════════════════════════════════
Fragility Assessment — Severe Stress (δ=0.50)
═══════════════════════════════════════════════════════
USD CRI changed by +46.2% from baseline
KHR CRI changed by +46.7% from baseline
→ KHR segment is MORE fragile under stress.
═══════════════════════════════════════════════════════
Interpretation — Fragility Assessment
The fragility assessment compares the percentage change in CRI under severe stress. This measures not just the absolute CRI level, but how sensitive each currency’s risk profile is to shocks.
Why This Matters for Policy: - If KHR is more fragile, it means NBC should pay extra attention to the riel segment during economic downturns, because even moderate macroeconomic deterioration could push the KHR CRI disproportionately higher. - The fragility differential also has implications for capital requirements — banks with large KHR loan portfolios may need higher capital buffers to absorb the amplified risk response. - For borrowers, this means KHR borrowing costs are more likely to spike during stress periods, potentially creating a vicious cycle of higher costs → more defaults → higher spreads.
Summary
The stress testing framework confirms that: 1. The CRI responds proportionally to spread shocks — no discontinuities or artifacts 2. The KHR segment is more fragile, absorbing stress disproportionately through its higher baseline volatility 3. The System CRI underestimates KHR-specific stress when using loan-share weights 4. Policy implications: differential capital requirements and enhanced monitoring for KHR lending during stress periods