Description Usage Arguments Details Examples
View source: R/model_fitting.R
Fit a Gaussian process to a single host series using basset
1 2 3 4 5 6 7 8 9 10 11 12 13 |
data |
a phyloseq object |
host |
host short name (e.g. ACA) |
taxa_covariance |
list of prior covariance parameters over taxa |
sample_covariance |
kernel function |
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) |
holdout_proportion |
if non-zero, proportion of host's sample to use as a test set |
return_model |
if TRUE, returns the fitted model instead of saving it |
scramble |
if TRUE, host samples are scrambled in time; this serve the diagnostic purpose of identifying whether some of the correlation we see between individual hosts' dynamics are the result of systematic differences in abundances (etc.) |
rho |
bandwidth for SE kernel |
Fitted model and metadata saved to designated model output directory.
1 2 3 4 5 6 | tax_level <- "ASV"
data <- load_data(tax_level = tax_level)
params <- formalize_parameters(data)
sample_covariance <- get_Gamma(kernel_scale = 2, proportions = c(1, 0, 0), min_correlation = 0.1, days_to_baseline = 90)
taxa_covariance <- get_Xi(phyloseq::ntaxa(data), total_variance = 1)
fit_GP(data, host = "GAB", taxa_covariance = taxa_covariance, sample_covariance = sample_covariance, tax_level = tax_level, alr_ref = params$alr_ref, MAP = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.