# Fitting copulas with a given covariance matrix

Suppose that I have a new way of estimating covariance matrice (from a particular data set), and that I believe this is better than the sample covariance matrix. I want to fit a t-copula with this new covariance matrix, and assess how good this particular choice of copula and covariance matrix (vs. say the gaussian copula with the sample covariance matrix), how should I tackle this problem (using R)?

Thanks

R offers a package called copula (http://cran.r-project.org/web/packages/copula/index.html). This package allows you to handle copula in an very easy way.

First of all, I assume you have a covariance matrix called covSample and CovBetter (for your new one. In the example, I will assume they have 8 dimensions and you want 5 degrees of freedom for the tCopula. You can create copulas using them by:

library(copula)
corSample <- cov2cor(covSample)
corBetter <- cov2cor(covBetter)

copG <- normalCopula(param=corr[lower.tri(corSample)],dim=8,dispstr='un')
copT <- tCopula(param=corr[lower.tri(corBetter)],dim=8,dispstr='un',df=5)

uG <- rCopula(10000,copG)
uT <- rCopula(10000,copT)


After that, you should have a uG and a uT matrix that you can put into your inverse margin distribution and analyse whatever you are interested in.