# Joe (2015, p. 5) names rMTCJ = reflected Mardia-Takahasi-Cook-Johnson copula
"rMTCJ" <- function(u,v,para, ...) {
u + v - 1 + ((1-u)^(-para) + (1-v)^(-para) - 1)^(-1/para)
} # Survial Copula ("reflected" in Joe's terms)
densityCOPplot(cop=rMTCJ, para=1.0760, n=9000)
# The density plot matches that shown by Joe (2015, p. 11, fig. 1.2, lower left plot)
# for a Spearman's Rho equaling 0.5.
rhoCOP(cop=rMTCJ, para=1.076075) # 0.4999958
# Now let us get really wild with a composition with TWO modes!
# This example also proves that the orientation of the grid is consistent with
# orientation of the simulations.
para <- list(alpha=0.15, beta=0.90, kappa=0.06, gamma=0.96,
cop1=GHcop, cop2=PLACKETTcop, para1=5.5, para2=0.07)
densityCOPplot(cop=composite2COP, para=para, n=9000)
# Now let us hack back to a contour density plot with U(0,1) and not N(0,1)
# margins just so show that capability exists, but emphasis of densityCOPplot
# is clearly on Joe's advocation to it does not have a trigger to use U(0,1)
# margins.
set.seed(12)
H <- densityCOPplot(cop=PLACKETTcop, para=41.25, getmatrix="cden", n=1000)
set.seed(12)
UV <- simCOP(cop=PLACKETTcop, para=41.25, n=1000, col=8)
U <- as.numeric(colnames(H)); V <- as.numeric(rownames(H))
contour(x=U, y=V, z=t(H), lwd=1.5, cex=2, add=TRUE, col=2)
Run the code above in your browser using DataLab