# NOT RUN {
t <- 0.9 # The Theta of the copula and we will compute Spearman Rho.
di <- integrate(function(t) log(t)/(1-t), lower=1, upper=(1-t))$value
A <- di*(1+t) - 2*log(1-t) + 2*t*log(1-t) - 3*t # Nelsen (2007, p. 172)
rho <- 12*A/t^2 - 3 # 0.4070369
rhoCOP(AMHcop, para=t) # 0.4070369
sum(sapply(1:100,function(k) 3*t^k/choose(k+2,2)^2)) # Machler (2014)
# 0.4070369 (see Note, very many tens of terms are needed)
# }
# NOT RUN {
# }
# NOT RUN {
layout(matrix(1:2,byrow=TRUE)) # Note Kendall Tau is same on reversal.
s <- 2; set.seed(s); nsim <- 10000
UVn <- simCOP(nsim, cop=AMHcop, para=c(0.9, "FALSE" ), col=4)
mtext("Normal definition [default]") # '2nd' parameter could be skipped
set.seed(s) # seed is used to keep Rho/Tau inside attainable limits for the example
UVr <- simCOP(nsim, cop=AMHcop, para=c(0.9, "TRUE"), col=2)
mtext("Reversed definition")
AMHcop2(UVn[,1], UVn[,2], fit="rho")$rho # -0.2581653
AMHcop2(UVr[,1], UVr[,2], fit="rho")$rho # -0.2570689
rhoCOP(cop=AMHcop, para=-0.9) # -0.2483124
AMHcop2(UVn[,1], UVn[,2], fit="tau")$tau # -0.1731904
AMHcop2(UVr[,1], UVr[,2], fit="tau")$tau # -0.1724820
tauCOP(cop=AMHcop, para=-0.9) # -0.1663313
# }
Run the code above in your browser using DataLab