naive: The Chernoff or 'naive' mode estimator

Description Usage Arguments Value Note References See Also Examples

View source: R/naive.R

Description

This estimator, also called the *naive* mode estimator, is defined as the center of the interval of given length containing the most observations. It is identical to Parzen's kernel mode estimator, when the kernel is chosen to be the uniform kernel.

Usage

1
naive(x, bw = 1/2)

Arguments

x

numeric. Vector of observations.

bw

numeric. The smoothing bandwidth to be used. Should belong to (0, 1). See below.

Value

A numeric vector is returned, the mode estimate, which is the center of the interval of length 2*bw containing the most observations.

Note

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

References

See Also

mlv for general mode estimation; parzen for Parzen's kernel mode estimation.

Examples

1
2
3
4
5
6
7
8
9
# Unimodal distribution
x <- rf(10000, df1 = 40, df2 = 30)

## True mode
fMode(df1 = 40, df2 = 30)

## Estimate of the mode
mean(naive(x, bw = 1/4))
mlv(x, method = "naive", bw = 1/4)

paulponcet/modeest documentation built on Nov. 19, 2019, 9:16 p.m.