| bcv_criterion | R Documentation |
Three data-driven criteria for the smoothing parameter of a quantile density
estimator, written as functions of m = 1/h so that they can be passed
to [stats::optimize()]. Each is evaluated on the grid u_i = i/n with
spacings \Delta_i = X_{(i)} - X_{(i-1)}, X_{(0)} = 0, so that
\sum_i \Delta_i\, \phi(\hat q(u_i)) approximates \int \phi\{1/\hat g(x)\}\,dx.
* 'bcv_criterion()' is the biased (least-squares) cross-validation used by Chaubey, Dewan and Li (2024) and Doosti, Dewan and Talebian (2025):
\mathrm{BCV}(h) = \sum_i \Delta_i\, \hat q(u_i;h)^{-2} - \frac{2}{n}\sum_i \hat q_{-i}(u_i;h)^{-1},
i.e. the classical \int \hat g^2 - 2\,\bar{\hat g}_{-i} written in
terms of \hat q = 1/\hat g. (Equation (11) of Doosti, Dewan and
Talebian (2025) prints \hat q^2 in the first term; the simulation
code, reproduced here, uses \hat q^{-2}.)
* 'rlcv_criterion()' is the robust likelihood cross-validation of Wu (2019),
-\{ \frac1n \sum_i \ln^*(\hat q_{-i}(u_i)^{-1}) - b^*(h) \}, with
\ln^* linearised below the threshold a_n. It is written so that
it is *minimised*.
* 'wbcv_criterion()' is the weighted criterion of Doosti (2026b), which
targets u\,q(u) (the quantity entering the first-price auction
inversion) rather than q(u):
\mathrm{WBCV}(h) = \sum_i \Delta_i\{u_i \hat q(u_i)\}^2 - \frac{2}{n}\sum_i u_i / \hat q_{-i}(u_i).
**Not recommended; kept only for backward compatibility.** The criterion is not scale-invariant: its two terms have different units (the first scales like the cube of the data units, the second like their inverse), so the selected bandwidth depends on the units of the data; on data of order one or larger the first term dominates and the criterion tends to select the smoothest fit in 'm_range'. The criterion is being revised (Doosti 2026b, revised version); 'wbcv_criterion()' and 'bandwidth = "wbcv"' issue a warning and are kept only so that existing code runs. Use BCV, RLCV or a numeric bandwidth instead.
bcv_criterion(m, x, fun, loo = TRUE, u_scheme = c("i/n", "i/(n+1)"))
rlcv_criterion(m, x, fun, loo = TRUE, u_scheme = c("i/n", "i/(n+1)"))
wbcv_criterion(m, x, fun, loo = TRUE, u_scheme = c("i/(n+1)", "i/n"))
m |
inverse bandwidth, |
x |
numeric sample (sorted internally). |
fun |
an estimator with signature 'fun(u, x, h)', e.g. [qdf_kernel()]. Extra arguments (such as 'H' for [qdf_soni()]) should be bound with a closure before calling. |
loo |
logical; if 'TRUE' (default) leave-one-out fits are computed
exactly (by refitting without observation |
u_scheme |
grid on which the criterion is evaluated: '"i/n"' (the published convention) or '"i/(n+1)"'. |
a single numeric value; smaller is better.
Wu, X. (2019). Robust likelihood cross validation for kernel density estimation. *Journal of Business & Economic Statistics*, 37, 761–770.
[select_bandwidth()], [qdf()]
x <- rgamma(60, 5, 1)
bcv_criterion(20, x, qdf_kernel)
rlcv_criterion(20, x, qdf_kernel)
optimize(bcv_criterion, c(10, 50), x = x, fun = qdf_bernstein)$minimum
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.