Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

width.SJ

Bandwidth Selection by Pilot Estimation of Derivatives


Description

Uses the method of Sheather & Jones (1991) to select the bandwidth of a Gaussian kernel density estimator.

Usage

width.SJ(x, nb = 1000, lower, upper, method = c("ste", "dpi"))

Arguments

x

a numeric vector

nb

number of bins to use.

upper, lower

range over which to search for solution if method = "ste".

method

Either "ste" ("solve-the-equation") or "dpi" ("direct plug-in").

Value

a bandwidth.

Note

A faster version for large n (thousands) is available in R >= 3.4.0 as part of bw.SJ: quadruple its value for comparability with this version.

References

Sheather, S. J. and Jones, M. C. (1991) A reliable data-based bandwidth selection method for kernel density estimation. Journal of the Royal Statistical Society series B 53, 683–690.

Scott, D. W. (1992) Multivariate Density Estimation: Theory, Practice, and Visualization. Wiley.

Wand, M. P. and Jones, M. C. (1995) Kernel Smoothing. Chapman & Hall.

See Also

Examples

width.SJ(geyser$duration, method = "dpi")
width.SJ(geyser$duration)

width.SJ(galaxies, method = "dpi")
width.SJ(galaxies)

MASS

Support Functions and Datasets for Venables and Ripley's MASS

v7.3-54
GPL-2 | GPL-3
Authors
Brian Ripley [aut, cre, cph], Bill Venables [ctb], Douglas M. Bates [ctb], Kurt Hornik [trl] (partial port ca 1998), Albrecht Gebhardt [trl] (partial port ca 1998), David Firth [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.