rlcv_d {rlcv}R Documentation

Robust likelihood cross validation bandwidth for multivariate kernel densities

Description

Robust likelihood cross validation bandwidth for multivariate kernel densities

Usage

rlcv_d(x.obs, x.new = NULL)

Arguments

x.obs

Training (observed) data (n1 by d matrix, d>=2)

x.new

Evaluation data (n2 by d matrix, d>=2); default to x.obs

Value

fhat: density evaluated at x.new; h: bandwidth

Author(s)

Ximing Wu xwu@tamu.edu

References

Wu, Ximing (2019), "Robust Likelihood Cross Validation for Kernel Density Estimation," Journal of Business and Economic Statistics, 37(4): 761-770.

Examples

# old faithful data
x=datasets::faithful
x=cbind(x[,1],x[,2])
fit=rlcv_d(x.obs=x)
# evaluation data
x1=seq(min(x[,1])*.8,max(x[,1])*1.2,length=30)
x2=seq(min(x[,2])*.8,max(x[,2])*1.2,length=30)
x11=rep(x1,each=30)
x22=rep(x2,30)
fhat=kde_d(x.new=cbind(x11,x22),x.obs=x,h=fit$h)
persp(x1,x2,matrix(fhat,30,30))

[Package rlcv version 1.0.0 Index]