CCOPULA Procedure

Getting Started: CCOPULA Procedure

The following example illustrates the use of PROC CCOPULA. The data are daily returns on several major stocks. The main purpose of this example is to estimate the joint distribution of stock returns and then use this distribution to simulate a new sample of specified size.

Figure 1 shows the first 10 observations of the daily stock return data set.

Figure 1: First 10 Observations of Daily Returns

Obsdateret_msftret_koret_ibmret_dukret_bp
101/03/20080.0041820.0103670.0020020.0035030.019114
201/04/2008-0.0279600.001913-0.035861-0.000582-0.014536
301/07/20080.0067320.023607-0.0106710.0256110.017922
401/08/2008-0.0334350.004239-0.024610-0.002838-0.016049
501/09/20080.0295600.0266800.0073010.010814-0.027078
601/10/2008-0.0030540.0044410.016414-0.001689-0.004395
701/11/2008-0.012255-0.027346-0.022546-0.012408-0.018473
801/14/20080.0139580.0084180.0538570.0034270.001166
901/15/2008-0.011318-0.010851-0.010689-0.017075-0.040925
1001/16/2008-0.022587-0.015021-0.0019550.002316-0.021336


The following statements fit a normal copula to the returns data (by using the FIT statement) and create a new SAS item store that contains parameter estimates of the model along with a complete description of the model (including variable names, copula type, and so on). The VAR statement specifies the list of variables, which in this case are the daily returns of stocks from five large companies.

/* Copula estimation */
proc ccopula data = mylib.returns;
   var ret_ibm ret_msft ret_bp ret_ko ret_duk;
   fit normal / store=mylib.estimates_norm;
run;

The first table in Figure 2 shows some general information about the copula fitting procedure: the number of observations, the name of the input data table, the type of model, and the correlations matrix.

Figure 2: Copula Estimation: Fit Summary and Correlations Matrices

The CCOPULA Procedure

Model Fit Summary
Number of Observations603
Data SetRETURNS
Copula TypeNormal
Fit MethodMLE
MarginalsEmpirical
Empirical ApproximationAdaptive Binning
Adaptive Refinement Resolution1000
Adaptive Interpolation MethodLinear
Number of Adaptive Iterations4

Pearson Correlations Matrix
Variableret_ibmret_msftret_bpret_koret_duk
ret_ibm1.00000.62320.52940.47250.4902
ret_msft0.62321.00000.52290.50150.4567
ret_bp0.52940.52291.00000.39800.4378
ret_ko0.47250.50150.39801.00000.5283
ret_duk0.49020.45670.43780.52831.0000

Kendall Correlations Matrix
Variableret_ibmret_msftret_bpret_koret_duk
ret_ibm1.00000.42830.35510.31330.3261
ret_msft0.42831.00000.35030.33440.3020
ret_bp0.35510.35031.00000.26060.2885
ret_ko0.31330.33440.26061.00000.3544
ret_duk0.32610.30200.28850.35441.0000

Spearman Correlations Matrix
Variableret_ibmret_msftret_bpret_koret_duk
ret_ibm1.00000.60520.51160.45550.4729
ret_msft0.60521.00000.50520.48410.4400
ret_bp0.51160.50521.00000.38260.4214
ret_ko0.45550.48410.38261.00000.5106
ret_duk0.47290.44000.42140.51061.0000


Then, in the following statements, the SIMULATE statement specifies a copula named COP, and the RESTORE= option specifies that the item store Estimates_Norm be used as the source for the variable names, copula type, and parameters. The NDRAWS=500 option in the SIMULATE statement generates 500 observations from the normal copula. The OUTUNIFORM= option specifies the name of the data table to contain the simulated sample with uniform marginal distributions. Note that this syntax does not require the DATA= option and that neither the VAR statement nor the DEFINE statement is needed.

/* Ccopula simulation of uniforms */
proc ccopula;
   simulate cop / restore=mylib.estimates_norm
                  ndraws     = 500
                  seed       = 1234
                  outuniform = mylib.simulated_uniforms;
run;

The simulated data are contained in the new data table, mylib.Simulated_Uniforms.

The preceding sequence of PROC CCOPULA usage—first fit, then simulate using estimated parameters—is a legitimate sequence but has a limitation in that the second PROC CCOPULA call does not generate the sample according to the empirical distribution of the raw data. It generates only marginally uniform series.

In the following statements, the FIT statement fits a t copula to the returns data and at the same time simulates the sample according to empirical marginal distributions. Because there is no VAR or DEFINE statement, PROC CCOPULA assumes that you want to initialize the simulation by using the information stored in an item store. Because the RESTORE= option is not used in the SIMULATE statement, PROC CCOPULA uses the item store that is created when the FIT statement is executed.

/* Ccopula estimation and simulation */
proc ccopula data = mylib.returns;
   var ret_ibm ret_msft ret_bp ret_ko ret_duk;
   fit T / store=mylib.estimates_t;
   simulate / ndraws = 1000
              seed   = 1234
              outuniform    = mylib.simuni;
run;

The output of the statements is similar in structure to the output displayed in Figure 2, with the addition of parameter estimates and inference statistics that are specific to the copula model as shown in Figure 3. For a t copula, the degrees of freedom are displayed (as in Figure 3); for Archimedean copulas, the parameter "theta" is displayed; and for a normal copula, this table is not printed.

Figure 3: Copula Estimation: Specific Parameter Estimates

The CCOPULA Procedure

Parameter Estimates
ParameterEstimateStandard
Error
t ValueApprox
Pr > |t|
DF3.6592990.32047411.42<.0001


The simulated data are contained in the new data table, mylib.Simuni.

Last updated: July 09, 2026