# Product P * N4212 ---> P (by identity)
u <- c(0.41, 0.87); v <- c(0.13,0.35)
prod2COP(u,v, cop1=P, cop2=N4212cop, para1=NA, para2=2.12) # 0.0533 and 0.3045
COP(u,v, cop=P) # 0.0533 and 0.3045
para <- list(cop1=PLACKETTcop, para1=0.19, cop2=PLACKETTcop, para2=34.5)
UV <- simCOP(n=1000, cop=prod2COP, para=para)
# This is large simulation run (with a lot of numerical operations) is expected
# at least for the Placketts and chosen parameters to trigger one or more
# Error in uniroot(func, interval = c(0, 1), u = u, LHS = t, cop = cop, :
# f() values at end points not of opposite sign
# warnings. The simCOP() function simply continues on with ignoring the solution or
# lack thereof for certain combinations, and simCOP() will report how many of the
# simulated values for sample of size n were computed. For example, for one n=1000,
# some 965 simulated values were returned. Lastly, the Spearman Rho can be computed
rhoCOP(cop=prod2COP, para=para) # -0.4271195 (theoretical)
rhoCOP(para=UV, as.sample=TRUE) # -0.4284223 (the test n=1000 --> n=965 sample)
Run the code above in your browser using DataLab