SUm of Single Effect (SuSiE) Regression using Summary Statistics Z and R

mvsusie_rss(
  Z,
  R,
  L = 10,
  prior_variance = 50,
  residual_variance = NULL,
  prior_weights = NULL,
  estimate_prior_variance = TRUE,
  estimate_prior_method = "EM",
  check_null_threshold = 0,
  prior_tol = 1e-09,
  compute_objective = TRUE,
  precompute_covariances = FALSE,
  s_init = NULL,
  coverage = 0.95,
  min_abs_corr = 0.5,
  n_thread = 1,
  max_iter = 100,
  tol = 0.001,
  verbosity = 2,
  track_fit = FALSE
)

Arguments

Z

a J by R matrix of z scores

R

a J by J LD matrix

L

maximum number of non-zero effects

prior_variance

Can be 1) a vector of length L, or a scalar, for scaled prior variance when Y is univariate (equivalent to `susieR::susie`); 2) a matrix for simple Multivariate regression or 3) a MASH fit that contains an array of prior covariance matrices and their weights

residual_variance

the residual variance (defaults to 1)

prior_weights

a p vector of prior probability that each element is non-zero

estimate_prior_variance

indicates whether to estimate prior (currently only works for univariate Y and for multivariate Y when prior is a single matrix)

estimate_prior_method

the method used for estimating prior variance: "optim", "uniroot" and "em" for univariate Y, "optim" and "simple" for multivariate Y.

check_null_threshold

when prior variance is estimated, compare the estimate with the null and set prior variance to null (zero) unless the log-likelihood using the estimate is larger than that of null by this threshold. For example, you can set it to 0.1 to nudge the estimate towards zero. When used with "EM" method setting check_null_threshold=NA will skip the check and instead relying solely on EM to update this parameter.

prior_tol

when prior variance is estimated, compare the estimated value to this tol at the end of the analysis and exclude a single effect from PIP computation if the estimated prior variance is smaller than it.

s_init

a previous model fit with which to initialize

coverage

coverage of confident sets. Default to 0.95 for 95% credible interval.

min_abs_corr

minimum of absolute value of correlation allowed in a credible set. Default set to 0.5 to correspond to squared correlation of 0.25, a commonly used threshold for genotype data in genetics studies.

n_thread

maximum number of threads to use for parallel computation (only applicable to mixture prior)

max_iter

maximum number of iterations to perform

tol

convergence tolerance

verbosity

set to 0 for no message output, 1 for a concise progress bar massage output and 2 for one line of message at the end of each iteration.

track_fit

add an attribute trace to output that saves some current quantities of all iterations

Value

a susie fit, which is a list with some or all of the following elements

alpha

an L by p matrix of posterior inclusion probabilites

b1

an L by p matrix of posterior means (conditional on inclusion)

b2

an L by p matrix of posterior second moments (conditional on inclusion)

KL

an L vector of KL divergence

lbf

an L vector of logBF

sigma2

residual variance

V

prior variance

elbo

a vector of values of elbo achieved (objective function)

niter

number of iterations took for convergence

convergence

convergence status

sets

a list of `cs`, `purity` and selected `cs_index`

pip

a vector of posterior inclusion probability

walltime

records runtime of the fitting algorithm

z

a vector of univariate z-scores

Examples

set.seed(1)
n = 1000
p = 1000
beta = rep(0,p)
beta[1:4] = 1
X = matrix(rnorm(n*p),nrow=n,ncol=p)
y = X %*% beta + rnorm(n)
R = t(X) %*% X
z = susieR:::calc_z(X,y)
res = mvsusie_rss(z,R,L=10)