[Rd] density() with weights

Adrian Baddeley adrian at maths.uwa.edu.au
Mon Apr 18 07:17:18 CEST 2005


Hello - 

Recently I needed to compute kernel density estimates 
for a vector of observations x with given weights w
instead of the conventional equal weights w[i] = 1/length(x).

AFAIK, the existing code in 'base' does not accept weights. 

It wasn't hard to modify the C and R code for `density' in the base library
to accept weights. Source code is available at this URL

   <http://www.maths.uwa.edu.au/~adrian/density.html>

Just a suggestion.

regards
Adrian Baddeley.



More information about the R-devel mailing list