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) vector of integer values (usually, the number of clusters from 1 to G)

y

Numeric (m x 1) vector of values (usually, the criterion values) associated with the number of groups.

Plot

Logical value (TRUE or FALSE). If Plot = TRUE a plot of the relationship between x and y is produced. The plot is a scatterplot with connecting lines. A vertical line is depicted in correspondence of the optimal value of x.

Value

Returns the following outputs:

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)



[Package SCDA version 0.0.2 Index]