FitAllShrink | R Documentation |
This is a wrapper function that facilitates multiple calls to INLA using parallel processing. It currently supports the following
univariate likelihoods: Poisson, negative binomial, zero-inflated negative binomial, Gaussian. It uses the output from
ShrinkSeq
or ShrinkGauss
as input for the prior parameters.
FitAllShrink(forms, dat, shrinksimul, finalprior=FALSE, dispersefixed = 10, disperseaddfixed = 1, disperserandom = 1, maxprecfixed = 4, fams = "zinb", ncpus = 2, effoutput = TRUE, keepmargrand = FALSE, keepmarghyper = TRUE, setthreads1 = TRUE, showupdate = FALSE, silentINLA = TRUE, updateby = 5000, ndigits = 5, addpackage = NULL, safemode = TRUE, designlist=NULL, ...)
forms |
Formula, or list of formulas the length of which equals the number of data rows. See |
dat |
Matrix, data frame or list containing the data. Rows are features, columns are samples. For lists: each component represents a feature. |
shrinksimul |
A list object resulting from |
finalprior |
Boolean. If TRUE, |
dispersefixed |
Numeric. Inflation factor for the variance of the main fixed parameter. |
disperseaddfixed |
Numeric. Inflation factor for the variance of the additional fixed parameter. |
disperserandom |
Numeric. Inflation factor for the variance of the random effects precision. |
maxprecfixed |
Numeric. Maximum precision used for the main fixed effect. |
fams |
Character string. Either equal to |
ncpus |
Integer. The number of cpus to use for parallel computations. |
effoutput |
Boolean. If FALSE, all INLA output will be saved. If TRUE, some fields will be deleted. |
keepmargrand |
Boolean. Do you wish to save the marginals of the random effect regression parameters (beta's)? |
keepmarghyper |
Boolean. Do you wish to save the marginals of the hyper-parameters? |
setthreads1 |
Boolean. If TRUE, sequential computation is forced within each call to |
showupdate |
Boolean. Do you wish to see updates on progression of the computation? TRUE may slow down the computations due to less efficient parallel computation. |
silentINLA |
Boolean. Do you wish to silence the output of |
updateby |
Integer, only relevant when showupdate=TRUE. Show an update for each |
ndigits |
Integer. Numerical precision in digits for the output. |
addpackage |
Character string. Additional package that you wish to export to slave nodes when parallel computing. |
safemode |
Boolean. Only relevant for |
designlist |
List. Components are data frames containting the variables in |
... |
Further arguments passed on to |
dispersefixed
, disperseaddfixed
and disperserandom
can be used to fit under a flatter prior than the one found by the joint shrinkage procedures
ShrinkSeq
or ShrinkGauss
. This is typically useful when one aims to empirically fit
a mixture prior or nonparametric prior for the main fixed or random parameter (see MixtureUpdatePrior
or
NonParaUpdatePrior
). finalprior=FALSE
should be used in combination with MixtureUpdatePrior
or
NonParaUpdatePrior
, while finalprior=TRUE
should be used in combination with
BFUpdatePosterior
or SpikeSlabUpdatePosterior
, because the latter two functions do
not further update the prior.
About setthreads1
: usually it is computationally most efficient to use only one node (thread) per INLA call. About
addpackage
: sometimes the formula contains a call to an external package (e.g. for fitting splines). If so, this package needs to be specified for
exporting to slave nodes when computing parallelly. About safemode
: if TRUE, then features for which fitting fails when the size parameter of the NB
or ZI-NB are estimated are re-fitted with fixed size parameter, which equals the prior mean.
Two-component list object.
res |
A list of length |
priors |
A list passing through all information on priors present in |
Extensions to the supported likelihoods (including multivariate ones) may be released in the feature
Mark A. van de Wiel
Rue H, Martino S and Chopin N (2009). Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations (with discussion). J. R. Statist. Soc. B, 71, 319-392. www.r-inla.org
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.
www.r-inla.org, ShrinkSeq
, ShrinkGauss
#See ShrinkSeq, ShrinkGauss and CombinePosteriors
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.