SummaryWrap: Convenience function to compute either posterior...

View source: R/SummaryWrap.R

SummaryWrapR Documentation

Convenience function to compute either posterior null-probabilities (lfdr) or posterior means

Description

This function allows one to summarize the final posteriors. It also serves as input for the computation of Bayesian False Discovery Rate ( see BFDR).

Usage

SummaryWrap(posteriorlist, thr = 0, ncpus = 1, updateby = 10000, summary = "lfdr", direction = "two-sided", pointmass=0)

Arguments

posteriorlist

A list of lists where each sublist contains posteriors of (possibly) multiple parameters (or linear combinations) from the same data. A posterior is represented as a matrix with two columns denoting support and posterior density.

thr

Numeric. Threshold thr for the null-probability to compute. It demarcates the null-domain from the alternative domain. Only relevant when summary="lfdr"

ncpus

Integer. The number of cpus to use for parallel computations.

updateby

Integer. Show an update for each updateby number of posteriors executed.

summary

Character string. Use summary="lfdr" to obtain posterior null-probabilities (lfdrs), summary="postmean" to compute posterior means and summary="postpi0" to obtain (joint) posterior point null-probability (may equal lfdr when direction="equal" is used)

direction

Character string. Use direction="greater" if the null-hypothesis if of the form “parameter >= thr”, direction="lesser" if the null-hypothesis if of the form “parameter <= thr”, use direction="two-sided" if the null-hypothesis is of the form “parameter = thr”, use direction="equal" for multi-parameter inference.

pointmass

Numeric. Location of the pointmass. Only relevant when the components of posteriorlist contain a point mass

Details

About posteriorlist: this usually results from NonParaUpdatePosterior, MixtureUpdatePosterior, BFUpdatePosterior or SpikeSlabUpdatePosterior. It may either contain only continous posteriors or a mix of those with a point mass (usually at 0 to force selection properties). Please note that posterior null-probabilities can be interpreted as (a Bayesian version) of local false discovery rates (lfdr), hence these are obtained when setting summary="lfdr". These lfdrs serve as inpute for computing Bayesian False Discovery Rates, see BFDR.

We recommend to use direction="equal" only for Bayes factor type inference (for comparing nested models that differ by more than one parameter). If point null inference is desired for a single parameter, we recommend to use both direction="greater" and direction="lesser" as outlined in the examples.

Value

Numerical matrix. The number of rows equals the length of posteriorlist, the number of columns equals the number of posteriors in each sublist.

Note

Functionality may be extended in the future

Author(s)

Mark A. van de Wiel

References

Van de Wiel MA, Leday GGR, Pardo L, Rue H, Van der Vaart AW, Van Wieringen WN (2012). Bayesian analysis of RNA sequencing data by estimating multiple shrinkage priors. Biostatistics.

Efron B, Tibshirani R, Storey JD and Tusher V. (2001). Empirical bayes analysis of a microarray experiment. J. Amer. Statist. Assoc. 96, 1151-1160.

See Also

SummaryTable, NonParaUpdatePosterior, MixtureUpdatePosterior and BFDR.

Examples

#See ShrinkSeq, ShrinkGauss and CombinePosteriors

markvdwiel/ShrinkBayes documentation built on March 27, 2022, 7:47 p.m.