# How to work with vine copula in R?

I have returns of 4 stocks: stock1, stock2, stock3, stock4. And I use R and

library(VineCopula)


to do:

Matrix <- matrix(c(4, 3, 2, 1,
0, 3, 2, 1,
0, 0, 2, 1,
0, 0, 0, 1), 4, 4)

returns <- cbind(stock1, stock2, stock3, stock4)

selectedCopula <- RVineCopSelect(pobs(as.matrix(returns)), Matrix = Matrix, familyset = NA)
selectedCopula


Result is:

C-vine copula with the following pair-copulas:
Tree 1:
1,4  t (par = 0.35, par2 = 4.89, tau = 0.23)
1,3  Gaussian (par = 0.53, tau = 0.36)
1,2  BB8 (par = 1.78, par2 = 0.86, tau = 0.19)
Tree 2:
2,4;1  Tawn  type 1 (par = 3.04, par2 = 0.01, tau = 0.01)
2,3;1  BB8 (par = 4.61, par2 = 0.84, tau = 0.54)
Tree 3:
3,4;2,1  Rotated Tawn type 1 180 degrees (par = 11.06, par2 = 0, tau = 0)


I know how to find distributions and simulate data of pairs(mvdc and rMvdc) and I find it (Its result of Tree 1)

copula_dist14
sim14
copula_dist13
sim13
copula_dist12
sim12


But how can I find distributions and simulate data of pairs of Tree 2? I try it:

selectedCopula124 <- BiCopSelect(sim12,sim14,familyset=NA)
selectedCopula124


And I have:

Error:
In BiCopSelect: Data have to be in the interval [0,1].


How to make it right?