BNPdensity (version 2019.9.11)

compute_optimal_clustering: Compute the optimal clustering from an MCMC sample

Description

Summaizes the posterior on all possible clusterings by an optimal clustering where optimality is defined as minimizing the posterior expectation of a specific loss function, the Variation of Information or Binder's loss function. Computation can be lengthy for large datasets, because of the large size of the space of all clusterings.

Usage

compute_optimal_clustering(fit, loss_type = "VI")

Arguments

fit

The fitted object, obtained from one of the MixNRMIx functions

loss_type

Defines the loss function to be used in the expected posterior loss minimization. Can be one of "VI" (Variation of Information), "B" (Binder's loss), "NVI" (Normalised Variation of Information) or "NID" (Normalised Information Distance). Defaults to "VI".

Value

A vector of integers with the same size as the data, indicating the allocation of each data point.