meanshift: The Meanshift mode estimator

Description Usage Arguments Value Note References See Also Examples

View source: R/meanshift.R

Description

The Meanshift mode estimator.

Usage

1
2
3
4
5
6
7
8
meanshift(
  x,
  bw = NULL,
  kernel = "gaussian",
  par = shorth(x),
  iter = 1000,
  tolerance = sqrt(.Machine$double.eps)
)

Arguments

x

numeric. Vector of observations.

bw

numeric. The smoothing bandwidth to be used.

kernel

character. The kernel to be used. Available kernels are "biweight", "cosine", "eddy", "epanechnikov", "gaussian", "optcosine", "rectangular", "triangular", "uniform". See density for more details on some of these kernels.

par

numeric. The initial value used in the meanshift algorithm.

iter

numeric. Maximal number of iterations.

tolerance

numeric. Stopping criteria.

Value

meanshift returns a numeric value, the mode estimate, with an attribute "iterations". The number of iterations can be less than iter if the stopping criteria specified by eps is reached.

Note

The user should preferentially call meanshift through mlv(x, method = "meanshift", ...).

References

See Also

mlv, tsybakov.

Examples

1
2
3
4
5
6
7
8
# Unimodal distribution
x <- rweibull(100, shape = 12, scale = 0.8)

## True mode
weibullMode(shape = 12, scale = 0.8)

## Estimate of the mode
mlv(x, method = "meanshift", par = mean(x))

modeest documentation built on Nov. 18, 2019, 5:07 p.m.