bias_ES2012 function

Bias Estimator of Eichner & Stute (2012)

Bias Estimator of Eichner & Stute (2012)

Bias estimator Biasn(σ)Bias_n(\sigma), vectorized in σ\sigma, on p. 2540 of Eichner & Stute (2012).

bias_ES2012(sigma, h, xXh, thetaXh, K, mmDiff)

Arguments

  • sigma: Numeric vector (σ1,,σs)(\sigma_1, \ldots, \sigma_s) with s1s \ge 1 with values of the scale parameter σ\sigma.
  • h: Numeric scalar for bandwidth hh (as ``contained'' in thetaXh and xXh).
  • xXh: Numeric vector expecting the pre-computed h-scaled differences (xX1)/h(x - X_1)/h, , (xXn)/h(x - X_n)/h where xx is the single (!) location for which the weights are to be computed, the XiX_i's are the data values, and hh is the numeric bandwidth scalar.
  • thetaXh: Numeric vector expecting the pre-computed h-scaled differences (θX1)/h(\theta - X_1)/h, , (θXn)/h(\theta - X_n)/h where θ\theta is the numeric scalar location parameter, and the XiX_i's and hh are as in xXh.
  • K: A kernel function (with vectorized in- & output) to be used for the estimator.
  • mmDiff: Numeric vector expecting the pre-computed differences mn(X1)mn(x),,mn(Xn)mn(x)m_n(X_1) - m_n(x), \ldots, m_n(X_n) - m_n(x).

Returns

A numeric vector of the length of sigma.

Details

The formula can also be found in eq. (15.21) of Eichner (2017). Pre-computed (xXi)/h(x - X_i)/h, (θXi)/h(\theta - X_i)/h, and mn(Xi)mn(x)m_n(X_i) - m_n(x) are expected for efficiency reasons (and are currently prepared in function kare).

Examples

require(stats) # Regression function: m <- function(x, x1 = 0, x2 = 8, a = 0.01, b = 0) { a * (x - x1) * (x - x2)^3 + b } # Note: For a few details on m() see examples in ?nadwat. n <- 100 # Sample size. set.seed(42) # To guarantee reproducibility. X <- runif(n, min = -3, max = 15) # X_1, ..., X_n # Design. Y <- m(X) + rnorm(length(X), sd = 5) # Y_1, ..., Y_n # Response. h <- n^(-1/5) Sigma <- seq(0.01, 10, length = 51) # sigma-grid for minimization. x0 <- 5 # Location at which the estimator of m should be computed. # m_n(x_0) and m_n(X_i) for i = 1, ..., n: mn <- nadwat(x = c(x0, X), dataX = X, dataY = Y, K = dnorm, h = h) # Estimator of Bias_x0(sigma) on the sigma-grid: (Bn <- bias_ES2012(sigma = Sigma, h = h, xXh = (x0 - X) / h, thetaXh = (mean(X) - X) / h, K = dnorm, mmDiff = mn[-1] - mn[1])) ## Not run: # Visualizing the estimator of Bias_n(sigma) at x on the sigma-grid: plot(Sigma, Bn, type = "o", xlab = expression(sigma), ylab = "", main = bquote(widehat("Bias")[n](sigma)~~"at"~~x==.(x0))) ## End(Not run)

References

Eichner & Stute (2012) and Eichner (2017): see kader.

See Also

kare which currently does the pre-computing.

  • Maintainer: Gerrit Eichner
  • License: GPL-3
  • Last published: 2017-10-04