Learn R Programming

fpc (version 2.1-6)

weightplots: Ordered posterior plots

Description

Ordered posterior plots for Gaussian mixture components, see Hennig (2010).

Usage

weightplots(mclustsummary, clusternumbers="all", clustercol=2,
                        allcol=grey(0.2+((1:ncol(mclustsummary$z))-1)*
                          0.6/(ncol(mclustsummary$z)-1)),
                        lty=rep(1,ncol(mclustsummary$z)),clusterlwd=3,
                        legendposition="none",
                        weightcutoff=0.01,ask=TRUE, ...)

Arguments

mclustsummary
output object from summary.mclustBIC.
clusternumbers
"all" or vector of integers. Numbers of components for which plots are drawn.
clustercol
colour used for the main components for which a plot is drawn.
allcol
colours used for respective other components in plots in which they are not main components.
lty
line types for components.
clusterlwd
numeric. Line width for main component.
legendposition
"none" or vector with two coordinates in the plot, where a legend should be printed.
weightcutoff
numeric between 0 and 1. Observations are only taken into account for which the posterior probability for the main component is larger than this.
ask
logical. If TRUE, it sets par(ask=TRUE) in the beginning and par(ask=FALSE) after all plots were showed.
...
further parameters to be passed on to legend.

Value

  • Invisible matrix of posterior probabilities z from mclustsummary.

Details

Shows posterior probabilities for observations belonging to all mixture components on the y-axis, with points ordered by posterior probability for main component.

References

Hennig, C. (2010) Methods for merging Gaussian mixture components, Advances in Data Analysis and Classification, 4, 3-34.

Examples

Run this code
data(crabs)
  dc <- crabs[,4:8]
  cm <- mclustBIC(crabs[,4:8],G=9,modelNames="EEE")
  scm <- summary(cm,crabs[,4:8])
  weightplots(scm,clusternumbers=1:3,ask=FALSE)
  weightplots(scm,clusternumbers=1:3,allcol=1:9, ask=FALSE,
              legendposition=c(5,0.7))
# Remove ask=FALSE to have time to watch the plots.

Run the code above in your browser using DataLab