[SciPy-user] guassian_kde and kernel regression

Anne Archibald aarchiba at physics.mcgill.ca
Sat Nov 1 19:51:08 EDT 2008


2008/11/1 Frank Lagor <dfranci at seas.upenn.edu>:
> This question is probably for Robert Kern, because I believe the he wrote
> the gaussian_kde class in scipy.stats.kde, however I would very much
> appreciate a response from anyone else who could help.  My question is:  Is
> there currently any way to perform weighted kernel density estimation using
> the gaussian_kde class?   If not, what needs to be done, and how do I get
> started?
>
> Just for clarity sake-- by weighted KDE  I mean that I have more than just
> the distribution of points for the density estimate.  I also have an
> associated probability with each point.  In this case, I believe it becomes
> a regression problem and I think is referred to as kernel regression.  I
> would very much like to use the class to perform both KDE and wKDE.

The class does not support weights right now, but I don't think it
would be very difficult to add them to most parts of the code,
essentially just adding a "weights" optional argument. The automatic
covariance selection would need some rethinking; you'd need to hunt
down some research papers. (That method is only really appropriate for
unimodal distributions anyway.) But it does seem valuable.

Anne



More information about the SciPy-User mailing list