excessm | R Documentation |
Algorithm which calculates the empirical excess mass for a given λ and given maximal number of modes.
excessm(x, lambda, M = 1, UpToM = FALSE)
x |
data in form of a vector |
lambda |
λ of interest |
M |
maximal number of modes |
UpToM |
if true, the intervals for modes up to M are returned |
intervals |
Matrix containing the empirical λ-clusters. Line i consists of information about the i.-λ-cluster, where i ≤ M. First (Second) column contains the corresponding starting (ending) sorted observation index. Third (Fourth) column the starting (ending) value. In case UpToM is true and M>1, a list is returned with the intervals for all modes ≤ M |
excess_mass |
returns a vector with excess masses, the i. entry is the excess mass achieved with i modes |
Please note that an allowance for M modes does not necessarily result in M λ-clusters. Hence, the number of intervals returned can be smaller than M. In this case a warning will be displayed. The vector excess_mass does have less than M entries.
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
exmplot, exmsilhouette, mexmsilhouette
library(MASS) attach(geyser) ##calculating excess mass for duration of 'Old Faithful Geyser' for lambda=0.2 allowing for one mode excessm(duration, lambda=0.2) ##same as above, but allowing for up to three modes excessm(duration, lambda=0.2, M=3) #returns the intervals for modes 1,2 and 3 excessm(duration, lambda=0.2, M=3, UpToM=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.