Description Usage Arguments Details Value Note References See Also Examples
The Lientz mode estimator is nothing but the value minimizing the empirical Lientz function. A 'plot' and a 'print' methods are provided.
1 2 3 4 5 6 7 8 9 10 |
x |
numeric (vector of observations) or an object of class |
bw |
numeric. The smoothing bandwidth to be used. Should belong to (0, 1). Parameter 'beta' in Lientz (1970) function. |
zoom |
logical. If |
... |
if |
digits |
numeric. Number of digits to be printed. |
abc |
logical. If |
par |
numeric. The initial value used in |
optim.method |
character. If |
The Lientz function is the smallest non-negative quantity S(x,b),
where b = bw
, such that
F(x+S(x,b)) - F(x-S(x,b)) >= b.
Lientz (1970) provided a way to estimate S(x,b); this estimate is what we call the empirical Lientz function.
lientz
returns an object of class c("lientz", "function")
;
this is a function with additional attributes:
x the x
argument
bw the bw
argument
call the call which produced the result
mlv.lientz
returns a numeric value, the mode estimate.
If abc = TRUE
, the x
value minimizing the Lientz empirical
function is returned. Otherwise, the optim
method is
used to perform minimization, and the attributes: 'value', 'counts',
'convergence' and 'message', coming from the optim
method, are added to the result.
The user may call mlv.lientz
through
mlv(x, method = "lientz", ...)
.
Lientz B.P. (1969). On estimating points of local maxima and minima of density functions. Nonparametric Techniques in Statistical Inference (ed. M.L. Puri, Cambridge University Press, p.275-282.
Lientz B.P. (1970). Results on nonparametric modal intervals. SIAM J. Appl. Math., 19:356-366.
Lientz B.P. (1972). Properties of modal intervals. SIAM J. Appl. Math., 23:1-5.
mlv
for general mode estimation;
shorth
for the shorth estimate of the mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Unimodal distribution
x <- rbeta(1000,23,4)
## True mode
betaMode(23, 4)
## Lientz object
f <- lientz(x, 0.2)
print(f)
plot(f)
## Estimate of the mode
mlv(f) # optim(shorth(x), fn = f)
mlv(f, abc = TRUE) # x[which.min(f(x))]
mlv(x, method = "lientz", bw = 0.2)
# Bimodal distribution
x <- c(rnorm(1000,5,1), rnorm(1500, 22, 3))
f <- lientz(x, 0.1)
plot(f)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.