powered by
Likelihood cross validation bandwidth for univariate densities
lcv(x.obs, x.new = NULL)
Training (observed) data
Evaluation data; default to x.obs
fhat: density evaluated at x.new; h: bandwidth
Wu, Ximing (2019), "Robust Likelihood Cross Validation for Kernel Density Estimation," Journal of Business and Economic Statistics, 37(4): 761-770.
# NOT RUN { x=rt(200,df=5) x.new=seq(-5,5,length=100) fit=lcv(x.obs=x,x.new=x.new) # Mean squared errors f0=dt(x.new,df=5) mean((f0-fit$fhat)^2) matplot(x.new,cbind(f0,fit$fhat),type='l') # }
Run the code above in your browser using DataLab