mash_compute_posterior_matrices: Compute posterior matrices for fitted mash object on new data

View source: R/mash.R

mash_compute_posterior_matricesR Documentation

Compute posterior matrices for fitted mash object on new data

Description

Compute posterior matrices for fitted mash object on new data

Usage

mash_compute_posterior_matrices(
  g,
  data,
  pi_thresh = 1e-10,
  algorithm.version = c("Rcpp", "R"),
  A = NULL,
  output_posterior_cov = FALSE,
  posterior_samples = 0,
  seed = 123
)

Arguments

g

a mash object or the fitted_g from a mash object.

data

a set of data on which to compute the posterior matrices

pi_thresh

threshold below which mixture components are ignored in computing posterior summaries (to speed calculations by ignoring negligible components)

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

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

A list of posterior matrices

Examples

simdata = simple_sims(50,5,1)
data = mash_set_data(simdata$Bhat, simdata$Shat)
m = mash(data, cov_canonical(data))
mash_compute_posterior_matrices(m,data)


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