MixtureUpdatePrior: Replacing a non-mixture prior by an optimal, symmetric...

View source: R/MixtureUpdatePrior.R

MixtureUpdatePriorR Documentation

Replacing a non-mixture prior by an optimal, symmetric mixture prior

Description

This is the direct maximization procedure, outlined in the Van de Wiel et al. (2012) reference below. It allows to replace one non-mixture prior by a symmetric mixture prior, which may be desirable for the main parameter of interest.

Usage

MixtureUpdatePrior(fitall,fitall0=NULL, shrinkpara=NULL, modus="mixt", shrinklc=NULL,  lincombs=NULL,ntotal = 10000, maxsupport=6,pointmass=0,
pminvec = c(0,0.25,0.5,0.75,1),p0vec = c(0.5,0.7,0.9,0.95,0.99,0.999,1), 
meanvec = c(0.1, 0.3, 0.5, 0.75,1.5),sdvec=c(0.2,0.5,0.8,1.5,3),meansdauto=TRUE,
ncpus=2,refinegrid=TRUE,symmetric=FALSE)

Arguments

fitall

A 2-component list object resulting from FitAllShrink or from CombinePosteriors

fitall0

An optional 2-component list object resulting from FitAllShrink containing the fits under the null-model.

shrinkpara

Character or character string. Name(s) of the variable(s) for which the mixture prior is fit. Corresponding variable can be a factor.

modus

Character string. Parametric form of the continuous component. Either "mixt", "gauss" or "laplace" for 2-component Gaussian mixture, Gaussian, and Laplace, respectively.

shrinklc

Character string. Name of the linear combination for which the nonparametric prior is fit.

lincombs

List object. Name of the list object that contains the linear combination(s), usually created by inla.make.lincomb or AllComp. Only required when fitall does not consist of INLA outputs, e.g. after CombinePosteriors.

ntotal

Integer. Number of posteriors that are used to determine the new prior.

maxsupport

Numeric. maximum of the support of the prior and posteriors. For numerical stability. -maxsupport is the minimum of the support.

pointmass

Numeric. Location of the pointmass.

pminvec

Numerical vector. Grid values for probability mass on the negative component with respect to the continuous component. Only relevant for modus="mixt".

p0vec

Numerical vector. Grid values for probability mass on the point mass.

meanvec

Numerical vector. Grid values for mean of the continous component.

sdvec

Numerical vector. Grid values for standard deviatioon of the continous component.

meansdauto

Boolean. If TRUE: automatically computes initial grid for meanvec and sdvec. Overrules setting for those two parameters.

ncpus

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

refinegrid

Boolean. If TRUE: automatically refines grid for parameters once the initial optimal values are found.

symmetric

Boolean. If TRUE: forces a symmetrix prior. Only relevant for mixture priors

Details

This function corresponds to the direct maximization procedure in Van de Wiel et al. (2012). The procedure is currently only implemented for fixed regression parameters or functions thereof. Also, only symmetric priors are currently supported. About shrinklc: it is assumed that only one type of linear combinations is present in the fit object fitall.

Value

A list with two components

allparam

Numerical matrix with rows ordered according to log marginal likelihood, containing parameter values of the mixture prior and log marginal likelihood

inputpar

List with input parameters used

Note

Computing time increases proportionally with the product of the length of the parameters p0vec, meanvec, sdvec and of p0widevec, sdwidevec if addwide=TRUE. After a first run, it may be good to do a second one on a finer grid.

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.

See Also

NonParaUpdatePrior for non-parametric priors and MixtureUpdatePosterior for computing posteriors from the output of this function.


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