fitModels {benchdamic} | R Documentation |
A wrapper function that fits the specified models for each taxon of the count data and computes the mean difference (MD) and zero probability difference (ZPD) between estimated and observed values.
fitModels( counts, models = c("NB", "ZINB", "DM", "ZIG", "HURDLE"), scale_ZIG = c("default", "median"), scale_HURDLE = c("default", "median"), verbose = TRUE )
counts |
a phyloseq object or a matrix of counts with features (OTUs, ASVs, genes) by row and samples by column. |
models |
character vector which assumes the values |
scale_ZIG |
character vector, either |
scale_HURDLE |
character vector, either |
verbose |
an optional logical value. If |
list of data.frame
objects for each model. The first two
columns contain the properly transformed observed values for mean and zero
proportion, while the third and the fourth columns contain the estimated
values for the mean and the zero rate respectively.
fitNB
, fitZINB
, fitDM
,
fitZIG
, and fitHURDLE
for the model estimations,
prepareObserved
for raw counts preparation, and
meanDifferences
for the Mean Difference (MD) and Zero
Probability Difference (ZPD) computations.
# Generate some random counts counts <- matrix(rnbinom(n = 60, size = 3, prob = 0.5), nrow = 10, ncol = 6) # Estimate the counts assuming several distributions GOF <- fitModels( counts = counts, models = c( "NB", "ZINB", "DM", "ZIG", "HURDLE" ), scale_ZIG = c("median", "default"), scale_HURDLE = c("median", "default") ) head(GOF)