Description Usage Arguments Value Examples
View source: R/ecos_nullmodel.R
Generate randomized matrix of counts
given the observed data matrix for a particular null model,
run ecos_fit
on these null matrices and compare the fit
on null model data with that on the observed data. Used for validating
the clustering.
1 2 3 4 5 6 7 8 9 10 | ecos_nullmodel(
counts,
K,
tol = 0.1,
null.model = c("frequency", "richness", "independentswap", "trialswap"),
iter_fill = 100,
iter_randomized = 30,
option,
plot = TRUE
)
|
counts |
The counts matrix (N x G): N- the number of samples (sites), G- number of features (bird species) |
K |
The number of clusters to fit |
tol |
The tolerance limit of the |
null.model |
The type of nullmodel used (similar to the picante::randomizeMatrix() function argument in picante package) |
iter_fill |
The number of swaps/fills in each randomized matrix build |
iter_randomized |
The number of randomization matrices generated |
plot |
If TRUE, plots density function of log Bayes factor over the randomized iterations |
Returns a list with
BF.obs |
log Bayes Factor for the observed counts with K=2 against the null with no clusters |
BF.rand |
a vector of log BF for each randomized count matrix with K=2 against the null with no clusters |
pval |
the p-value of the observed log Bayes factor against the ones from randomized matrices |
1 2 3 4 5 6 7 | data("himalayan_birds")
species_abundance_counts <- t(exprs(himalayan_birds));
out <- ecos_nullmodel(species_abundance_counts, K=2,
iter_randomized=5, option = "BF")
out2 <- ecos_nullmodel(species_abundance_counts, K=2,
iter_randomized=5, ption = "BIC")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.