Learn R Programming

ks (version 1.7.0)

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, amise=FALSE, kfold=1)
Hlscv.diag(x, Hstart, binned=FALSE, bgridsize, amise=FALSE, 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. Default is FALSE.
bgridsize
vector of binning grid sizes
amise
flag to return the minimal LSCV value. Default is FALSE.
kfold
value for k-fold bandwidth selection. See details below.

Value

  • LSCV bandwidth. If amise=TRUE then the minimal LSCV value is returned too.

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 details about the advanced options for binned,Hstart,kfold, see Hpi.

References

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

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

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