R/normal.copula.R

Defines functions normal.copula

Documented in normal.copula

#                
# normal copula  
#                

normal.copula<-function(u,v,beta,cov){
  
  mycdf.vector <- function(x) {
    corr <- diag(dim)
    corr[lower.tri(corr)|upper.tri(corr)] <- (exp(2*x[3])-1)/(exp(2*x[3])+1)
    pmvnorm(lower = rep(-Inf, dim), upper = qnorm(x[1:2]), sigma = corr)[1]
  }
  
  theta<-cov %*% as.matrix(beta)
  dim <- 2
  val <- apply(matrix(cbind(u, v, theta), ncol = 3), 1, mycdf.vector)
  val
}

Try the icensBKL package in your browser

Any scripts or data that you put into this service are public.

icensBKL documentation built on Sept. 19, 2022, 5:06 p.m.