if (FALSE) {
# Simulate data
m <- 100 # taxa
n <- 50 # samples
W <- matrix(rpois(m*n, 100), m, n)
# Auto-select method (uses NLopt for speed)
result <- bmdd(W, type = "count")
# Access results
head(result$beta) # Posterior parameters
head(result$gamma) # Bimodality indicators
result$method # Shows which method was used
# Force specific method
result_nlopt <- bmdd(W, method = "nlopt") # Force NLopt
result_r <- bmdd(W, method = "R") # Force R
# With covariates (automatically uses R)
Z <- matrix(rnorm(m * 2), m, 2)
result_cov <- bmdd(W, Z = Z, alp.eta = TRUE)
}
Run the code above in your browser using DataLab