[R] Kernel density / weights matrix?

Stephan Lindner lindners at umich.edu
Tue Feb 9 18:31:33 CET 2010

Dear everyone,

I'm coding the Horowitz-Spokoiny (2001) test [1], and I would be very
grateful or some advice regarding the Kernel density (apologies
beforehand if my terminology is not fully correct). I have looked into
ksmooth and npreg, but with no success. 

Given a (n x p) matrix of covariates X, I need to construct the
following matrix of Kernel densities or weights:

w(x_i, x_j) = 

		K(x_i - x_j)
	   sum_{k=1}^n K(x_i - x_k)

where x_i, x_j, x_k are (1 x p) vectors, and K is a multivariate normal
kernel. The resulting weighting matrix W has dimension (n x n). 

I have looked into npreg, but if I get this correctly, it does not
output this weighting matrix. I do need the weighting matrix itself
for the test statistic, and not just the kernel regression
estimates. I can construct it myself, but I thought I'd ask around
before doing so.



[1] Horowitz Joel L. and Spokoiny Vladimir G. (2001): "An Adaptive,
Rate-Optimal Test of a Parametric Mean-Regression Model against a
Nonparametric Alternative". Econometrica, Vol. 69, No. 3 (May, 2001),
pp. 599-631

Stephan Lindner
University of Michigan

More information about the R-help mailing list