2
$\begingroup$

I have three variables with correlation coefficient of respectively 0.3; -0.2 and 0.1. I want to fit a T copula but when I use the fitCopula function it gives me a single value for rho, which leads to a poor fit to the data.

 zCop<-tCopula(dim=3) 
set.seed(500)
m <- pobs(as.matrix(cbind(IG, HY,GOV)))
fit <- fitCopula(zCop,m,method='ml')
coef(fit)


 rho.1         df 
0.06940047 6.30347241 

I have tried to fit bivariate copulas for each couple, and in that case the rho is close to the empirical one, but I get very different results for the df which can only be a single parameter.

When I do IG,HY I get the following, which is close to the empirical correlation:

zCop<-tCopula(dim=2) 
set.seed(500)
m <- pobs(as.matrix(cbind(IG,HY)))
cor(m, method="spearman")

fit <- fitCopula(zCop,m,method='ml')
coef(fit)
 rho.1         df 
 0.3417333 10.6678394 

I wonder whether I could impose the correlation structure and then use the df estimated from the multivariate copula (6.3 here) as down below (weher coef1 is the rho fitted for IG-HY, coef2 for IG-GOV and coef3 for HY-GOV)

u <- rCopula(3965,tCopula(dim=3,c(coef1,coef2,coef3),df=6.3,dispstr='un'))

I wonder whether I could use this:

zCop<-tCopula(dim=3, dispstr = 'un') 
set.seed(500)
m <- pobs(as.matrix(cbind(IG, HY,GOV)))
fit <- fitCopula(zCop,m,method='itau.mpl')
coef(fit)

      rho.1       rho.2       rho.3          df 
 0.33823924 -0.19170082  0.07088704 13.89581598 
$\endgroup$
3
  • $\begingroup$ What is matrix 'm' return? $\endgroup$
    – Nick
    Commented Aug 14, 2019 at 4:32
  • $\begingroup$ matrix M is the matrix created by converting data from IG, HY amd GOV into pseudo observations, see also (stats.stackexchange.com/questions/355085/…) $\endgroup$
    – Sabotar
    Commented Aug 26, 2019 at 15:01
  • 1
    $\begingroup$ Do you want a t-copula or just t-distributed marginals? $\endgroup$
    – Dave
    Commented Sep 25, 2021 at 17:09

2 Answers 2

2
$\begingroup$

I have tried to fit bivariate copulas for each couple

The nice way to model multivariate data fitting bivariate copula for each pair of variables is using pair-copula models. Pair-copula models fit only bivariate copula (pair-copula) for each pair of variables at a time. Using VineCopula or CDvine packages you can nicely fit a C-vine model (one sub-class) of pair-copula models to your data using only t-copula family. As you did not provide your data, then I cannot help you with further information about the R code. Try one of the two listed packages. I am happy to help if you need further help.

$\endgroup$
2
$\begingroup$

You need to set the dispstr argument of tCop to 'un'

In the first line of your example code you omit the dispstr argument, which causes it to take its default value of 'ex'. This specifies an exchangeable copula, so you get only a single rho value. Specifying 'un' allows you to fit a t-copula with an arbitrary covariance matrix.

Here's an example:

cormat <- matrix(c(1, 0.3, -0.1, 0.3, 1, 0.2, -0.1, 0.2, 1), nrow=3)
xtest <- rmvt(1000, cormat, df=4)
utest <- pobs(xtest)
tcop <- tCopula(dim=3, dispstr='un', df.fixed=FALSE)            # This line is the key
fit <- fitCopula(tcop, utest)

When you print fit afterward you get:

Call: fitCopula(copula, data = data)
Fit based on "maximum pseudo-likelihood" and 1000 3-dimensional observations.
Copula: tCopula 
  rho.1   rho.2   rho.3      df 
 0.2538 -0.1047  0.1662  3.9508 
The maximized loglikelihood is 127.7 
Optimization converged

Note, however, that when fitting an elliptical copula to a dataset you can only have a single df parameter for the copula. If you want the df to be different for each pair, then you could fit a pair copula construct, as explained in the answer by Mary. Alternatively, you could use a grouped t-copula, as described in example 3.1.10 (pp. 95-97) of Elements of Copula Modeling with R, by Hofert, et al.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.