Learn R Programming

ks (version 1.6.13)

Hlscv, Hlscv.diag, hlscv: Least-squares cross-validation (LSCV) bandwidth matrix selector for multivariate data

Description

LSCV bandwidth for 1- to 6-dimensional data

Usage

Hlscv(x, Hstart, kfold=1)
Hlscv.diag(x, Hstart, binned=FALSE, bgridsize, kfold=1)
hlscv(x, binned=TRUE, bgridsize)

Arguments

x
vector or matrix of data values
Hstart
initial bandwidth matrix, used in numerical optimisation
binned
flag for binned kernel estimation
bgridsize
vector of binning grid sizes - required only if binned=TRUE
kfold
value for k-fold bandwidth selection. See details below

Value

  • LSCV bandwidth.

Details

hlscv is the univariate SCV selector of Bowman (1984) and Rudemo (1982). Hlscv is a multivariate generalisation of this.

Use Hlscv for full bandwidth matrices and Hlscv.diag for diagonal bandwidth matrices. For d = 1, 2, 3, 4 and binned=TRUE, estimates are computed over a binning grid defined by bgridsize. Otherwise it's computed exactly. If Hstart is not given then it defaults to k*var(x) where k = $\left[\frac{4}{n(d+2)}\right]^{2/(d+4)}$, n = sample size, d = dimension of data.

For large samples, k-fold bandwidth selection can significantly reduce computation time. The full data sample is partitioned into k sub-samples and a bandwidth matrix is computed for each of these sub-samples. The bandwidths are averaged and re-weighted to serve as a proxy for the full sample selector.

References

Bowman, A. (1984) An alternative method of cross-validation for the smoothing of kernel density estimates. Biometrika. 71, 353-360. Duong, T. & Hazelton, M.L. (2005) Cross-validation bandwidth matrices for multivariate kernel density estimation. Scandinavian Journal of Statistics. 32, 485-506.

Rudemo, M. (1982) Empirical choice of histograms and kernel density estimators. Scandinavian Journal of Statistics. 9, 65-78. Sain, S.R, Baggerly, K.A & Scott, D.W. (1994) Cross-validation of multivariate densities. Journal of the American Statistical Association. 82, 1131-1146.

See Also

Hbcv, Hscv

Examples

Run this code
library(MASS)
data(forbes)
Hlscv(forbes)
Hlscv.diag(forbes, binned=TRUE)
hlscv(forbes$bp)

Run the code above in your browser using DataLab