| parzen {modeest} | R Documentation |
Parzen's kernel mode estimator is the value maximizing the kernel density estimate.
parzen(x,
bw = NULL,
kernel = "gaussian",
biau = FALSE,
par = shorth(x),
optim.method = "BFGS",
...)
x |
numeric. Vector of observations. |
bw |
numeric. The smoothing bandwidth to be used. |
kernel |
character. The kernel to be used. Available kernels are
"biweight", "cosine", "eddy", "epanechnikov",
"gaussian", "optcosine", "rectangular", "triangular", "uniform".
See density.default for more details on some of these kernels. |
biau |
logical. If FALSE (the default), the kernel density estimate
is maximised using optim. |
par |
numeric. The initial value used in optim. |
optim.method |
character. If biau = FALSE, the method used in optim. |
... |
if biau = FALSE, further arguments to be passed to optim, or further arguments to be passed to plot.default. |
If kernel = "uniform", the naive mode estimate is returned.
parzen returns a numeric value, the mode estimate. If biau = TRUE,
the x value maximizing the density estimate is returned. Otherwise,
the optim method is used to perform maximization, and the
attributes: 'value', 'counts', 'convergence' and 'message', coming from
the optim method, are added to the result.
The user should preferentially call parzen through
mlv(x, method = "kernel", ...) or mlv(x, method = "parzen", ...).
This returns an object of class mlv.
Presently, mlv.kernel is quite slow.
Paul Poncet paulponcet@yahoo.fr
# Unimodal distribution x <- rlnorm(10000, meanlog = 3.4, sdlog = 0.2) ## True mode lnormMode(meanlog = 3.4, sdlog = 0.2) ## Estimate of the mode M <- mlv(x, method = "kernel", kernel = "gaussian", bw = 0.3, par = shorth(x)) print(M) plot(M)