# \donttest{
N <- 100
X <- matrix(c(rnorm(N, 0, 1), rnorm(N, 3, 1)), ncol = 2, byrow = TRUE)
Y <- matrix(c(rnorm(N, 0, 1), rnorm(N, 3, 1)), ncol = 2, byrow = TRUE)
truth <- c(rep(1, N / 2), rep(2, N / 2))
data_modelled <- list(X, Y)
V <- length(data_modelled)
# MCMC parameters
R <- 5000
thin <- 50
burn <- 1000
K_max <- 10
K <- rep(K_max, V)
types <- rep("G", V)
n_chains <- 3
mcmc_out <- runMCMCChains(data_modelled, n_chains, R, thin, types, K = K)
mcmc_out <- processMCMCChains(mcmc_out, burn, construct_psm = TRUE)
psms_v1 <- list()
for (ii in seq(1, n_chains)) {
psms_v1[[ii]] <- mcmc_out[[ii]]$psms[[1]]
}
plot_df <- prepSimilarityMatricesForGGplot(psms_v1)
plot_df |>
ggplot2::ggplot(ggplot2::aes(x = x, y = y, fill = Entry)) +
ggplot2::geom_tile() +
ggplot2::facet_wrap(~Chain) +
ggplot2::scale_fill_gradient(low = "#FFFFFF", high = "#146EB4")
# }
Run the code above in your browser using DataLab