# Problem in copula fitting

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")


> 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?

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