MoE_entropy function

Entropy of a fitted MoEClust model

Entropy of a fitted MoEClust model

Calculates the normalised entropy of a fitted MoEClust model.

MoE_entropy(x, group = FALSE)

Arguments

  • x: An object of class "MoEClust" generated by MoE_clust, or an object of class "MoECompare" generated by MoE_compare. Models with gating and/or expert covariates and/or a noise component are facilitated here too.
  • group: A logical (defaults to FALSE) indicating whether component-specific average entropies should be returned instead.

Returns

When group is FALSE, a single number, given by 1H1-H, in the range [0,1], such that larger values indicate clearer separation of the clusters. Otherwise, a vector of length G containing the per-component averages of the observation-specific entries is returned.

Details

When group is FALSE, this function calculates the normalised entropy via

H=1nlog(G)i=1ng=1Gz^iglog(z^ig) H=-\frac{1}{n\log(G)}\sum_{i=1}^n\sum_{g=1}^G\hat{z}_{ig}\log(\hat{z}_{ig})

, where nn and GG are the sample size and number of components, respectively, and z^ig\hat{z}_{ig} is the estimated posterior probability at convergence that observation ii belongs to component gg. Note that G=x$G for models without a noise component and G=x$G + 1 for models with a noise component.

When group is TRUE,

Hi=1log(G)g=1Gz^iglog(z^ig) H_i=-\frac{1}{\log(G)}\sum_{g=1}^G\hat{z}_{ig}\log(\hat{z}_{ig})

is computed for each observation and averaged according to the MAP classification.

Note

This function will always return a normalised entropy of 1 for models fitted using the "CEM" algorithm (see MoE_control), or models with only one component.

Examples

data(ais) res <- MoE_clust(ais[,3:7], G=3, gating= ~ BMI + sex, modelNames="EEE", network.data=ais) # Calculate the normalised entropy MoE_entropy(res) # Calculate the normalised entropy per cluster MoE_entropy(res, group=TRUE)

References

Murphy, K. and Murphy, T. B. (2020). Gaussian parsimonious clustering models with covariates and a noise component. Advances in Data Analysis and Classification, 14(2): 293-325. <tools:::Rd_expr_doi("10.1007/s11634-019-00373-8") >.

See Also

MoE_clust, MoE_control, MoE_AvePP

Author(s)

Keefe Murphy - <keefe.murphy@mu.ie >

  • Maintainer: Keefe Murphy
  • License: GPL (>= 3)
  • Last published: 2025-03-05