cov_canonical: Compute a list of canonical covariance matrices

View source: R/compute_covs.R

cov_canonicalR Documentation

Compute a list of canonical covariance matrices

Description

Compute a list of canonical covariance matrices

Usage

cov_canonical(
  data,
  cov_methods = c("identity", "singletons", "equal_effects", "simple_het")
)

Arguments

data

a mash data object, eg as created by mash_set_data

cov_methods

a vector of strings indicating the matrices to be used: "identity" for the identity (effects are independent among conditions); "singletons" for the set of matrices with just one non-zero entry x_{jj} = 1, j = 1,...,R; (effect specific to condition j); "equal_effects" for the matrix of all 1s (effects are equal among conditions); "simple_het" for a set of matrices with 1s on the diagonal and all off-diagonal elements equal to 0.25, 0.5 or 0.75; see cov_simple_het for details; (effects are correlated among conditions).

Details

The default is that this function computes covariance matrices corresponding to the "bmalite" models.

Value

a list of covariance matrices

Examples

data = mash_set_data(Bhat = cbind(c(1,2),c(3,4)), Shat = cbind(c(1,1),c(1,1)))
 cov_canonical(data)
 cov_canonical(data,"singletons")
 cov_canonical(data,c("id","sing")) # can use partial matching of names


mashr documentation built on Oct. 18, 2023, 5:08 p.m.