View source: R/Plotting_Functions.R
| MoE_Uncertainty | R Documentation |
Plots the clustering uncertainty for every observation from a fitted "MoEClust" model, including models with a noise component.
MoE_Uncertainty(res,
type = c("barplot", "profile"),
truth = NULL,
decreasing = FALSE,
col = c("cluster", "uncertain", "none"),
rug1d = TRUE,
...)
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 |
A logical indicating whether uncertainties should be ordered in decreasing order (defaults to |
col |
Only relevant when |
rug1d |
A logical which is relevant only when |
... |
Catches unused arguments. |
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.
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.
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".
Keefe Murphy - <keefe.murphy@mu.ie>
MoE_clust, MoE_gpairs, plot.MoEClust
data(ais)
res <- MoE_clust(ais[,3:7], gating= ~ sex, G=3, modelNames="EEE", network.data=ais)
# Produce an uncertainty barplot
MoE_Uncertainty(res)
# Change the colour scheme
MoE_Uncertainty(res, col="uncertain")
# 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))
# Examine the effect of rug1d for univariate models
mod <- MoE_clust(CO2data$CO2, expert=~GNP, G=2, modelNames="V", network.data=CO2data)
MoE_Uncertainty(mod, rug1d=FALSE)
MoE_Uncertainty(mod)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.