mytest = function(qcond,cpar,n=500,seed=123)
{ set.seed(seed)
u1 = runif(n)
u2 = qcond(runif(n),u1,cpar)
#convert to uniform scores (marginals are usually not known)
u1 = (rank(u1)-0.5)/n
u2 = (rank(u2)-0.5)/n
alp = c(1,5,10:20)
zetaL = zetaDep(cbind(u1,u2),alp,rank=FALSE,lowertail=FALSE)
zetaU = zetaDep(cbind(u1,u2),alp,rank=FALSE,lowertail=TRUE)
print(cbind(alp,zetaL,zetaU))
utd = tailDep(u1,u2, lowertail=FALSE, eps=0.1, semictol=0.1, rank=FALSE, iprint=TRUE)
ltd = tailDep(u1,u2, lowertail=TRUE, eps=0.1, semictol=0.1, rank=FALSE, iprint=TRUE)
cat(ltd,utd,"\n")
utd = tailDep(u1,u2, lowertail=FALSE, eps=0.1, semictol=0.1, rank=FALSE, iprint=FALSE)
ltd = tailDep(u1,u2, lowertail=TRUE, eps=0.1, semictol=0.1, rank=FALSE, iprint=FALSE)
cat(ltd,utd,"\n")
#par(mfrow=c(2,1))
#zetaPlot(cbind(u1,u2),alp,ylim=c(0,1),inverse=FALSE)
#zetaPlot(cbind(u1,u2),alp,ylim=c(0,1),inverse=TRUE)
0
}
mytest(qcondFrank,3)
mytest(qcondbvtcop,c(0.6,5))
Run the code above in your browser using DataLab