dpik {KernSmooth} | R Documentation |
Use direct plug-in methodology to select the bandwidth of a kernel density estimate.
dpik(x, scalest = "minim", level = 2L, kernel = "normal", canonical = FALSE, gridsize = 401L, range.x = range(x), truncate = TRUE)
x |
vector containing the sample on which the kernel density estimate is to be constructed. |
scalest |
estimate of scale.
|
level |
number of levels of functional estimation used in the plug-in rule. |
kernel |
character string which determines the smoothing kernel.
|
canonical |
logical flag: if |
gridsize |
the number of equally-spaced points over which binning is performed to obtain kernel functional approximation. |
range.x |
vector containing the minimum and maximum values of |
truncate |
logical flag: if |
The direct plug-in approach, where unknown functionals that appear in expressions for the asymptotically optimal bandwidths are replaced by kernel estimates, is used. The normal distribution is used to provide an initial estimate.
the selected bandwidth.
This method for selecting the bandwidth of a kernel density estimate was proposed by Sheather and Jones (1991) and is described in Section 3.6 of Wand and Jones (1995).
Sheather, S. J. and Jones, M. C. (1991). A reliable data-based bandwidth selection method for kernel density estimation. Journal of the Royal Statistical Society, Series B, 53, 683–690.
Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, London.
data(geyser, package="MASS") x <- geyser$duration h <- dpik(x) est <- bkde(x, bandwidth=h) plot(est,type="l")