# NOT RUN {
# Unimodal distribution
x <- rbeta(1000,23,4)
## True mode
betaMode(23, 4)
# or
mlv("beta", shape1 = 23, shape2 = 4)
## Be aware of this behaviour:
mlv("norm") # returns 0, the mode of the standard normal distribution
mlv("normal") # returns 0 again, since "normal" is matched with "norm"
mlv("abnormal") # returns "abnormal", since the input vector "abrnormal"
# is not recognized as a distribution name, hence is taken as a character
# vector from which the most frequent value is requested.
## Estimate of the mode
mlv(x, method = "lientz", bw = 0.2)
mlv(x, method = "naive", bw = 1/3)
mlv(x, method = "venter", type = "shorth")
mlv(x, method = "grenander", p = 4)
mlv(x, method = "hsm")
mlv(x, method = "parzen", kernel = "gaussian")
mlv(x, method = "tsybakov", kernel = "gaussian")
mlv(x, method = "asselin", bw = 2/3)
mlv(x, method = "vieu")
mlv(x, method = "meanshift")
# }
Run the code above in your browser using DataLab