R/cov.mat.R

Defines functions cov.mat

Documented in cov.mat

cov.mat <- function(sdvec, rho, type='toeplitz'){
  p <- length(sdvec)
  cormat <- cor.mat(p, rho, type)
  covmat <- matrix(0, p, p)
  for(i in 1:p){
    for(j in 1:p){
      covmat[i,j] <- sdvec[i]*sdvec[j]*cormat[i,j]
    }
  }
  return(covmat)
}

Try the ILSE package in your browser

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

ILSE documentation built on Jan. 31, 2022, 9:06 a.m.