Learn R Programming

kedd (version 1.0.2)

h.bcv: Biased Cross-Validation for Bandwidth Selection

Description

The (S3) generic function h.bcv computes the biased cross-validation bandwidth selector of r'th derivative of kernel density estimator one-dimensional.

Usage

h.bcv(x, ...)
## S3 method for class 'default':
h.bcv(x, whichbcv = 1, deriv.order = 0, lower = 0.1 * hos, upper = 2 * hos, 
         tol = 0.1 * lower, kernel = c("gaussian","epanechnikov",
         "triweight","tricube","biweight","cosine"), ...)

Arguments

x
vector of data values.
whichbcv
method selected, 1 = BCV1 or 2 = BCV2, see details.
deriv.order
derivative order (scalar).
lower, upper
range over which to minimize. The default is almost always satisfactory. hos (Over-smoothing) is calculated internally from an kernel, see details.
tol
the convergence tolerance for optimize.
kernel
a character string giving the smoothing kernel to be used, with default "gaussian".
...
further arguments for (non-default) methods.

Value

  • xdata points - same as input.
  • data.namethe deparsed name of the x argument.
  • nthe sample size after elimination of missing values.
  • kernelname of kernel to use
  • deriv.orderthe derivative order to use.
  • whichbcvmethod selected.
  • hvalue of bandwidth parameter.
  • min.bcvthe minimal BCV value.

newcommand

\CRANpkg

href

http://CRAN.R-project.org/package=#1

pkg

#1

Details

h.bcv biased cross-validation implements for choosing the bandwidth $h$ of a r'th derivative kernel density estimator. if whichbcv = 1 then BCV1 is selected (Scott and George 1987), and if whichbcv = 2 used BCV2 (Jones and Kappenman 1991). Scott and George (1987) suggest a method which has as its immediate target the AMISE (e.g. Silverman 1986, section 3.3). We denote $\hat{\theta}_{r}(h)$ and $\bar{\theta}_{r}(h)$ (Peter and Marron 1987, Jones and Kappenman 1991) by: $$\hat{\theta}_{r}(h)= \frac{(-1)^{r}}{n(n-1)h^{2r+1}} \sum_{i=1}^{n} \sum_{j=1;j \neq i}^{n} K^{(r)} \ast K^{(r)} \left(\frac{X_{j}-X_{i}}{h}\right)$$ and $$\bar{\theta}_{r}(h)= \frac{(-1)^r}{n(n-1) h^{2r+1}} \sum_{i=1}^{n} \sum_{j=1;j \neq i}^{n} K^{(2r)} \left(\frac{X_{j}-X_{i}}{h}\right)$$ Scott and George (1987) proposed using $\hat{\theta}_{r}(h)$ to estimate $f^{(r)}(x)$. Thus, $\hat{h}^{(r)}_{BCV1}$, say, is the $h$ that minimises: $$BCV1(h;r)= \frac{R\left(K^{(r)}\right)}{nh^{2r+1}} + \frac{1}{4} \mu_{2}^{2}(K) h^{4} \hat{\theta}_{r+2}(h)$$ and we define $\hat{h}^{(r)}_{BCV2}$ as the minimiser of (Jones and Kappenman 1991): $$BCV2(h;r)= \frac{R\left(K^{(r)}\right)}{nh^{2r+1}} + \frac{1}{4} \mu_{2}^{2}(K) h^{4} \bar{\theta}_{r+2}(h)$$ where $K^{(r)} \ast K^{(r)} (x)$ is the convolution of the r'th derivative kernel function $K^{(r)}(x)$ (see kernel.conv and kernel.fun); $R\left(K^{(r)}\right) = \int_{R} K^{(r)}(x)^{2} dx$ and $\mu_{2}(K) = \int_{R}x^{2} K(x) dx$. The range over which to minimize is hos Oversmoothing bandwidth, the default is almost always satisfactory. See George and Scott (1985), George (1990), Scott (1992, pp 165), Wand and Jones (1995, pp 61).

References

Jones, M. C. and Kappenman, R. F. (1991). On a class of kernel density estimate bandwidth selectors. Scandinavian Journal of Statistics, 19, 337--349. Jones, M. C., Marron, J. S. and Sheather,S. J. (1996). A brief survey of bandwidth selection for density estimation. Journal of the American Statistical Association, 91, 401--407. Peter, H. and Marron, J.S. (1987). Estimation of integrated squared density derivatives. Statistics and Probability Letters, 6, 109--115. Scott, D.W. and George, R. T. (1987). Biased and unbiased cross-validation in density estimation. Journal of the American Statistical Association, 82, 1131--1146. Sheather,S. J. (2004). Density estimation. Statistical Science, 19, 588--597. Tarn, D. (2007). ks: Kernel density estimation and kernel discriminant analysis for multivariate data in R. Journal of Statistical Software, 21(7), 1--16. Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, London. Wolfgang, H. (1991). Smoothing Techniques, With Implementation in S. Springer-Verlag, New York.

See Also

plot.h.bcv, see bw.bcv in package stats and bcv in package MASS for Gaussian kernel only if deriv.order = 0, Hbcv for bivariate data in package ks for Gaussian kernel only if deriv.order = 0, kdeb in package locfit if deriv.order = 0.

Examples

Run this code
## EXAMPLE 1:

x <- rnorm(100)
h.bcv(x,whichbcv = 1, deriv.order = 0)
h.bcv(x,whichbcv = 2, deriv.order = 0)

## EXAMPLE 2:

## Derivative order = 0

h.bcv(kurtotic,deriv.order = 0)

## Derivative order = 1

h.bcv(kurtotic,deriv.order = 1)

Run the code above in your browser using DataLab