sampling.cov.matrix: Sample a covariance matrix from a list of cov matrices

Description Usage Arguments Details Value Author(s) References Examples

Description

Sample a covariance matrix from a list of cov matrices

Usage

1
sampling.cov.matrix(cov.matrix, ngenes)

Arguments

cov.matrix

the list a covariance matrices to sample from

ngenes

number of covariance matrices in the list of cov.matrix

Details

to be called by sample.dep

Value

return a covariance matrix randomly sampled from the list of cov.matrix

Author(s)

Peng Liu peng\_liu@groton.pfizer.com

References

~put references to the literature/web site here ~

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
ngenes <- 7; cov.matrix <- list(ngenes);

for ( i in c(1:ngenes)) {
    cov.matrix[[i]] <- diag(rep(i*0.1, i+1))
}

cov.matrix[[4]][1,1] <- cov.matrix[[5]][1,1] <- cov.matrix[[6]][1,1] <- 1
cov.matrix[[4]][2,1] <- cov.matrix[[4]][1,2] <- 0.15 # corr = 0.15 / (1*0.2) = 0.75
cov.matrix[[5]][2,1] <- cov.matrix[[5]][1,2] <- 0.5 # corr = 0.15 /(1*sqrt(0.5)) = 0.59
cov.matrix[[7]][1,1] <- 10
cov.matrix[[7]][2,1] <- cov.matrix[[7]][1,2] <- 0.6 # corr = 0.67
cov.matrix[[7]][3,1] <- cov.matrix[[7]][1,3] <- 0.5
cov.matrix[[7]][3,2] <- cov.matrix[[7]][2,3] <- 0.4

test.cov <- sampling.cov.matrix(cov.matrix, ngenes)

warnes/exp.ssize documentation built on May 4, 2019, 12:59 a.m.