# 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
rho <- 12*A/t^2 - 3 # 0.4070369
rhoCOP(AMHcop, para=t) # 0.4070369
sum(sapply(100:1,function(k) exp(log(3)+k*log(t)-2*lchoose(k+2,2))))
# 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.
UVn <- simCOP(3560, cop=AMHcop, para=c(-0.9, "FALSE" ), col=4)
mtext("Normal definition [default]") # '2nd' parameter could be skipped
UVr <- simCOP(3560, cop=AMHcop, para=c(-0.9, "TRUE"), col=2)
mtext("Reversed definition")
AMHcop(UVn[,1], UVn[,2])$tau # Should be about -0.1663313 because
AMHcop(UVr[,1], UVr[,2])$tau # tauCOP(AMHcop, para=-0.9) is theoretically.
# }
Run the code above in your browser using DataLab