Scénario de test & Cas d'usage
Create a dataset to test boundary conditions: A copula and marginals intended for extreme tail analysis.
| 1 | |
| 2 | DATA casuser.cop_stress; |
| 3 | call streaminit(555); |
| 4 | DO i = 1 to 2000; |
| 5 | u_market = rand('UNIFORM'); |
| 6 | u_credit = rand('UNIFORM'); |
| 7 | OUTPUT; |
| 8 | END; |
| 9 | |
| 10 | RUN; |
| 11 | |
| 12 | DATA casuser.marg_market; |
| 13 | DO i = 1 to 2000; |
| 14 | _DRAWID_=1; |
| 15 | loss = rand('NORMAL', 1000, 200); |
| 16 | OUTPUT; |
| 17 | END; |
| 18 | |
| 19 | RUN; |
| 20 | |
| 21 | DATA casuser.marg_credit; |
| 22 | DO i = 1 to 2000; |
| 23 | _DRAWID_=1; |
| 24 | loss = rand('LOGNORMAL', 6, 0.5); |
| 25 | OUTPUT; |
| 26 | END; |
| 27 | |
| 28 | RUN; |
| 29 |
| 1 | |
| 2 | PROC CAS; |
| 3 | ecm.ecm / copulaSample={name='cop_stress'} marginals={{name='marg_market', sampleVarName='loss', idVarValue='u_market'}, {name='marg_credit', sampleVarName='loss', idVarValue='u_credit'}} tailStart=0.99 shuffleData=FALSE OUTPUT={outSample={name='stress_results', replace=true}} outsum={outSummary={name='stress_stats', replace=true}, percentiles={{percentile=99.5}, {percentile=99.9}}} seed=111; |
| 4 | |
| 5 | RUN; |
| 6 |
The action executes without shuffling data across nodes. The 'stress_results' table focuses heavily on the extreme tail values (>= 99th percentile), and 'stress_stats' provides high-percentile metrics.