Scénario de test & Cas d'usage
Simulate a Copula table representing the correlation between Fraud and IT risks, and generate two marginal loss distribution tables (Log-Normal for Fraud, Weibull for IT).
| 1 | |
| 2 | DATA casuser.cop_risk; |
| 3 | call streaminit(101); |
| 4 | DO i = 1 to 5000; |
| 5 | u_fraud = rand('UNIFORM'); |
| 6 | u_it = rand('UNIFORM'); |
| 7 | OUTPUT; |
| 8 | END; |
| 9 | |
| 10 | RUN; |
| 11 | |
| 12 | DATA casuser.marg_fraud; |
| 13 | call streaminit(102); |
| 14 | DO i = 1 to 5000; |
| 15 | _DRAWID_=1; |
| 16 | _LOSS_ = rand('LOGNORMAL', 9, 2); |
| 17 | OUTPUT; |
| 18 | END; |
| 19 | |
| 20 | RUN; |
| 21 | |
| 22 | DATA casuser.marg_it; |
| 23 | call streaminit(103); |
| 24 | DO i = 1 to 5000; |
| 25 | _DRAWID_=1; |
| 26 | _LOSS_ = rand('WEIBULL', 1.2, 5000); |
| 27 | OUTPUT; |
| 28 | END; |
| 29 | |
| 30 | RUN; |
| 31 |
| 1 | |
| 2 | PROC CAS; |
| 3 | ecm.ecm / copulaSample={name='cop_risk'} marginals={{name='marg_fraud', sampleVarName='_LOSS_', idVarValue='u_fraud'}, {name='marg_it', sampleVarName='_LOSS_', idVarValue='u_it'}} analysisVariables={'u_fraud', 'u_it'} outsum={outSummary={name='risk_metrics', replace=true}, tVaRLevels={{percentileLevel=99.5}}, percentiles={{percentile=50}, {percentile=99.5}}, summaryStatistics={{statistic='MEAN'}, {statistic='STDDEV'}}} OUTPUT={outSample={name='agg_loss_sample', replace=true}, varName='Total_Op_Risk'} seed=12345; |
| 4 | |
| 5 | RUN; |
| 6 |
The action successfully generates 'agg_loss_sample' with total losses and 'risk_metrics' containing the TVaR at 99.5%, Mean, and StdDev, accurately reflecting the combined risk profile.