wolfCOP(cop=PSP)
# EXTENDED EXAMPLE --- with ## Not run: to be added by user for more graphics.
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop, para1=0.145, para2=21.9,
alpha=0.81, beta=0.22)
D <- simCOP(n=250, cop=composite2COP, para=para,
cex=0.5, col=rgb(0,0,0,0.2), pch=16)
# Globally PQD but there is a significant local NQD part of IxI space that is
PQD <- isCOP.PQD(cop=composite2COP, para=para, uv=D)
points(D, col=PQD$local.PQD+2, lwd=2)
# clearly NQD, so this copula interacts through the P copula. Hence by the logic
# of Nelsen (2006), then Schweizer-Wolff Sigma should be larger than Spearman Rho.
wolfCOP(cop=composite2COP, para=para) # 0.08373378
rhoCOP(cop=composite2COP, para=para) # 0.02845131
hoefCOP(cop=composite2COP, para=para) # 0.08563823
# which is clearly present in these simulated data. In fact the output above also shows
# Sigma to be larger than Kendall Tau, Gini Gamma, and Blomqvist Beta thus Sigma has
# captured the fact that although the symbols plot near randomly on the figure, the
# the symbol coloring for PQD and NQD clearly shows local dependency differences.
the.grid <- EMPIRgrid(para=D)
the.persp <- persp(the.grid$empcop, theta=-25, phi=20, shade=TRUE,
xlab="U VARIABLE", ylab="V VARIABLE", zlab="COPULA C(u,v)")
empcop <- EMPIRcopdf(para=D) # data.frame of all points
points(trans3d(empcop$u, empcop$v, empcop$empcop, the.persp), cex=0.7,
col=rgb(0,1-sqrt(empcop$empcop),1,sqrt(empcop$empcop)), pch=16)
points(trans3d(empcop$u, empcop$v, empcop$empcop, the.persp),
col=PQD$local.PQD+1, pch=1)
layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE), respect = TRUE)
PQD.NQD.cop <- gridCOP(cop=composite2COP, para=para)
Pi <- gridCOP(cop=P)
RHO <- PQD.NQD.cop - Pi; SIG <- abs(RHO)
the.persp <- persp(PQD.NQD.cop, theta=-25, phi=20, shade=TRUE, cex=0.5,
xlab="U VARIABLE", ylab="V VARIABLE", zlab="COPULA C(u,v)")
mtext("The Copula that has local PQD and NQD", cex=0.5)
the.persp <- persp(Pi, theta=-25, phi=20, shade=TRUE, cex=0.5,
xlab="U VARIABLE", ylab="V VARIABLE", zlab="COPULA C(u,v)")
mtext("Independence (Pi)", cex=0.5)
the.persp <- persp(RHO, theta=-25, phi=20, shade=TRUE, cex=0.5,
xlab="U VARIABLE", ylab="V VARIABLE", zlab="COPULA C(u,v)")
mtext("Copula delta: Integrand of Spearman's Rho", cex=0.5)
the.persp <- persp(SIG, theta=-25, phi=20, shade=TRUE, cex=0.5,
xlab="U VARIABLE", ylab="V VARIABLE", zlab="COPULA C(u,v)")
mtext("abs(Copula delta): Integrand of Schweizer-Wolff's Sigma", cex=0.5)
Run the code above in your browser using DataLab