Elbow_finder {SCDA} | R Documentation |
Automatically selects the optimal number of clusters based on elbow criterion.
Description
Automatically selects the optimal number of clusters (X-axis) based on elbow criterion computed on a metric (Y-axis). Potential metrics are the AIC and the BIC. The function can be applied to any other context in which the objective is to find the optimal X producing an elbow in Y.
Usage
Elbow_finder(x, y, Plot = TRUE)
Arguments
x |
Numeric (m x 1) |
y |
Numeric (m x 1) |
Plot |
|
Value
Returns the following outputs:
x_max_dist: optimal value of x (i.e., the x satisfying the elbow rule)
y_max_dist: optimal value of y (i.e., the y satisfying the elbow rule)
Scatterplot (non-compulsory) of x and y with connecting lines and vertical line in correspondence of the optimal value of x.
Examples
## Compute the Elbow criterion on two generic vectors x and y
x <- 1:10
y <- c(10,9,6,5,4,3,2,1,1,1)
Elbow_finder(x,y,Plot = TRUE)