bw = 1/2
) or fraction sample mode (for some other bw
) by Bickel (2006).hsm(x,
bw = NULL,
k,
tie.action = "mean",
tie.limit = 0.05,
...)
k+1
observations,
is computed iteratively, until only one value is found, the mode estimate.
At each step $i$, one takes k = ceiling(bw*n) - 1
, where n
is the length of the modal interval computed at step $i-$1
.
If bw
is of class "function"
, then k = ceiling(bw(n)) - 1
instead.mlv
for general mode estimation;
venter
for the Venter mode estimate# Unimodal distribution
x <- rweibull(10000, shape = 3, scale = 0.9)
## True mode
weibullMode(shape = 3, scale = 0.9)
## Estimate of the mode
bandwidth <- function(n, alpha) {1/n^alpha}
hsm(x, bw = bandwidth, alpha = 2)
M <- mlv(x, method = "hsm", bw = bandwidth, alpha = 2)
print(M)
plot(M)
Run the code above in your browser using DataLab