Skip to contents

Creates a low-dimensional embedding (UMAP or PCA) to visualize cluster separability. Each point represents a subject, colored by true cluster assignment.

Usage

plot_cluster_embedding(sim, fit = NULL, method = "umap", theme_base_size = 14)

Arguments

sim

A list returned by simulate_dynamic_synergy_data(). Must contain X_list and z_true components.

fit

Optional fitted model object (e.g., from MFA/MPCA). If provided, predicted cluster assignments can be overlaid. Default is NULL.

method

Character string specifying the embedding method: "umap" or "pca". Default is "umap".

theme_base_size

Base font size for the plot theme. Default is 14.

Value

A ggplot object showing low-dimensional embedding of subjects.

Examples

if (FALSE) { # \dontrun{
sim <- simulate_dynamic_synergy_data(N=30, K=3, r=3, M=8, T_each=200)
plot_cluster_embedding(sim, method = "umap")
plot_cluster_embedding(sim, method = "pca")
} # }