Learn R Programming

multimode (version 1.0)

excessmass: Excess of mass

Description

This function computes the excess of mass statistic.

Usage

excessmass(data,mod0=1)

Arguments

data

Sample for computing the excess of mass.

mod0

Number of modes for which the excess of mass is calculated. Default mod0=1.

Value

Excess of mass for mod0 modes of the sample.

Details

With excessmass, the excess of mass statistic, introduced by M<U+00FC>ller and Sawitzki (1991), for the integer number of modes specified in mod0 is computed.

If there are repeated data in the sample or the distance between different pairs of data points shows ties, a data perturbation is applied. This modification is made in order to avoid the discretization of the data which has important effects on the computation of the test statistic. The perturbed sample is obtained by adding a sample from the uniform distribution in minus/plus a half of the minimum of the positive distances between two sample points.

The NAs will be automatically removed.

References

M<U+00FC>ller, D. W. and Sawitzki, G. (1991). Excess mass estimates and tests for multimodality, The Annals of Statistics, 13, 70--84.

Examples

Run this code
# NOT RUN {
# Excess of mass statistic for one mode
set.seed(2016)
data=rnorm(50)
excessmass(data)
# }

Run the code above in your browser using DataLab