fit_DLM: Fit a dynamic linear model to a single host series using...

Description Usage Arguments Details Examples

View source: R/model_fitting.R

Description

Fit a dynamic linear model to a single host series using labraduck

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
fit_DLM(
  data,
  host,
  taxa_covariance,
  var_scale = 1,
  tax_level = "ASV",
  alr_ref = NULL,
  n_samples = 100,
  MAP = FALSE,
  use_covariates = TRUE,
  split_diet = FALSE
)

Arguments

data

a phyloseq object

host

host short name (e.g. ACA)

taxa_covariance

list of prior covariance parameters over taxa

var_scale

combined scale of the total variance components Sigma and Gamma (default 1)

tax_level

taxonomic level at which to agglomerate data

alr_ref

index of reference ALR coordinate

n_samples

number of posterior samples to draw

MAP

compute MAP estimate only (as single posterior sample)

use_covariates

if TRUE uses available rain, temperature, and diet data as covariates in the model

split_diet

if TRUE, splits diet PC1 into positive and negative subsets to treat as two 'environments'

Details

Fitted model and metadata saved to designated model output directory.

Examples

1
2
3
4
5
tax_level <- "ASV"
data <- load_data(tax_level = tax_level)
params <- formalize_parameters(data)
taxa_covariance <- get_Xi(phyloseq::ntaxa(data), total_variance = 1)
fit_DLM(data, host = "GAB", taxa_covariance = taxa_covariance, tax_level = tax_level, alr_ref = params$alr_ref, MAP = TRUE)

kimberlyroche/ROL documentation built on Dec. 10, 2020, 2:18 a.m.