| bandwidth-class | R Documentation |
"bandwidth" — Result of Bandwidth SelectionAn S4 class returned by all bandwidth selector functions in kedd
(h.ucv, h.bcv, h.ccv,
h.mcv, h.tcv, h.scv,
h.amise, h.mlcv). It stores the selected bandwidth together with
the data, kernel, derivative order, and optimisation details.
Objects are created by calls to the bandwidth selector functions, or
directly with new("bandwidth", ...).
data:Object of class "numeric". The (cleaned)
data vector.
kernel:Object of class "character". Name of the
kernel function used (one of "gaussian", "epanechnikov",
"triangular", "biweight", "uniform",
"triweight", "tricube", "cosine",
"silverman", "logistic" or "pow(s,t)").
deriv.order:Object of class "integer". Derivative
order r \geq 0.
h:Object of class "numeric". The selected
bandwidth.
min.obj:Object of class "numeric". The minimum
value of the cross-validation (or other) criterion at h.
NA for h.amise.
hos:Object of class "numeric". The
over-smoothing bandwidth h_{os}; the default search
interval is [0.01\,h_{os},\, 2\,h_{os}].
method:Object of class "character". The
selector used: one of "UCV", "BCV1", "BCV2",
"CCV", "MCV", "TCV", "SCV",
"AMISE", "MLCV".
show(object)Prints a compact summary: method, kernel, derivative order, selected bandwidth, minimum criterion.
plot(x, h = NULL, type = "o", n.points = 100L,
log_scale_x = FALSE, show.min = TRUE, show.hos = FALSE, ...)Draws
the cross-validation curve over a grid of bandwidths with ggplot2
and marks the selected h. Returns invisibly a list with
h, cv and the ggplot object plot. Not available
for "AMISE" (closed-form rule, no criterion).
lines(x, n.points = 100L, color, linewidth, linetype, ...)Returns
a ggplot2::geom_line() layer with the curve of x, to be
added to a plot: plot(bw1)$plot + lines(bw2).
x$nameCompatibility with kedd 1.x, where the
selectors returned a list: bw$h is bw@h, and $
also accepts the slot names, x (the data), n and the
1.x names min.ucv, min.bcv, ... (the slot
min.obj). Unknown names give NULL.
Arsalane Chouaib Guidoum acguidoum@univ-tam.dz, Amel Henider amel.henider@univ-tam.dz and Iago Giné-Vázquez iago.gin-vaz@protonmail.com
h.ucv, h.bcv, h.ccv,
h.mcv, h.tcv, h.scv,
h.amise, h.mlcv, dkde.
x <- rnorm(100)
bw <- h.ucv(x, deriv.order = 0)
show(bw)
p <- plot(bw)
## overlay a second criterion (ggplot2 layer)
p$plot + lines(h.bcv(x), color = "darkred")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.