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