[SciPy-Dev] Expanding Scipy's KDE functionality

Pierre Barbier de Reuille pierre at barbierdereuille.net
Fri Jan 25 13:41:56 EST 2013


On 25 January 2013 17:36, Daniel Smith <smith.daniel.br at gmail.com> wrote:

> You are correct. I had always ended up having padding on each side and
> gotten nonsense near the boundary. When I fixed the boundary
> correctly, it gave me nice answers. Could you send me your code for
> the cyclic density? I do some molecular dynamics work, and it would be
> really useful for making angular density plots.
>

Hey, I attach the code here.

As for your other part, I will have to think about it, but essentially I
came up with the conclusion that the bandwidth estimation would require a
sparser grid than the density estimation. Making some test, a grid of 2^10
elements seem plenty (i.e. I get 4 significant digits compared to 2^14) and
computation time falls from ~250ms to ~15ms using a dataset with 1000
samples. And 15 ms to compute the bandwidth is perfectly acceptable for me.
Now, if you have an adaptive method that can perform similarly, that would
be awesome. The bandwidth can then be used in any context in which it make
sense.

-- 
Barbier de Reuille Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130125/84bd3aeb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kde_fft.py
Type: application/octet-stream
Size: 1035 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130125/84bd3aeb/attachment.obj>


More information about the SciPy-Dev mailing list