excessm: Excess Mass Function

View source: R/excessm.R

excessmR Documentation

Excess Mass Function

Description

Algorithm which calculates the empirical excess mass for a given λ and given maximal number of modes.

Usage

excessm(x, lambda, M = 1, UpToM = FALSE)

Arguments

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

Value

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

Note

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.

Author(s)

Marc-Daniel Mildenberger mildenberger.stat@web.de, based on earlier code from Dr. Guenther Sawitzki gs@statlab.uni-heidelberg.de

References

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

See Also

exmplot, exmsilhouette, mexmsilhouette

Examples

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) 

ExcessMass documentation built on June 14, 2022, 1:06 a.m.