MoE_Similarity: Plot the Similarity Matrix of a MoEClust Mixture Model

View source: R/Plotting_Functions.R

MoE_SimilarityR Documentation

Plot the Similarity Matrix of a MoEClust Mixture Model

Description

Produces a heatmap of the similarity matrix constructed from the res$z matrix at convergence of a MoEClust mixture model.

Usage

MoE_Similarity(res,
               col = grDevices::heat.colors(30L, rev=TRUE), 
               reorder = TRUE, 
               legend = TRUE,
               ...)

Arguments

res

An object of class "MoEClust" generated by MoE_clust, or an object of class "MoECompare" generated by MoE_compare. Models with a noise component are facilitated here too.

col

A vector of colours as per image. Will be checked for validity.

reorder

A logical (defaults to TRUE) indicating whether observations should be reordered for visual clarity.

legend

A logical (defaults to TRUE) indicating whether to append a colour key legend.

...

Catches unused arguments, or arguments to be passed to hclust when reorder=TRUE.

Value

The similarity matrix in the form of a heatmap is plotted; the matrix itself can also be returned invisibly. The invisibly returned matrix will also be reordered if reordered=TRUE.

Note

plot.MoEClust is a wrapper to MoE_Similarity which accepts the default arguments, and also produces other types of plots.

Author(s)

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

See Also

MoE_clust, plot.MoEClust,

Examples

data(ais)
mod <- MoE_clust(ais[,3:7], G=2, modelNames="EEE", gating= ~ SSF + Ht,
                 expert= ~ sex, network.data=ais, tau0=0.1, noise.gate=FALSE)
sim <- MoE_Similarity(mod)

MoEClust documentation built on May 29, 2024, 6:44 a.m.