tauCOP(cop=PSP) # 1/3
tauCOP(cop=PSP, brute=TRUE) # 0.3306625
# CPU heavy example showing that the dual-integration (fast) results in
# a Kendall's Tau that matches a sample version
dotau <- function(n) {
uv <- simCOP(n=n, cop=PSP, ploton=FALSE, points=FALSE)
return(cor(uv$U, uv$V, method="kendall"))
}
taus <- replicate(100, dotau(1000))
tau.sample <- mean(taus); print(tau.sample) # 0.3333763
# Nelsen (2006, pp. 160-161, numeric results shown thereine)
# The rational values or integers may be derived analytically.
tauCOP(cop=M, cop2=M) # 1, correct
tauCOP(cop=M, cop2=P) # 1/3, correct
tauCOP(cop=P, cop2=M) # 1/3, correct
tauCOP(cop=M, cop2=W) # 0, correct
tauCOP(cop=W, cop2=M) # throws warning, swaps copulas, == tauCOP(M,W)
tauCOP(cop=W, cop2=P) # throws warning, swaps copulas, approx. -1/3
tauCOP(cop=P, cop2=W) # -1/3, correct
tauCOP(cop=P, cop2=P) # 0, correct
tauCOP(cop=M, cop2=W, brute=TRUE) # 0, correct
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop,
para1=0.00395, para2=4.67, alpha=0.9392, beta=0.5699)
tauCOP(cop=composite2COP, para=para)
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop,
para1=0.14147, para2=20.96, alpha=0.0411, beta=0.6873)
tauCOP(cop=composite2COP, para=para)
para <- list(cop1=PLACKETTcop, cop2=PLACKETTcop,
para1=0.10137, para2=4492.87, alpha=0.0063, beta=0.0167)
# Theoretical attempt fails because para2 is large and thus a singularity
# is emerging and internal copula swapping does not help
tauCOP(cop=composite2COP, para=para) # fails
tauCOP(cop=composite2COP, para=para, brute=TRUE) # about 0.95
Run the code above in your browser using DataLab