R/covtocor.R

"covtocor" <-
function(cov.mat){
  dc <- diag(cov.mat)
  So <- sqrt(dc)
  ds <- diag(1/So)
  Mo <- ds %*% cov.mat %*% ds
  Mo <- Mo - 0.5*(Mo-t(Mo)) # Correct any round-off error
  return(list(mat=Mo,sd=So))
}

Try the hapsim package in your browser

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

hapsim documentation built on May 1, 2019, 9:11 p.m.