Financial Stress Testing: Scenario Analysis and Regulation
Module: Fintech AI | Difficulty: Advanced
Regulatory Framework
- CCAR (US): Capital stress test
- EBA (EU): EU-wide stress test
- ICAAP: Internal capital assessment
Scenario Generation
where .
Macro Factors
| Factor | Stress Impact | |--------|--------------| | GDP | | | Unemployment | | | Interest Rate | | | Housing | |
import numpy as np
class StressTest:
def __init__(self, model, cov_matrix):
self.model = model; self.cov = cov_matrix
def historical_stress(self, historical_shock):
return self.model.predict(historical_shock)
def hypothetical_stress(self, scenario):
return self.model.predict(scenario)
def monte_carlo_stress(self, n_simulations=10000):
shocks = np.random.multivariate_normal(
np.zeros(len(self.cov)), self.cov, n_simulations)
losses = [self.model.predict(shock) for shock in shocks]
return {
'var_99': np.percentile(losses, 1),
'es_99': np.mean([l for l in losses if l <= np.percentile(losses, 1)]),
'max_loss': np.min(losses)
}
Research Insight: Stress testing reveals model weaknesses under extreme scenarios. The 2008 crisis showed that models assuming normal distributions underestimate tail risk. Fat-tailed distributions and regime-switching models provide more realistic stress scenarios.