Kernel density
Hi, I want to fit a kernel density estimator by bkde of library KernSmooth. I need only the density value at the point 0. I do not understand the following behaviour:
q <- rnorm(100) bkq <- bkde(q, bandwidth=0.11, gridsize=1, range.x=c(0,0))
Error in 0:L : NA/NaN argument
bkq <- bkde(q, bandwidth=0.11, gridsize=1, range.x=c(-1,1)) bkq
$x [1] -1 $y [1] NA
bkq <- bkde(q, bandwidth=0.11, gridsize=3, range.x=c(-1,1))
Warning message: longer object length is not a multiple of shorter object length in: kappa * gcounts
bkq
$x [1] -1 0 1 $y [1] NA NA NA
bkq <- bkde(q, bandwidth=0.11, range.x=c(-1,1))
(works, I get 401 proper y-values) Adding truncate=FALSE does not change anything. Do I really need to generate 401 (default gridsize) y-fits to extract the one value I am interested in? What's the problem with specifying gridsize? Best, Christian
*********************************************************************** Christian Hennig Seminar fuer Statistik, ETH-Zentrum (LEO), CH-8092 Zuerich (currently) and Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg hennig at stat.math.ethz.ch, http://stat.ethz.ch/~hennig/ hennig at math.uni-hamburg.de, http://www.math.uni-hamburg.de/home/hennig/ ####################################################################### ich empfehle www.boag.de