FitInlaAll: Applies INLA to multiple data rows

FitInlaAllR Documentation

Applies INLA to multiple data rows

Description

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. PLEASE NOTE THAT FitAllShrink IS USUALLY MORE CONVENIENT WHEN SHRINKAGE PRIORS ARE USED.

Usage

FitInlaAll(forms, dat, fams = "zinb", logdisp = c(0, 0.01), precerr = c(1,10^(-5)), curvedispfun = NULL, logitp0 = c(0, 0.01), 
ncpus = 2, effoutput = TRUE, keepmargrand = FALSE, keepmarghyper = TRUE, setthreads1 = TRUE, 
showupdate = FALSE, silentINLA = 2L, updateby = 5000, ndigits = 5, addpackage = NULL, safemode = TRUE, cf=NULL, designlist=NULL, ...)

Arguments

forms

Formula, or list of formulas the length of which equals the number of data rows. See inla and f for specification of the model formula.

dat

Matrix, data frame or list containing the data. Rows are features, columns are samples. For lists: each component represents a feature.

fams

Character string. Either equal to "poisson", "zip" (zero-inflated Poisson), "nb" (negative binomial), or "zinb" (zero-inflated negative binomial), "gaussian": likelihood to be used.

logdisp

Numeric vector of length 2. Mean and precision of the Gaussian prior of log-size. Only relevant when fams = "nb" or fams = "zinb".

precerr

Numeric vector of length 2. Shape and rate of the Gamma-prior for precision of Gaussian random variables.

curvedispfun

A smoothing function that results from ShrinkSeq when run with curvedisp=TRUE. It can be accessed by object$curvedispfun where object is the result from ShrinkSeq. Only relevant when fams = "nb".

logitp0

Numeric vector of length 2. Mean and precision of the Gaussian prior of logit-p0 (zero-mass). Only relevant when fams = "zip" or fams = "zinb".

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 inla.

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

How to silence the output of inla? NOTE: currently not all INLA output can be silenced.

updateby

Integer, only relevant when showupdate=TRUE. Show an update for each updateby number of features executed.

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 fams="zinb" or fams="nb". If fitting fails, should it re-run in a safe mode?

cf

List. control.fixed argument for inla.

designlist

List. Components are data frames containting the variables in form. Length of list should equal nr of features in data. If NULL design is assumed to be the same for all features (and inferred from form)

...

Further arguments passed on to inla.

Details

See FitAllShrink

Value

res

A list of length nrow(dat) containing inla output for each data row

Note

Extensions to the supported likelihoods (including multivariate ones) may be released in the feature

Author(s)

Mark A. van de Wiel

References

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.

See Also

FitAllShrink (which is usually more convenient) and www.r-inla.org


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