View source: R/exmsilhouette.R
exmsilhouette | R Documentation |
Produces an excess mass plot and the corresponding numerical values if required.
exmsilhouette(xdata, M = 1, CutOff = 1,steps = 50,rug = TRUE, Lambda = NULL,col = FALSE,rdata = FALSE,label = TRUE)
xdata |
data in form of vector |
M |
the maximal number of modes |
CutOff |
determines the cut off value and hence the appearance of the graph |
steps |
number of different λs which are calculated / drawn |
rug |
draws a rug plot at the bottom of the graph |
Lambda |
allows to specify an own vector of λs which are drawn in the graph |
col |
lines get colored in purple (em > 0.75), green (0.75 ≥ em > 0.5), turquoise (0.5 ≥ em > 0.25), blue (0.25 ≥ em > 0.05) and black (0.05 ≥ em) |
rdata |
a numerical output is returned |
label |
allows to reduce labeling |
CutOff should not be set too small or too large, as this results in meaningless graphs. The excess mass for several λs can be calculated by specifying the Lambda.
A plot is always produced. By setting rdata=TRUE numerical results are returned in form of a two-dimensional list. The first argument specifies λ. This means that if steps=50 with 1 (50) you get access to the numerical results for the smallest (largest) λ.
In case no λ-vector is used for each λ, the following information is displayed:
[,1] |
value of λ, |
[,2] |
calculated λ-clusters |
[,3] |
excess mass vector |
The last two components are presented in the way known from the excess mass function. In case Lambda was set manually the value of λ is not returned, as it is known.
Marc-Daniel Mildenberger mildenberger.stat@web.de, based on earlier code from Dr. Guenther Sawitzki gs@statlab.uni-heidelberg.de
Muller, D. W. and Sawitzki, G., 09.1991, "Excess Mass Estimates and Tests for Multimodality", Journal of the American Statistical Association , Vol. 86, No. 415, pp. 738–746, http://www.jstor.org/stable/2290406
excessm, mexmsilhouette, exmplot
library(MASS) attach(geyser) ##Plot allowing for up to two modes and reduced CutOff value exmsilhouette(duration, M=2, CutOff=1.25) ##Plot with twice the default number of steps, omitting rug plot, ##colorizing the graph and asking for numerical output res <- exmsilhouette(duration, M=2, CutOff=1.25, steps=100, rug=FALSE, col=TRUE, rdata=TRUE) ##Specifying Lambda and requesting numerical output L=seq(.01,0.25,0.005) res <- exmsilhouette(duration, M=3, Lambda=L, col=TRUE, rdata=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.