This function allows to run the CS (Common theta and Scaled variables through lambda_j) version of the quantile-based clustering algorithm.
alg.CS(data, k = 2, eps = 1e-08, it.max = 100, B = 30, lambda = rep(1, p))A numeric vector, matrix, or data frame of observations. Categorical variables are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables.
The number of clusters. The default is k=2.
The relative convergence tolerances for objective function. The default is set to 1e-8.
A number that gives integer limits on the number of the CS algorithm iterations. By default, it is set to 100.
The number of times the initialization step is repeated; the default is 30.
The initial value for lambda_j, the variable scaling parameters. By default, lambdas are set to be equal to 1.
A list containing the following elements:
A vector whose [i]th entry is classification of observation i in the test data.
A matrix whose [h,j]th entry is the theta-quantile of variable j in cluster h.
The estimated common theta.
The values of the objective function V at each step of the algorithm.
The final value of the objective function V.
A vector containing the scaling factor for each variable.
Algorithm CS: Common theta and Scaled variables via lambda_j. A common value of theta is taken but variables are scaled through lambda_j.
Hennig, C., Viroli, C., Anderlucci, L. (2019) "Quantile-based clustering" Electronic Journal of Statistics, 13 (2) 4849-4883 <doi:10.1214/19-EJS1640>
# NOT RUN {
out <- alg.CS(iris[,-5],k=3)
out$theta
out$qq
out$lambda
table(out$cl)
# }
Run the code above in your browser using DataLab