HDclassif (version 2.2.0)

slopeHeuristic: Slope Heuristic for HDDC objects

Description

This function computes the slope heuristic for a set of objects obtained by the function hddc. The slope heuristic is a criterion in which the likelihood is penalized according to the result of the fit of the likelihoods on the complexities of the models.

Usage

slopeHeuristic(x, plot = FALSE)

Value

A list of two elements:

best_model_index

The index of the best model, among all estimated models.

allCriteria

The data.frame containing all the criteria, with the new slope heuristic.

Arguments

x

An hdc object, obtained from the function hddc.

plot

Logical, default is FALSE. If TRUE, then a graph representing: 1) the likelihoods, the complexity, the fit (i.e. the slope) and 2) the value of the slope heuristic (in blue squares).

Details

This function is only useful if there are many models (at least 3, better if more) that were estimated by the function hddc. If there are less than 2 models, the function wil l return an error.

Examples

Run this code
# Clustering of the Crabs data set
data(Crabs)
prms = hddc(Crabs[,-1], K = 1:10) # we estimate ten models
slope = slopeHeuristic(prms, plot = TRUE)
plot(slope$allCriteria) # The best model is indeed for 4 clusters
prms$all_results[[slope$best_model_index]] # we extract the best model


Run the code above in your browser using DataCamp Workspace