CCOPULA Procedure
Example 8.2 Copula Analysis of Stock Returns
In this example, the correlations of daily returns on the large capital stocks Microsoft, Coca-Cola, IBM, Duke Energy, and British Petroleum are modeled using a t copula. To model the correlations, these companies’ stock prices are first converted into returns by using the following DATA step:
data allreturns;
format date MMDDYY10.;
input date:MMDDYY10. price_ibm price_msft price_bp price_ko price_duk;
ret_msft = price_msft/lag(price_msft)-1;
ret_ko = price_ko/lag(price_ko)-1;
ret_ibm = price_ibm/lag(price_ibm)-1;
ret_duk = price_duk/lag(price_duk)-1;
ret_bp = price_bp/lag(price_bp)-1;
if ret_msft ^= .;
keep date ret_ibm ret_msft ret_bp ret_ko ret_duk;
datalines;
01/02/2008 99.91 33.48 62.78 56.91 17.13
01/03/2008 100.11 33.62 63.98 57.50 17.19
01/04/2008 96.52 32.68 63.05 57.61 17.18
01/07/2008 95.49 32.90 64.18 58.97 17.62
... more lines ...
The stock return data can then be visualized and used to estimate the parameters of a t copula by using the following code:
/* Copula estimation and simulation of returns */
proc ccopula data = mylib.allreturns;
var ret_ibm ret_msft ret_bp ret_ko ret_duk;
* fit t-copula to stock returns;
fit T / marginals = empirical
method = MLE
plots = (datatype = both);
run;
proc ccopula;
var x1-x5;
define t t(df=5);
simulate t / ndraws=603 seed=100 outuniform=mylib.copuniform plots;
run;
proc ccopula data=mylib.copuniform;
var x1-x5;
fit T / marginals = uniform
method = MLE
plots = (datatype = uniform);
run;
The output from these statements is shown in Output 8.2.1.
Output 8.2.1: Copula Estimation
| Model Fit Summary | |
|---|---|
| Number of Observations | 603 |
| Data Set | ALLRETURNS |
| Copula Type | T |
| Fit Method | MLE |
| Marginals | Empirical |
| Empirical Approximation | Adaptive Binning |
| Adaptive Refinement Resolution | 1000 |
| Adaptive Interpolation Method | Linear |
| Number of Adaptive Iterations | 4 |
| Log Likelihood | 634.6931 |
| Maximum Absolute Gradient | 1.596E-7 |
| Number of Iterations | 7 |
| Optimization Method | Newton-Raphson |
| AIC | -1247.39 |
| SBC | -1198.97 |
| Parameter Estimates | ||||
|---|---|---|---|---|
| Parameter | Estimate | Standard Error | t Value | Approx Pr > |t| |
| DF | 3.659299 | 0.320474 | 11.42 | <.0001 |
| Pearson Correlations Matrix | |||||
|---|---|---|---|---|---|
| Variable | ret_ibm | ret_msft | ret_bp | ret_ko | ret_duk |
| ret_ibm | 1.0000 | 0.6415 | 0.5195 | 0.5004 | 0.5023 |
| ret_msft | 0.6415 | 1.0000 | 0.5137 | 0.4935 | 0.4388 |
| ret_bp | 0.5195 | 0.5137 | 1.0000 | 0.4063 | 0.4278 |
| ret_ko | 0.5004 | 0.4935 | 0.4063 | 1.0000 | 0.5266 |
| ret_duk | 0.5023 | 0.4388 | 0.4278 | 0.5266 | 1.0000 |
The first table in Output 8.2.1, "Model Fit Summary," provides some general description of copula model estimation. The second table, "Parameter Estimates," provides point estimates and inference about copula parameters. In this example, the only parameter in this table is the number of degrees of freedom in the multivariate t distribution. The last table, "Correlation Matrix," contains estimates of copula model parameters.
The graphical output from the preceding statements is shown in Output 8.2.2 and Output 8.2.3.
Output 8.2.2: Original Data

Output 8.2.3: Original Data Transformed into Uniform Marginals

Note that in Output 8.2.2, the most elliptical scatter plot, which is between IBM and Microsoft, indicates the strongest dependence. Similarly, in Output 8.2.3, graphs that are denser along the diagonal indicate the same thing.