venter: The Venter / Dalenius / LMS mode estimator

Description Usage Arguments Details Value Note References See Also Examples

View source: R/venter.R

Description

This function computes the Venter mode estimator, also called the Dalenius, or LMS (Least Median Square) mode estimator.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
venter(
  x,
  bw = NULL,
  k,
  iter = 1,
  type = 1,
  tie.action = "mean",
  tie.limit = 0.05,
  warn = FALSE
)

shorth(x, ...)

Arguments

x

numeric. Vector of observations.

bw

numeric. The bandwidth to be used. Should belong to (0, 1]. See 'Details'.

k

numeric. See 'Details'.

iter

numeric. Number of iterations.

type

numeric or character. The type of Venter estimate to be computed. See 'Details'.

tie.action

character. The action to take if a tie is encountered.

tie.limit

numeric. A limit deciding whether or not a warning is given when a tie is encountered.

warn

logical. If TRUE, a warning is thrown when a tie is encountered.

...

Further arguments.

Details

The modal interval, i.e. the shortest interval among intervals containing k+1 observations, is first computed. (In dimension > 1, this question is known as a 'k-enclosing problem'.) The user should either give the bandwidth bw or the argument k, k being taken equal to ceiling(bw*n) - 1 if missing, so bw can be seen as the fraction of the observations to be considered for the shortest interval.

If type = 1, the midpoint of the modal interval is returned. If type = 2, the floor((k+1)/2)th element of the modal interval is returned. If type = 3 or type = "dalenius", the median of the modal interval is returned. If type = 4 or type = "shorth", the mean of the modal interval is returned. If type = 5 or type = "ekblom", Ekblom's L_{-infinity} estimate is returned, see Ekblom (1972). If type = 6 or type = "hsm", the half sample mode (hsm) is computed, see hsm.

Value

A numeric value is returned, the mode estimate.

Note

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

References

See Also

mlv for general mode estimation, hsm for the half sample mode.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(evd)

# Unimodal distribution
x <- rgev(1000, loc = 23, scale = 1.5, shape = 0)

## True mode
gevMode(loc = 23, scale = 1.5, shape = 0)

## Estimate of the mode
venter(x, bw = 1/3)
mlv(x, method = "venter", bw = 1/3)

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