Scénario de test & Cas d'usage
Simulation of historical delay data for 3 hubs and a correlation matrix for the T-Copula.
| 1 | DATA historical_delays; |
| 2 | DO i=1 to 2000; |
| 3 | Hub1 = rannor(1) + 10; |
| 4 | Hub2 = rannor(1) + 12; |
| 5 | Hub3 = rannor(1) + 8; |
| 6 | OUTPUT; |
| 7 | END; |
| 8 | RUN; |
| 9 | |
| 10 | DATA t_corr; |
| 11 | _name_='Hub1'; _type_='CORR'; Hub1=1.0; Hub2=0.7; Hub3=0.2; OUTPUT; |
| 12 | _name_='Hub2'; _type_='CORR'; Hub1=0.7; Hub2=1.0; Hub3=0.3; OUTPUT; |
| 13 | _name_='Hub3'; _type_='CORR'; Hub1=0.2; Hub2=0.3; Hub3=1.0; OUTPUT; |
| 14 | RUN; |
| 15 | |
| 16 | PROC CASUTIL; |
| 17 | load DATA=historical_delays casout='historical_delays' replace; |
| 18 | load DATA=t_corr casout='t_corr' replace; |
| 19 | QUIT; |
| 1 | PROC CAS; |
| 2 | copula.copulaSimulate / |
| 3 | TABLE={name='historical_delays'}, |
| 4 | define={copulaType='T', df=4, corrTable={name='t_corr'}}, |
| 5 | ndraws=1000000, |
| 6 | seed=998877, |
| 7 | var={'Hub1', 'Hub2', 'Hub3'}, |
| 8 | outempirical={name='stress_test_data', replace=true}, |
| 9 | margApproxOpts={algorithm='BIN', interpolation='LINEAR'}; |
| 10 | RUN; |
| 11 | QUIT; |
A large CAS table 'stress_test_data' (1,000,000 rows) is created. It contains values transformed back to the scale of 'historical_delays' (empirical marginals) but with the dependency structure of a T-Copula (heavier tails) defined by 't_corr'.