Skip to contents

Build the raw per-method data-driven covariance components (cov_canonical / cov_pca / cov_flash / cov_flash(factors = "nonneg")) for a "strong" SumStats set – the reusable building block mashPriorCovariances then refines with an ED / udr engine. Exposed on its own so a workflow can build or inspect a single component (the mixture-prior notebook's per-method steps) without running the full prior.

Usage

mashCovarianceComponents(
  sumStatsList,
  alpha,
  vhat = NULL,
  components = c("canonical", "pca", "flash", "flash_nonneg"),
  nPcs = NULL,
  inputScale = c("auto", "beta", "z"),
  setSeed = 999
)

Arguments

sumStatsList

Named list (or S4Vectors::SimpleList) with at least "strong" (the discovery set the covariances are learned on).

alpha

mash alpha.

vhat

Residual correlation matrix (V); NULL -> identity.

components

Any of "canonical", "pca", "flash", "flash_nonneg". Built in that fixed order.

nPcs

PCs seeded into cov_pca. Default ncol(Bhat) - 1.

inputScale

SumStats -> matrix conversion scale.

setSeed

Integer seed (cov_flash is stochastic), or NULL to leave the ambient RNG untouched.

Value

A named list of covariance matrices (the concatenated components).