Filter conditions from mash prior mixture components
Source:R/mashWrapper.R
filterMixtureComponents.RdDrop the conditions not in conditionsToKeep from each prior covariance
matrix in U, optionally removing components whose weight is below
wCutoff.
Examples
conditionsToKeep <- c("cond1", "cond2")
cn <- c("cond1", "cond2", "cond3")
U <- list(shared = diag(3), corr = matrix(0.3, 3, 3) + diag(0.7, 3))
U <- lapply(U, function(m) {
dimnames(m) <- list(cn, cn)
m
})
filterMixtureComponents(conditionsToKeep = conditionsToKeep, U = U)
#> 2 components of matrices remained after filtering.
#> $U
#> $U$shared
#> cond1 cond2
#> cond1 1 0
#> cond2 0 1
#>
#> $U$corr
#> cond1 cond2
#> cond1 1.0 0.3
#> cond2 0.3 1.0
#>
#>
#> $w
#> numeric(0)
#>