kfn_vectorized: Convolution of Kernel Function K with fn

Description Usage Arguments Details Value Note Examples

Description

Vectorized evaluation of the convolution of the kernel function K with fn.

Usage

1
kfn_vectorized(u, K, xixj, h, sig)

Arguments

u

Numeric vector.

K

Kernel function with vectorized in- & output.

xixj

Numeric matrix.

h

Numeric scalar.

sig

Numeric scalar.

Details

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

Value

A vector of (K * f_n)(u) evaluated at the values in u.

Note

An alternative implementation could be K(u) * sapply(h/sig * u, function(v) mean(K(xixj - v))) / h

Examples

 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)

kader documentation built on May 1, 2019, 10:13 p.m.