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

Description Usage Arguments Value Examples

View source: R/mash.R

Description

Compute posterior matrices for fitted mash object on new data

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
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 May 24, 2021, 1:06 a.m.