View source: R/NonParaUpdatePrior.R
NonParaUpdatePrior | R Documentation |
This is the iterative marginal procedure, outlined in the Van de Wiel et al. (2012) reference below. It allows to replace one parametric prior by a nonparametric one, which is typically desirable for the main parameter of interest. The nonparametic prior is found by an iterative Empirical Bayes type method, which aims to maximize marginal likelihood. The nonparametric prior may contain a point mass (default)
NonParaUpdatePrior(fitall,fitall0=NULL, modus = "fixed", shrinkpara = NULL, shrinklc = NULL, lincombs=NULL, includeP0 = TRUE, unimodal = TRUE, logconcave = FALSE, symmetric = FALSE, allow2modes=TRUE, maxiter = 10, tol = 0.005, ndrawtot = 10000, ntotals = c(500, 2000, 5000, 10000), priornew = NULL, gaussinit0 = NULL, gammainit0 = NULL, p0init=0.8, p0lower = 0.5, pointmass = 0, maxsupport = 6, plotdens = TRUE, ncpus = 2)
fitall |
A 2-component list object resulting from |
fitall0 |
An optional 2-component list object resulting from |
modus |
Character string. Either |
shrinkpara |
Character or character vector. Name(s) of the variable(s) for which the nonparametric prior is fit. Corresponding variable can be a factor. |
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 |
includeP0 |
Boolean. Should the nonparametric prior contain a point mass? |
unimodal |
Boolean. Should the nonparametric prior be unimodal? |
logconcave |
Boolean. Should the nonparametric prior be log-concave? |
symmetric |
Boolean. Should the nonparametric prior be symmetric? |
allow2modes |
Boolean. Can the smooth part of the nonparametric prior contain a mode on the negative and positive half-plane? |
maxiter |
Integer. The maximum number of iterations in the iterative marginal procedure |
tol |
Numeric. Tolerance for the Kolmogorov-Smirnov distance between two succesive iterations.
If this distance is smaller than |
ndrawtot |
Integer. Total number of draws from the empirical mixture of posteriors on which the new prior is fitted. |
ntotals |
Vector of integers. Consecutive number of posteriors that are used to determine the new prior. |
priornew |
Numeric matrix or dataframe with 2 columns. Starting prior. Need not te be specified. |
gaussinit0 |
Numeric vector of length 2. Mean and precision of Gaussian starting prior. Need not to be specified. |
gammainit0 |
Numeric vector of length 2. Shape and rate of the Gamma starting prior. Need not to be specified. |
p0init |
Numeric between 0 and 1. Initial value of the mixture proportion of the point mass.
Only relevant when |
p0lower |
Numeric between 0 and 1. Lower bound for the mixture proportion of the point mass. Only relevant when |
pointmass |
Numeric. Location of the pointmass. Only relevant when |
maxsupport |
Numeric. maximum of the support of the prior and posteriors. For numerical stability. -maxsupport is the minimum of the support. |
plotdens |
Boolean. Should the consecutive nonparametric estimates be plotted on the screen? |
ncpus |
Integer. The number of cpus to use for parallel computations. |
About shrinklc
: it is assumed that only one type of linear combinations is present in the fit object fitall
.
Fitting a unimodal
prior requires the package "Iso"
, whereas a log-concave prior requires the package "logcondens"
(Lutz and Rufibach, 2011). These options may be used to increase stability of the prior, in particular for the tails.
A list with the following components:
priornew |
The (smooth) part of the nonparametric prior |
p0est |
Estimate of the point mass mixture component |
inputpar |
List of input parameters |
densall |
Consecutive fits of the nonparametric prior |
ksmaxall |
Kolmogorov-Smirnov distances between consecutive fits |
sdall |
Standard deviations for consecutive fits |
totalloglikall |
Marginal log-likelihood sums for consecutive fits |
nallforlik |
Number of elements used for computing |
notfit |
IDs of list elements of |
Mark A. van de Wiel
Lutz, D. and Rufibach, K. (2011). logcondens: Computations related to univariate log-concave density estimation. J. Statist. Software 39, 1-28.
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.
MixtureUpdatePrior
for parametric mixture priors (with point mass) and NonParaUpdatePosterior
for computing posteriors from the output of this function.
#See ShrinkSeq, ShrinkGauss and CombinePosteriors
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.