Rule of thumb bandwidth selectors for Gaussian kernels as described by Scott (1992) and Silverman (1986).
bw.silv(x, na.rm = FALSE)bw.scott(x, na.rm = FALSE)
numeric matrix or data.frame.
a logical value indicating whether NA
values should
be stripped before the computation proceeds.
Scott's (1992) rule is defined as
$$ H = n^{-2/(m+4)} \hat\Sigma $$
Silverman's (1986; see Chacon, Duong and Wand, 2011) rule is defined as
$$ H = \left(\frac{4}{n(m+2)}\right)^{2/(m+4)} \hat\Sigma $$
where \(m\) is number of variables, \(n\) is sample size, \(\hat\Sigma\)
is the empirical covariance matrix. The bandwidth is returned as a covariance matrix,
so to use it for a product kernel, take square root of it's diagonal: sqrt(diag(H))
.
bw.silv
corresponds to Hns
method with deriv.order=0
from the
ks package.
Silverman, B.W. (1986). Density estimation for statistics and data analysis. Chapman and Hall/CRC.
Wand, M.P. and Jones, M.C. (1995). Kernel smoothing. Chapman and Hall/CRC.
Scott, D.W. (1992). Multivariate density estimation: theory, practice, and visualization. John Wiley & Sons.
Chacon J.E., Duong, T. and Wand, M.P. (2011). Asymptotics for general multivariate kernel density derivative estimators. Statistica Sinica, 21, 807-840.
Epanechnikov, V.A. (1969). Non-parametric estimation of a multivariate probability density. Theory of Probability & Its Applications, 14(1): 153-158.
bandwidth