micore: Run Microbiome Covariance Regression

Description Usage Arguments Details Value Examples

View source: R/micore.R

Description

Run Microbiome Covariance Regression

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
micore(
  counts,
  X,
  C0 = NULL,
  Psi0 = NULL,
  Gamma0 = NULL,
  nuPsi = NULL,
  nuGamma = NULL,
  n.chain = 4,
  n.cores = n.chain,
  target.accept.rate = 0.23,
  n.samp = 4000,
  n.burn = 4000,
  adapt.control = NULL,
  save.eta.cov = FALSE,
  verbose = FALSE
)

Arguments

counts

Matrix containing OTU counts. Rows are samples, columns are OTUs. The last column is considered the reference OTU for the additive log-ratio transformation and is not included in the covariance matrix.

X

Design matrix contating covariates of interest. Rows are samples, columns are covariates. Can include intercept column.

C0

Prior mean for "C" parameter. If null, then C0 is set automatically.

Psi0

Prior inverse-Wishart matrix hyperparameter for "Psi" parameter. If null, then Psi0 is set automatically.

Gamma0

Prior inverse-Wishart matrix hyperparameter for "Gamma" parameter. If null, then Gamma0 is set automatically.

nuPsi

Prior inverse-Wishart degrees of freedom for "Psi" parameter. If null, then nuPsi is set automatically.

nuGamma

Prior inverse-Wishart degrees of freedom for "Gamma" parameter. If null, then nuGamma is set automatically.

n.chain

Number of independent MCMC chains to run in parallel

n.cores

Number of cores to use to parallelize the MCMC chains

target.accept.rate

Target acceptance rate for adaptive Metropolis sampler.

n.samp

Number of MCMC samples

n.burn

Number of burn-in samples

adapt.control

List contatining tuning parameters for adaptive MCMC part. See details section below.

save.eta.cov

Logical. Save the proposal distribution variance from the Metropolis sampler? Caution, this will be large.

verbose

Logical. Output progress?

Details

This function allows running the Microbiome Covariance Regession method on multiple chains in parallel. The user can specify values for the hyperparameters C0, Psi0, Gamma0, nuPsi, and nuGamma. If they are not specified, then they will be set automatically.

A list of arguments passed to the adaptive Metropolis sampler for eta can be input using the adapt.control argument. These can be modified if the eta parameters do not converge; the default values are not always optimal. The parameters (and defaults) that can be edited are:

Value

An object of class micore containing one list element for each MCMC chain. Each list element contains the following attributes:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n <- 50
p <- 5
X <- cbind(1, rnorm(n))
counts <- matrix(0, n, p+1)
for (i in 1:n) {
  counts[i,] <- rmultinom(1, size=100, prob=rep(1,p+1))
}

library(micore)
mc.fit <- micore(counts, X, n.samp=100, n.burn=100, n.chain=1)

kevinmcgregor/micore documentation built on June 9, 2021, 10:29 p.m.