Hlscv, Hlscv.diag {ks}R Documentation

Least-squares cross-validation (LSCV) bandwidth matrix selector for multivariate data

Description

LSCV bandwidth matrix for 2- to 6-dimensional data

Usage

Hlscv(x, Hstart)
Hlscv.diag(x, Hstart, binned=FALSE, bgridsize)

Arguments

x 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

Details

Use Hlscv for full bandwidth matrices and Hlscv.diag for diagonal bandwidth matrices.

For d = 1, 2, 3, 4 and binned=TRUE, the density estimate is 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 = 4/(n*(d + 2))^(2/(d+ 4)), n = sample size, d = dimension of data.

Value

LSCV bandwidth matrix.

References

Sain, S.R, Baggerly, K.A & Scott, D.W. (1994) Cross-validation of multivariate densities. Journal of the American Statistical Association. 82, 1131-1146.

Duong, T. & Hazelton, M.L. (2005) Cross-validation bandwidth matrices for multivariate kernel density estimation. Scandinavian Journal of Statistics. 32, 485-506.

See Also

Hbcv, Hscv

Examples

mus <- rbind(c(-1/2,0), c(1/2,0))
Sigmas <- rbind(diag(c(1/16, 1)), rbind(c(1/8, 1/16), c(1/16, 1/8)))
props <- c(2/3, 1/3)
x <- rmvnorm.mixt(1000, mus, Sigmas, props)
Hlscv(x)
Hlscv.diag(x)
Hlscv.diag(x, binned=TRUE)

[Package ks version 1.4.9 Index]