library(UniversalCVI)
# The data is from Wiroonsri (2024).
x = R1_data[,1:2]
# ---- FCM algorithm ----
# Compute the HF index
FCM.HF = HF.IDX(scale(x), cmax = 15, cmin = 2, method = "FCM",
fzm = 2, nstart = 20, iter = 100)
print(FCM.HF)
# The optimal number of cluster
FCM.HF[which.min(FCM.HF$HF),]
# ---- EM algorithm ----
# Compute the HF index
EM.HF = HF.IDX(scale(x), cmax = 15, cmin = 2, method = "EM",
nstart = 20, iter = 100)
print(EM.HF)
# The optimal number of cluster
EM.HF[which.min(EM.HF$HF),]
Run the code above in your browser using DataLab