Re: [R] density estimation with weighted sample

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 07 Apr 2005 - 18:25:01 EST

On Thu, 7 Apr 2005, Tomassini, Lorenzo wrote:

> I would like to perform density estimation with a weighted sample
> (output of an Importance Sampling procedure) in R. Could anybody give me
> an advice on what function to use (in which package)?

This could mean

  1. You have a sample with weights w, so `w=4' means `I have 4 of those'.
  2. You have a sample from a density proportional to w(x)f(x) and want to estimate f.

Your title suggests the first, your comment the second. If it is the second, use any package (even density() in R) to estimate the density g of the sampled distribution, for ghat/w and rescale to unit area. If you know a lot about w (e.g. in stereology) there are specialized methods which are better.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Apr 07 18:34:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:03 EST