## Not run:
# invcdfnames <- c("qt","qpois","qnorm")
# paramslists <- list(
# m1 = list(df = 3),
# m2 = list(lambda = 5),
# m3 = NULL # it means list(mean = 0, sd = 1)
# )
# cor_matrix <- matrix(c(1,0.5,-0.3,0.5,1,0.4,-0.3,0.4,1), 3)
# Sigma <- BoundingRA(cor_matrix,invcdfnames,paramslists)
# Sigma
# invcdfnames <- c("qunif","qunif","qunif")
# paramslists <- list(
# m1 = NULL, #it means list(min = 0, max = 1)
# m2 = NULL,
# m3 = NULL
# )
# cor_matrix <- matrix(c(1,0.5,-0.3,0.5,1,0.4,-0.3,0.4,1), 3)
# Sigma <- BoundingRA(cor_matrix,invcdfnames,paramslists)
# Sigma
# #NB:For element 0.5 in cor_matrix, the true root should be around 2*sin(0.5*3.14/6).
# res <- sapply(c(0.5,-0.3,0.4), function(x){2*sin(x*pi/6)})
# trueroots <- diag(1/2,3,3)
# trueroots[upper.tri(trueroots)] <- res
# trueroots <- trueroots + t(trueroots)
# trueroots
# abserrors <- abs(Sigma - trueroots)
# abserrors
# ## End(Not run)
Run the code above in your browser using DataLab