Skip to contents

Comprehensive evaluation of model selection results, computing all relevant metrics including ARI, VAF, BIC, logLik, and selection accuracy.

Usage

evaluate_model_selection(
  list_of_data,
  true_cluster,
  K_true,
  r_true,
  select_result,
  runtime_sec = NA_real_
)

Arguments

list_of_data

A list of data matrices, each (T_i x M).

true_cluster

Integer vector of true cluster assignments.

K_true

True number of clusters.

r_true

True factor dimension.

select_result

Result from select_K_r.

runtime_sec

Runtime in seconds (optional).

Value

A list with evaluation metrics:

K_hat

Estimated number of clusters.

r_hat

Estimated factor dimension.

K_correct

Logical: K_hat == K_true.

r_correct

Logical: r_hat == r_true.

Kr_correct

Logical: both K and r correct.

ARI

Adjusted Rand Index.

VAF

Variance Accounted For.

logLik

Log-likelihood.

BIC

Bayesian Information Criterion.

runtime_sec

Runtime in seconds.

Examples

if (FALSE) { # \dontrun{
# Generate data
data <- generate_synergy_data(N = 30, K = 3, r = 3, seed = 123)

# Run model selection
start_time <- Sys.time()
select_result <- select_K_r(data$list_of_data, method = "MFA", strategy = "grid")
runtime <- as.numeric(difftime(Sys.time(), start_time, units = "secs"))

# Evaluate
eval_result <- evaluate_model_selection(
  data$list_of_data, data$true_cluster,
  K_true = 3, r_true = 3,
  select_result, runtime_sec = runtime
)
} # }