Description Usage Arguments Details Value Author(s) References Examples
Sample a covariance matrix from a list of cov matrices
1 | sampling.cov.matrix(cov.matrix, ngenes)
|
cov.matrix |
the list a covariance matrices to sample from |
ngenes |
number of covariance matrices in the list of cov.matrix |
to be called by sample.dep
return a covariance matrix randomly sampled from the list of cov.matrix
Peng Liu peng\_liu@groton.pfizer.com
~put references to the literature/web site here ~
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.