Appendix В
R Codes
B.l Generate и and v as shown in Section 3.4
## Copula simulation (From Nelsen (1986) p.3282)
copula.sim < — function(nn,copula.type,alphaa) {
if (copula.type == 1){ #Frank.copula.type=l
xxl < — as.double(runif(nn,0,l))
vv < — as.double(runif (nn,0,l))
numm < — as.double(vv*(alphaa -1))
denomm < — as.double((alphaa^xxl)*(l-vv)+ vv)
xx2 < — as.double(logb(l + numm∕denomm,alphaa)) }
par (mfrow=c ( 1,1 ) )
plot(xxl,xx2,xlim=c(0,l),ylim=c(0,l), main “Simulated Copula Data”)
103