[R] kernel smoothing of weighted data
Francisco J. Zagmutt
gerifalte28 at hotmail.com
Tue Aug 16 19:51:52 CEST 2005
You can also specify weights in sm.density() in the package sm.
Cheers
Francisco
>From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
>To: riap2 at cam.ac.uk
>CC: r-help at stat.math.ethz.ch
>Subject: Re: [R] kernel smoothing of weighted data
>Date: Tue, 16 Aug 2005 18:13:43 +0100 (BST)
>
>density() in the R-devel version of R allows weights.
>
>locfit() in the package of the same name also appears to be documented to.
>
>On Tue, 16 Aug 2005 riap2 at cam.ac.uk wrote:
>
> > I want to use kde() or a similar function for kernel smoothing but I
>want
> > to specify the weight of each of my data points. I do not want to
>specify
> > the bandwidth on a point by point basis.
>
>The only kde() I found is from the recent package ks, and is for
>multivariate data -- if you want that, you did not say so and I've not
>looked for an answer there.
>
> > This seems such a simple and obvious thing to want to do I am suspicious
> > that there is not an obvious way to do it. The only discussion I have
> > found is about negative weights(!) and says nothing about
>implementation.
> > Can anyone suggest a package I have missed or suggest the best starting
> > point for writing my own solution.
> >
> > The reason for wanting this is that I have a number of samples each of
> > ~1000 data points from the same distribution but the samples are of
> > slightly differing statistical weight and eventually each point in each
> > sample may have its own statistical weight.
> >
> > I have searched the list but I am not subscribed to it so please make me
>an
> > addressee of any reply.
>
>
>--
>Brian D. Ripley, ripley at 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 at 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
More information about the R-help
mailing list