bw.f.BGM.boot2: \insertCiteborrajo2017;textualWData bootstrap bandwidth...

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

bw.f.BGM.boot2R Documentation

\insertCiteborrajo2017;textualWData bootstrap bandwidth selector for \insertCitejones1991;textualWData kernel density estimator

Description

This function computes the bandwidth selector for \insertCitejones1991;textualWData kernel density estimator using the bias-corrected bootstrap method developed by \insertCiteborrajo2017;textualWData.

Usage

bw.f.BGM.boot2(
  y,
  w = function(y) {
     ifelse(y >= 0, y, NA)
 },
  kernel = c("gaussian", "epanechnikov", "rectangular", "triangular", "biweight",
    "cosine", "optcosine"),
  bw0 = 1/8 * n^(-1/9),
  lower = IQR(y) * n^(-0.2) * 2000^(-1),
  upper = IQR(y) * (log(n)/n)^(0.2) * 500,
  nh = 200L,
  tol = 0.1 * lower,
  from = min(y) - (sort(y)[5] - min(y)),
  to = max(y) + (max(y) - sort(y, decreasing = TRUE)[5]),
  plot = TRUE
)

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".

bw0

The bandwidth value to be used in density. It can also be a character string specifying a bandwidth selection method. Options available can be checked in bw.nrd. By default it is set to ⁠1/8 n^(-1/9)⁠, where n is the sample size.

lower

Numeric value specifying the lower bound for bandwidth selection. Default is computed based on the interquartile range (IQR) and sample size.

upper

Numeric value specifying the upper bound for bandwidth selection. Default is computed based on the interquartile range (IQR) and sample size.

nh

An integer specifying the number of points in the grid to evaluate the mean integrated squared error function. Default is 200.

tol

Tolerance value used to check whether the minimum found lies at the boundaries of the interval; that is, the function will return a warning if the window minimizing the cross-validation function lies within ⁠[lower, lower+tol]⁠ or ⁠[upper-tol, upper]⁠. Default is 10% of the lower bound.

from

Numeric value specifying the lower bound to be used in density. Default is computed based on the range of input data.

to

Numeric value specifying the upper bound to be used in density. Default is computed based on the range of input data.

plot

Logical value indicating whether to plot the mean integrated squared error function. Default is TRUE.

Details

The bandwidth returned is the one minimizing \mathrm{MISE}^{\ast} over a compact interval [h_1,h_2] (determined by arguments lower and upper), i.e.,

\widehat{h}_{f, \mathrm{B}} = \arg \min_{h_{f} \in [h_1,h_2]} \int_{-\infty}^{+ \infty} \mathrm{MSE}^{\ast}\left(\widehat{f}^{\ast}_{\mathrm{J}, h_{f}}(y)\right)dy.

\mathrm{MISE}^{\ast} and \mathrm{MSE}^{\ast} correspond with the expression of the mean integrated squared error and the mean squared error of the bootstrap estimator \widehat{f}^{\ast}_{\mathrm{J}, h_{f}} provided by \insertCiteborrajo2017;textualWData.

Value

The bootstrap bandwidth value.

References

\insertAllCited

See Also

df.jones

Examples


bw.f.BGM.boot2(shrub.data$Width, nh = 50L)


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