Description Usage Arguments Details Value Note Examples
Vectorized evaluation of the convolution of the kernel function K with fn.
1 | kfn_vectorized(u, K, xixj, h, sig)
|
u |
Numeric vector. |
K |
Kernel function with vectorized in- & output. |
xixj |
Numeric matrix. |
h |
Numeric scalar. |
sig |
Numeric scalar. |
Vectorized (in u) evaluation of - a more explicit representation of - the integrand K(u) * f_n(… - h^2/σ * u) which is used in the computation of the bias estimator before eq. (2.3) in Srihera & Stute (2011). Also used for the analogous computation of the respective bias estimator in the paragraph after eq. (6) in Eichner & Stute (2013).
A vector of (K * f_n)(u) evaluated at the values in
u
.
An alternative implementation could be
K(u) * sapply(h/sig * u, function(v) mean(K(xixj - v))) / h
1 2 3 4 5 6 7 8 9 10 11 | require(stats)
set.seed(2017); n <- 100; Xdata <- rnorm(n)
x0 <- 1; sig <- 1; h <- n^(-1/5)
Ai <- (x0 - Xdata)/h
Bj <- mean(Xdata) - Xdata # in case of non-robust method
AiBj <- outer(Ai, Bj/sig, "+")
ugrid <- seq(-10, 10, by = 1)
kader:::kfn_vectorized(u = ugrid, K = dnorm, xixj = AiBj, h = h, sig = sig)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.