compute_posterior_matrices: Compute posterior matrices.

compute_posterior_matricesR Documentation

Compute posterior matrices.

Description

Compute posterior matrices.

Usage

compute_posterior_matrices(
  data,
  Ulist,
  posterior_weights,
  algorithm.version = c("Rcpp", "R"),
  A = NULL,
  output_posterior_cov = FALSE,
  mc.cores = 1,
  posterior_samples = 0,
  seed = 123
)

Arguments

data

A mash data object; e.g., created by mash_set_data or mash_set_data_contrast.

Ulist

List containing the prior covariance matrices.

posterior_weights

Vector containing the posterior probability of each mixture component in Ulist for the data.

algorithm.version

Indicates whether to use R or Rcpp version.

A

the linear transformation matrix, Q x R matrix. This is used to compute the posterior for Ab.

output_posterior_cov

whether or not to output posterior covariance matrices for all effects.

mc.cores

The argument supplied to openmp specifying the number of cores to use. Note that this is only has an effect for the Rcpp version.

posterior_samples

the number of samples to be drawn from the posterior distribution of each effect.

seed

a random number seed to use when sampling from the posteriors. It is used when posterior_samples > 0.

Value

The return value is a list containing the following components:

PosteriorMean

J x Q matrix of posterior means.

PosteriorSD

J x Q matrix of posterior (marginal) standard deviations.

NegativeProb

J x Q matrix of posterior (marginal) probability of being negative.

ZeroProb

J x Q matrix of posterior (marginal) probability of being zero.

lfsr

J x Q matrix of local false sign rate estimates.

lfdr

J x Q matrix of local false discovery rate estimates.

PosteriorCov

Q x Q x J array of posterior covariance matrices, if the output_posterior_cov = TRUE.

PosteriorSamples

M x Q x J array of samples, if the posterior_samples = M > 0.


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