# Data in a matrix format
X <- matrix(c(rnorm(100, 0, 1), rnorm(100, 3, 1)), ncol = 2, byrow = TRUE)
# Batch
batch_vec <- sample(seq(1, 5), replace = TRUE, size = 100)
# Sampling parameters
R <- 100
thin <- 5
# MCMC samples and BIC vector
samples <- runBatchMix(X, R, thin, batch_vec, "MVN")
lkl_df <- getLikelihood(samples)
Run the code above in your browser using DataLab