bandwidth | R Documentation |
Bandwidth estimators for densities, used in the bandwidth
argument
to density functions (e.g. density_bounded()
, density_unbounded()
).
Supports automatic partial function application with waived arguments.
bandwidth_nrd0(x, ...)
bandwidth_nrd(x, ...)
bandwidth_ucv(x, ...)
bandwidth_bcv(x, ...)
bandwidth_SJ(x, ...)
bandwidth_dpi(x, ...)
x |
<numeric> Vector containing a sample. |
... |
Arguments passed on to
|
These are loose wrappers around the corresponding bw.
-prefixed functions
in stats. See, for example, bw.SJ()
.
bandwidth_dpi()
, which is the default bandwidth estimator in ggdist,
is the Sheather-Jones direct plug-in estimator, i.e. bw.SJ(..., method = "dpi")
.
With the exception of bandwidth_nrd0()
, these estimators may fail in some
cases, often when a sample contains many duplicates. If they do they will
automatically fall back to bandwidth_nrd0()
with a warning. However, these
failures are typically symptomatic of situations where you should not want to
use a kernel density estimator in the first place (e.g. data with duplicates
and/or discrete data). In these cases consider using a dotplot (geom_dots()
)
or histogram (density_histogram()
) instead.
A single number giving the bandwidth
density_bounded()
, density_unbounded()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.