0
$\begingroup$

I have returns of 2 stocks: stock1 and stock2. And I want to fit pair copula. I use this libraries

library(VineCopula)
library(copula)

then I select an appropriate bivariate copula family

u <- pobs(as.matrix(cbind(stock1,stock2)))[,1]
v <- pobs(as.matrix(cbind(stock1,stock2)))[,2]
selectedCopula <- BiCopSelect(u,v,familyset=NA)

And result is

Bivariate copula: BB8 (par = 1.78, par2 = 0.86, tau = 0.19) 

then i fit

copula <- BB8Copula(param = c(1.78,0.86))
m <- pobs(as.matrix(cbind(stock1,stock2)))
fit <- fitCopula(copula,m,method='itau')
coef(fit)

And when I simulated and compared Kendall tau

my_dist <- mvdc(claytonCopula(param = 1.48, dim = 2), margins = c("gamma","gamma"), paramMargins = list(list(shape = x_shape, rate = x_rate), list(shape = y_shape, rate = y_rate)))

sim <- rMvdc(306, my_dist)
cor(cbind(stock1,stock2), method = "kendall")
cor(sim, method = "kendall")

I have bad results

> cor(cbind(stock1,stock2), method = "kendall")
        stock1     stock2
stock1 1.0000000 0.1955256
stock2 0.1955256 1.0000000
> cor(sim, method = "kendall")
          [,1]      [,2]
[1,] 1.0000000 0.4441659
[2,] 0.4441659 1.0000000

Where is the problem and to fix it?

$\endgroup$
  • $\begingroup$ Can you make clear what your problem is? $\endgroup$ – John May 22 at 20:15
  • $\begingroup$ look at correlation of data and simulated data. 0.19 and 0.44. I think its problem $\endgroup$ – Ильшат Мурзурбеков May 23 at 16:20
  • $\begingroup$ It should be very close $\endgroup$ – Ильшат Мурзурбеков May 23 at 16:22
  • $\begingroup$ @John and I'm not sure that I correctly built bb8 copula (have I specified the correct parameters?) $\endgroup$ – Ильшат Мурзурбеков May 23 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.