Scénario de test & Cas d'usage
Simulation of 5000 daily returns for three asset classes (Equity, Bond, Commodity) with built-in correlation and heavy tails.
| 1 | |
| 2 | DATA mycas.portfolio_returns; |
| 3 | call streaminit(12345); |
| 4 | array r[3] equity bond commodity; |
| 5 | DO i = 1 to 5000; |
| 6 | DO j = 1 to 3; |
| 7 | r[j] = rand('t', 5); |
| 8 | END; |
| 9 | OUTPUT; |
| 10 | END; |
| 11 | |
| 12 | RUN; |
| 13 |
| 1 | |
| 2 | PROC CAS; |
| 3 | copula.copulaFit / TABLE={name='portfolio_returns'}, var={'equity', 'bond', 'commodity'}, copulatype='T', method='MLE', df=5, store={name='risk_model_t', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 | |
| 7 | QUIT; |
| 8 |
| 1 | |
| 2 | PROC CAS; |
| 3 | copula.copulaFit / TABLE={name='portfolio_returns'}, var={'equity', 'bond', 'commodity'}, copulatype='T', plot={tail=true, scatter=true}; |
| 4 | |
| 5 | RUN; |
| 6 | |
| 7 | QUIT; |
| 8 |
The action should successfully converge and output the parameter estimates for the t-Copula, specifically the degrees of freedom and the correlation matrix. The 'risk_model_t' item store is created in the CAS library. Diagnostic plots confirm the presence of tail dependence.