bias_AND_scaledvar function

Estimators of Bias and Scaled Variance

Estimators of Bias and Scaled Variance

``Workhorse'' function for vectorized (in σ\sigma) computation of both the bias estimator and the scaled variance estimator of eq. (2.3) in Srihera & Stute (2011), and for the analogous computation of the bias and scaled variance estimator for the rank transformation method in the paragraph after eq. (6) in Eichner & Stute (2013).

bias_AND_scaledvar(sigma, Ai, Bj, h, K, fnx, ticker = FALSE)

Arguments

  • sigma: Numeric vector (σ1,,σs)(\sigma_1, \ldots, \sigma_s) with s1s \ge 1.
  • Ai: Numeric vector expecting (x0X1,,x0Xn)/h(x_0 - X_1, \ldots, x_0 - X_n) / h, where (usually) x0x_0 is the point at which the density is to be estimated for the data X1,,XnX_1, \ldots, X_n with h=n1/5h = n^{-1/5}.
  • Bj: Numeric vector expecting (J(1/n),,J(n/n))(-J(1/n), \ldots, -J(n/n)) in case of the rank transformation method, but c("(hatthetaX1,\n(\\hat{\\theta} - X_1,\n", "ldots,hatthetaXn)\\ldots, \\hat{\\theta} - X_n)") in case of the non-robust Srihera-Stute-method. (Note that this the same as argument Bj of adaptive_fnhat!)
  • h: Numeric scalar, where (usually) h=n1/5h = n^{-1/5}.
  • K: Kernel function with vectorized in- & output.
  • fnx: fn(x0)=f_n(x_0) = mean(K(Ai))/h, where here typically h=n1/5h = n^{-1/5}.
  • ticker: Logical; determines if a 'ticker' documents the iteration progress through sigma. Defaults to FALSE.

Returns

A list with components BiasHat and VarHat.scaled, both numeric vectors of same length as sigma.

Details

Pre-computed fn(x0)f_n(x_0) is expected for efficiency reasons (and is currently prepared in function adaptive_fnhat).

Examples

require(stats) set.seed(2017); n <- 100; Xdata <- sort(rnorm(n)) x0 <- 1; Sigma <- seq(0.01, 10, length = 21) h <- n^(-1/5) Ai <- (x0 - Xdata)/h fnx0 <- mean(dnorm(Ai)) / h # Parzen-Rosenblatt estimator at x0. # non-robust method: Bj <- mean(Xdata) - Xdata # # rank transformation-based method (requires sorted data): # Bj <- -J_admissible(1:n / n) # rank trafo kader:::bias_AND_scaledvar(sigma = Sigma, Ai = Ai, Bj = Bj, h = h, K = dnorm, fnx = fnx0, ticker = TRUE)

References

Srihera & Stute (2011) and Eichner & Stute (2013): see kader .

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