Compute a list of canonical covariance matrices

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).

Value

a list of covariance matrices

Details

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

Examples

data = mash_set_data(Bhat = cbind(c(1,2),c(3,4)), Shat = cbind(c(1,1),c(1,1)))
 cov_canonical(data)
#> $identity
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    1
#> 
#> $singletons_1
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    0
#> 
#> $singletons_2
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> 
#> $equal_effects
#>      [,1] [,2]
#> [1,]    1    1
#> [2,]    1    1
#> 
#> $simple_het_1
#>      [,1] [,2]
#> [1,] 1.00 0.25
#> [2,] 0.25 1.00
#> 
#> $simple_het_2
#>      [,1] [,2]
#> [1,]  1.0  0.5
#> [2,]  0.5  1.0
#> 
#> $simple_het_3
#>      [,1] [,2]
#> [1,] 1.00 0.75
#> [2,] 0.75 1.00
#> 
 cov_canonical(data,"singletons")
#> $singletons_1
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    0
#> 
#> $singletons_2
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#> 
 cov_canonical(data,c("id","sing")) # can use partial matching of names
#> $identity
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    1
#> 
#> $singletons_1
#>      [,1] [,2]
#> [1,]    1    0
#> [2,]    0    0
#> 
#> $singletons_2
#>      [,1] [,2]
#> [1,]    0    0
#> [2,]    0    1
#>