CCOPULA Procedure
Example 8.1 Simulating Default Times
Suppose that the correlations structure that is required for a normal copula function is already given. For example, it can be estimated from the historic data on default times in some set of industries, but this stage is not within the scope of this example. The correlations structure is saved in a SAS data set called inparm. The following statements and their output in Output 8.1.1 show that the correlation parameter for Y1 and Y2 is set at 0.8:
proc print data = inparm;
run;
Output 8.1.1: Pearson Correlations Matrix
| Obs | Y1 | Y2 |
|---|---|---|
| 1 | 1.0 | 0.8 |
| 2 | 0.8 | 1.0 |
Then you use PROC CCOPULA as follows to simulate the data. The VAR statement specifies the list of variables to contain simulated data. The DEFINE statement assigns the name COP and specifies a normal copula that reads the correlations matrix from the inparm data table.
The SIMULATE statement refers to the COP label that is defined in the VAR statement and specifies some options: the NDRAWS= option specifies a sample size, the SEED= option specifies 1234 as the random number generator seed, and the OUTUNIFORM=NORMAL_UNIFDATA option names the output data table for the result of simulation in uniforms.
/* simulate the data from bivariate normal copula */
proc ccopula ;
var Y1-Y2;
define cop normal (corr=mylib.inparm);
simulate cop /
ndraws = 1000000
seed = 1234
outuniform = mylib.normal_unifdata;
run;
The following DATA step transforms the variables from zero-one uniformly distributed to nonnegative exponentially distributed with parameter 0.5. Three indicator variables are added to the data table. SURVIVE1 and SURVIVE2 have a value of 1 if a respective company has remained in business for more than three years. DEFAULT has a value of 1 if neither company survived for more than three years.
/* default time has exponential marginal distribution with parameter 0.5 */
data default;
set mylib.normal_unifdata;
array arr{2} Y1-Y2;
array time{2} time1-time2;
array surv{2} survive1-survive2;
lambda = 0.5;
do i=1 to 2;
time[i] = -log(1-arr[i])/lambda;
surv[i] = 0;
if (time[i] >3) then surv[i]=1;
end;
default = 0;
if (time1 <=3) && (time2 <=3) then default = 1;
run;
The first analysis step is to look at correlations between survival times of two companies. This step is performed by using the following CORR procedure statements:
proc corr data = default pearson kendall;
var time1 time2;
run;
The output is shown in Output 8.1.2.
Output 8.1.2: Default Time Descriptive Statistics and Correlations
| 2 Variables: | time1 time2 |
|---|
| Simple Statistics | ||||||
|---|---|---|---|---|---|---|
| Variable | N | Mean | Std Dev | Median | Minimum | Maximum |
| time1 | 1000000 | 2.00023 | 1.99883 | 1.38633 | 3.85293E-6 | 24.18938 |
| time2 | 1000000 | 1.99897 | 1.99965 | 1.38476 | 6.43006E-6 | 25.85567 |
| Pearson Correlation Coefficients, N = 1000000 Prob > |r| under H0: Rho=0 | ||||||
|---|---|---|---|---|---|---|
| time1 | time2 | |||||
| time1 |
|
| ||||
| time2 |
|
| ||||
| Kendall Tau b Correlation Coefficients, N = 1000000 Prob > |tau| under H0: Tau=0 | ||||||
|---|---|---|---|---|---|---|
| time1 | time2 | |||||
| time1 |
|
| ||||
| time2 |
|
| ||||
Output 8.1.2 shows some descriptive statistics and two measures of correlation: Pearson and Kendall. Both of these measures indicate high and statistically significant dependence between life spans of two companies.
The second and final step is to empirically estimate the default probabilities of two companies. This is done using the FREQ procedure as follows:
proc freq data=default;
table default survive1-survive2;
run;
The results are shown in Output 8.1.3.
Output 8.1.3: Probabilities of Default
| default | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
|---|---|---|---|---|
| 0 | 298431 | 29.84 | 298431 | 29.84 |
| 1 | 701569 | 70.16 | 1000000 | 100.00 |
| survive1 | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
|---|---|---|---|---|
| 0 | 776594 | 77.66 | 776594 | 77.66 |
| 1 | 223406 | 22.34 | 1000000 | 100.00 |
| survive2 | Frequency | Percent | Cumulative Frequency | Cumulative Percent |
|---|---|---|---|---|
| 0 | 777292 | 77.73 | 777292 | 77.73 |
| 1 | 222708 | 22.27 | 1000000 | 100.00 |
Output 8.1.3 shows that the empirical default probabilities are 77.66% and 77.73%. If you assume that these companies are independent, the probability estimate that both companies will default during the period of three years is 0.7766*0.7773=0.6037 (60.37%). If you compare this naive estimate to the higher actual joint default probability of 70.16%, you see that if you neglected the correlation between the two companies, you underestimate the probability of default.