Learn R Programming

ExcessMass (version 1.0.1)

excessm: Excess Mass Function

Description

Algorithm which calculates the empirical excess mass for a given \(\lambda\) and given maximal number of modes.

Usage

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

Arguments

x

data in form of a vector

lambda

\(\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 \(\lambda\)-clusters. Line \(i\) consists of information about the \(i.-\lambda\)-cluster, where \(i \le 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 \(\le M\)

excess_mass

returns a vector with excess masses, the \(i.\) entry is the excess mass achieved with \(i\) modes

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

Run this code
# NOT RUN {
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) 
# }

Run the code above in your browser using DataLab