View source: R/posterior_predict.R
posterior_predict.paramedic | R Documentation |
Predict concentrations (and efficiencies, if applicable),
absolute abundances, and relative abundances based on the posterior
distributions from a previously fitted model resulting from a call to
run_paramedic
.
## S3 method for class 'paramedic'
posterior_predict(
object,
W = NULL,
V = NULL,
X = V[, 1, drop = FALSE],
draws = NULL,
alpha_sigma = 2,
kappa_sigma = 1,
use_post_e = TRUE,
alpha_phi = 0,
beta_phi = 0,
k = 0,
sigma_xi = 1,
...
)
object |
An object of class |
W |
The new relative abundance data, e.g., from broad range 16S sequencing with "universal" primers. Expects data (e.g., matrix, data.frame, tibble) with sample identifiers in the first column. Sample identifiers must be the same between W and V, and the column must have the same name in W and V. |
V |
The new absolute abundance data, e.g., from taxon-specific absolute primers. Expects data (e.g., matrix, data.frame, tibble) with sample identifiers in the first column. Sample identifiers must be the same between W and V, and the column must have the same name in W and V. |
X |
The new covariate data. Expects data (e.g., matrix, data.frame, tibble) with sample identifiers in the first column. Sample identifiers must be the same between W, V, and X, and the column must have the same name in W, V, and X. If X only consists of the subject identifiers, then no covariates are used. |
draws |
the number of draws to return. The default and maximum number of draws is the size of the posterior sample. |
alpha_sigma |
Hyperparameter specifying the shape parameter of the
prior distribution on |
kappa_sigma |
Hyperparameter specifying the scale parameter of the
prior distribution on |
use_post_e |
A logical flag determining whether or not posterior samples
of |
alpha_phi |
Hyperparameter specifying the shape parameter of the
prior distribution on |
beta_phi |
Hyperparameter specifying the rate parameter of the prior
distribution on |
k |
the number of batches that the relative abundance data W were analyzed in. If k = 0 (the default), then batch effects are not considered. (currently not used) |
sigma_xi |
Hyperparameters specifying the variance of efficiencies
over batches. Only used if |
... |
Ignored |
A list of draws
by ncol(W)
matrices (for taxon-level
parameters) or draws
by nrow(W)
by ncol(W)
arrays
(for individual-level parameters and data) of simulations from the
posterior predictive distribution. Each row of the matrices, and each
of the first dimension of the arrays, denotes the predictions generated
using a single draw of the model parameters from the posterior distribution.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.