bw.f.BGM.rt: Rule of thumb bandwidth selector for...

View source: R/bw.f.BGM.rt.R

bw.f.BGM.rtR Documentation

Rule of thumb bandwidth selector for \insertCitejones1991;textualWData kernel density estimator

Description

This function computes the bandwidth selector for \insertCitejones1991;textualWData density estimator using the rule of thumb.

Usage

bw.f.BGM.rt(
  y,
  w = function(y) {
     ifelse(y >= 0, y, NA)
 },
  kernel = c("gaussian", "epanechnikov", "rectangular", "triangular", "biweight",
    "cosine", "optcosine")
)

Arguments

y

A numeric vector containing the biased sample.

w

A function representing the bias function applied to the data points. It must be evaluable and positive in each point of the sample y. By default, it is set to the length-biased function.

kernel

A character string specifying the kernel function. Available options: "gaussian", "epanechnikov", "rectangular", "triangular", "biweight", "cosine" and "optcosine".

Details

The bandwidth is given by

\widehat{h}_{f,\mathrm{RT}} = \left(\frac{8 \sqrt{\pi} \widehat{\mu}_{w} \widehat{\bar{\mu}}_{w} R(K)}{3n \eta(K)^{2}}\right)^{1 / 5}\widehat{\sigma}_{w},

where R(K) and \eta(K) depend only on the kernel and are defined as

R(K) = \int_{-\infty}^{+\infty} K(u)^2 du \quad \text{and} \quad \eta(K) = \int_{-\infty}^{+\infty} u^2 K(u) du.

The estimators \widehat{\mu}_w and \widehat{\bar{\mu}}_w are given by

\widehat{\mu}_w = n \left(\sum_{i=1}^{n} \frac{1}{w(Y_i)} \right)^{-1} \quad \text{and} \quad \widehat{\bar{\mu}}_w = \frac{\widehat{\mu}_w}{n} \sum_{i=1}^{n} \frac{1}{w(Y_i)^2}.

\widehat{\sigma}_{w} is an estimation of the standard deviation of the distribution given by

\widehat{\sigma}_w=\sqrt{\left(\frac{1}{n} \sum_{i=1}^n \frac{1}{w(Y_i)}\right)^{-1} \left[\left(\frac{1}{n} \sum_{i=1}^n w(Y_i)\right)-\left(\frac{1}{n} \sum_{i=1}^n \frac{1}{w(Y_i)}\right)^{-1}\right]}.

Value

The rule of thumb bandwidth value.

References

\insertAllCited

See Also

df.jones

Examples

bw.f.BGM.rt(shrub.data$Width)
bw.f.BGM.rt(shrub.data$Width, kernel = "epanechnikov")

WData documentation built on Nov. 2, 2026, 1:10 a.m.