MoE_Uncertainty {MoEClust} | R Documentation |
Plot Clustering Uncertainties
Description
Plots the clustering uncertainty for every observation from a fitted "MoEClust"
model, including models with a noise component.
Usage
MoE_Uncertainty(res,
type = c("barplot", "profile"),
truth = NULL,
decreasing = FALSE,
...)
Arguments
res |
An object of class |
type |
The type of plot to be produced (defaults to |
truth |
An optional argument giving the true classification of the data. When |
decreasing |
Logical indicating whether uncertainties should be ordered in decreasing order (defaults to |
... |
Catches unused arguments. |
Details
The y-axis of this plot runs from 0
to 1 - 1/res$G
, with a horizontal line also drawn at 1/res$G
. When type="barplot"
, uncertainties greater than this value are given a different colour when truth
is not supplied, otherwise misclassified observations are given a different colour. Note, however, that G^{(0)}
= res$G + 1
is used in place of res$G
for models with a noise component.
Value
A plot showing the clustering uncertainty of each observation (sorted in increasing/decreasing order when type="profile"
). The (unsorted) vector of uncertainties can also be returned invisibly. When truth
is supplied, the indices of the misclassified observations are also invisibly returned.
Note
plot.MoEClust
is a wrapper to MoE_Uncertainty
which accepts the default arguments, and also produces other types of plots.
An alternative means of visualising clustering uncertainties (at least for multivariate data) is provided by the functions MoE_gpairs
and plot.MoEClust
, specifically when their argument response.type
is given as "uncertainty"
.
Author(s)
Keefe Murphy - <keefe.murphy@mu.ie>
See Also
MoE_clust
, MoE_gpairs
, plot.MoEClust
Examples
data(ais)
res <- MoE_clust(ais[,3:7], gating= ~ sex, G=3, modelNames="EEE", network.data=ais)
# Produce an uncertainty barplot
MoE_Uncertainty(res)
# Produce an uncertainty profile plot
MoE_Uncertainty(res, type="profile")
# Let's assume the true clusters correspond to sex
(ub <- MoE_Uncertainty(res, truth=ais$sex))
(up <- MoE_Uncertainty(res, type="profile", truth=ais$sex))