tnagler / VineCopula

Statistical inference of vine copulas
87 stars 32 forks source link

pairs.copuladata #96

Closed oezgesahin closed 1 week ago

oezgesahin commented 3 weeks ago

Hey, The plotting function pairs.copuladata looks so inconsistent that I couldn't track the reason well. When I simulated 3D data from rotated copulas and visualized pairs plots, the lower diagonal contour plots seemed to be in the wrong direction. On the other hand, when I simulated similarly in 2D, the upper diagonal was wrong in this case. The same issue seems to apply in the pairs_copula_data. Can you check below?

set.seed(1)
Matrix <- c(1, 2, 3,
            0, 2, 3, 
            0, 0, 3)
Matrix <- matrix(Matrix, 3, 3)
family <- c(0, 34, 34,
             0, 0, 34, 
             0, 0, 0)
family <- matrix(family,3, 3)
par <- c(0, -3, -3,
         0, 0, -3, 
         0, 0, 0)
par <- matrix(par, 3, 3)
par2 <- matrix(0, 3, 3)

RVM <- RVineMatrix(Matrix = Matrix, family = family,
                   par = par, par2 = par2,
                   names = c("V1", "V2", "V3"))

simdata <- RVineSim(300, RVM)
pairs.copuladata(simdata)

u13 <- BiCopSim(500, 34, -3)
pairs.copuladata(u13)

case2.pdf case1.pdf

tnagler commented 2 weeks ago

That looks correct to me. The axes are flipped when you go from above to below the diagonal. This is the same behavior as in pairs() from base R.

oezgesahin commented 1 week ago

I was initially confused by the inconsistency in the lower-dimensional representation of the given data. However, I now understand that it might also change the axes if I'm not careful with the labeling. All is good; thanks!