slopeHeuristic: Slope Heuristic for HDDC objects

Description Usage Arguments Details Value Examples

View source: R/hddc.R

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

1

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.

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.

Examples

1
2
3
4
5
6
# 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

HDclassif documentation built on Nov. 20, 2019, 1:07 a.m.