R/cv_bandwidth.r
cv_bandwidth.Rd
Cross-Validation function for bandwidth parameter selection of discrete kernel
cv_bandwidth(
kernel = c("optimal", "triang", "epanech", "binomial"),
v,
h,
k = NULL
)
the type of kernel. Currently supported kernels are limited to: "optimal", "triang", "epanech" and "binomial"
the vector of observations
the list of bandwidth parameters to test in cross validation
Optional: the integer (positive) parameter that defined the support of the kernel function (corresponds to parameter 'a' for triangular kernel). It is only used for optimal and triangular kernel
the optimal bandwidth value