# Data in matrix format
X <- matrix(c(rnorm(100, 0, 1), rnorm(100, 3, 1)), ncol = 2, byrow = TRUE)
# Observed batches represented by integers
batch_vec <- sample(seq(1, 5), size = 100, replace = TRUE)
# MCMC iterations (this is too low for real use)
R <- 100
thin <- 5
# MCMC samples
samples <- runBatchMix(X, R, thin, batch_vec, "MVN")
batch_scale_df <- getSampledBatchShift(samples$batch_scale, R = R, thin = thin)
Run the code above in your browser using DataLab