vieu: Vieu's mode estimator

Description Usage Arguments Value Note References See Also Examples

View source: R/vieu.R

Description

Vieu's mode estimator is the value at which the kernel density derivative estimate is null.

Usage

1
vieu(x, bw = NULL, kernel = "gaussian", abc = FALSE, ...)

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.

abc

logical. If FALSE (the default), the root of the density derivate estimate is searched with uniroot.

...

If abc = FALSE, further arguments to be passed to uniroot.

Value

vieu returns a numeric value, the mode estimate. If abc = TRUE, the x value at which the density derivative estimate is null is returned. Otherwise, the uniroot method is used.

Note

The user may call vieu through mlv(x, method = "vieu", ...).

Presently, vieu is quite slow.

References

See Also

mlv, parzen.

Examples

1
2
3
4
5
6
7
8
# Unimodal distribution
x <- rlnorm(10000, meanlog = 3.4, sdlog = 0.2)

## True mode
lnormMode(meanlog = 3.4, sdlog = 0.2)

## Estimate of the mode
mlv(x, method = "vieu", kernel = "gaussian")

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