#==== ICV bandwidth selection rule ==== # Savchuk, O. Y., Hart, J. D., Sheather, S. J. (2010) # Indirect cross-validation for density estimation. # J. Amer. Statist. Assoc. 105, no. 489, 415–423. source("bw_icv.r") x <- c(rnorm(50),1+rnorm(50)) #computing the ICV bandwidth using a fast-speed procedure (R and C) #prerequisite: R CMD SHLIB bw_icv.c dyn.load(paste("bw_icv", .Platform$dynlib.ext, sep="")) bandw <- bw.icv(x) #computing the ICV bandwidth using a slow-speed procedure (only R) bandw2 <- bw.icv.slow(x)