bw_select_plugin_univariate: Plugin bandwidth selection for univariate data

Description Usage Arguments Details Value Examples

View source: R/bandwidth_selection.R

Description

Returns a plugin bandwidth for data vectors for use with univariate locally Gaussian density estimation

Usage

1
2
bw_select_plugin_univariate(x = NULL, n = length(x), c = 1.75,
  a = -1/5)

Arguments

x

The data vector.

n

The number of data points. Can provide only this if we do not want to supply the entire data vector.

c

A constant, se details.

a

A constant, se details.

Details

This function takes in a data vector of length n, and returns a the real number c*n^a, which is a quick and dirty way of selecting a bandwidth for univariate locally Gaussian density estimation. The number c is by default set to 1.75, and c = -1/5 is the usual exponent that stems from the asymptotic convergence rate of the density estimate. Recommended use of this function is through the lg_main wrapper function.

Value

A number, the selected bandwidth.

Examples

1
2
3
  x <- rnorm(100)
  bw <- bw_select_plugin_univariate(x = x)
  bw <- bw_select_plugin_univariate(n = 100)

lg documentation built on Dec. 5, 2019, 5:13 p.m.