h.ucv: Unbiased (Least-Squares) Cross-Validation for Bandwidth...

View source: R/h.ucv.R

h.ucvR Documentation

Unbiased (Least-Squares) Cross-Validation for Bandwidth Selection

Description

Computes the unbiased (least-squares) cross-validation bandwidth selector of the r'th derivative of a kernel density estimator (one-dimensional). Returns an S4 object of class bandwidth.

Usage

h.ucv(x, deriv.order = 0L, kernel = "gaussian",
      lower, upper, tol, nthreads = 0L)

Arguments

x

numeric vector of data values.

deriv.order

non-negative integer: derivative order r. Maximum r for this selector: any for Gaussian and Silverman; cosine 1; logistic 8; Epanechnikov 1; uniform 0; triangular 0; biweight 2; triweight 3; tricube 3; pow(s,t) \min(r^*, 6), where r^* is the largest integer r < t + 1/2 (and r < s + 1/2 if s is not an even integer, and 2r \le st if s and t are integers). Above it h = NA is returned with a warning. See kedd-package, section ‘Maximum derivative order’.

kernel

character string giving the kernel; one of "gaussian" (default), "epanechnikov", "uniform", "triangular", "biweight", "triweight", "tricube", "cosine", "silverman", "logistic", or a power kernel "pow(s,t)" (see kernel.pow).

lower, upper

bounds of the search interval. Defaults to [0.01 * hos, 2 * hos] where hos is the over-smoothing bandwidth computed internally.

tol

convergence tolerance passed to optimize. Default 0.01 * lower (after validation of lower).

nthreads

number of OpenMP threads for this call: 0 (default) = all processors, k > 0 = k threads, both capped by the environment variable OMP_THREAD_LIMIT. The result does not depend on it, and it never changes the threads used by later calls.

Details

Rudemo (1982) and Bowman (1984) proposed unbiased (least-squares) cross-validation (UCV) for kernel density estimation. Härdle, Marron and Wand (1990) extended the criterion to the r'th derivative estimator. The bandwidth \hat{h}_{UCV}^{(r)} minimises:

UCV(h;r) = \frac{R\left(K^{(r)}\right)}{nh^{2r+1}} + \frac{(-1)^{r}}{n(n-1)h^{2r+1}} \sum_{i=1}^{n}\sum_{j \neq i} \Bigl(K^{(r)}\ast K^{(r)} - 2\,K^{(2r)}\Bigr) \!\left(\frac{X_j-X_i}{h}\right)

where K^{(r)}\ast K^{(r)}(x) is the convolution of the r'th derivative of the kernel (see kernel.conv, kernel.fun), and R(K^{(r)})=\int K^{(r)}(x)^2\,dx.

UCV is unbiased in the sense that E[UCV(h;r)]=MISE[\hat{f}_h^{(r)}]-R(f^{(r)}) (Scott and Terrell 1987).

The search is bounded by the over-smoothing bandwidth hos (Terrell and Scott 1985; Scott 1992, p.\,165; Wand and Jones 1995, p.\,61).

Value

An S4 object of class bandwidth with slots:

data

the (cleaned) data vector.

kernel

name of the kernel used.

deriv.order

derivative order r.

h

selected bandwidth.

min.obj

minimum UCV value.

hos

over-smoothing bandwidth (upper bound).

method

"UCV".

Author(s)

Arsalane Chouaib Guidoum acguidoum@univ-tam.dz, Amel Henider amel.henider@univ-tam.dz and Iago Giné-Vázquez iago.gin-vaz@protonmail.com

References

Bowman, A. (1984). An alternative method of cross-validation for the smoothing of density estimates. Biometrika, 71, 353–360.

Rudemo, M. (1982). Empirical choice of histograms and kernel density estimators. Scandinavian Journal of Statistics, 9, 65–78.

Scott, D. W. and Terrell, G. R. (1987). Biased and unbiased cross-validation in density estimation. Journal of the American Statistical Association, 82, 1131–1146.

Wand, M. P. and Jones, M. C. (1995). Kernel Smoothing. Chapman and Hall, London.

Härdle, W., Marron, J. S. and Wand, M. P. (1990). Bandwidth choice for density derivatives. Journal of the Royal Statistical Society, Series B, 223–232.

See Also

bandwidth, h.bcv, h.ccv, h.mcv, h.tcv, h.scv, h.amise, kernel.conv, kernel.fun, dkde.

Examples

x <- rnorm(100)

## density (r = 0)
bw0 <- h.ucv(x, deriv.order = 0)
show(bw0)
plot(bw0)

## first derivative (r = 1)
bw1 <- h.ucv(x, deriv.order = 1)
show(bw1)
## other kernels on a Marron-Wand sample
h.ucv(claw, kernel = "logistic")
h.ucv(claw, kernel = "pow(2,3)")

kedd documentation built on Nov. 12, 2026, 5:10 p.m.