[SciPy-Dev] Expanding Scipy's KDE functionality

Pierre Barbier de Reuille pierre at barbierdereuille.net
Thu Jan 24 16:10:54 EST 2013


On 24 January 2013 15:49, Daniel Smith <smith.daniel.br at gmail.com> wrote:

> In fact, the method currently only works on unbounded domains. The
> exact domain you calculate the density on is an optional parameter to
> the density estimator function. The actual domain you calculate on has
> to be finite because a finite mesh is needed.
>

About this: this is incorrect, as you work with a DCT, it is equivalent to
repeat the data on both sides by reflexion. Which means your method is
equivalent to the reflexion method. Also note this is pointed out in the
paper itself. That being said, if there is enough "padding" on both sides
(i.e. such that the tail of the kernel is almost 0) there is no effect to
this. Also, you can replace the CDT with a FFT to get a cyclic density. I
adapted your code for this and it works great!

Back on the computation of the bandwidth, I would argue that you can
compute it without computing the density itself. It's true that it makes
sense to combine the binning as it useful for both, but I don't agree that
it's necessary.

-- 
Barbier de Reuille Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130124/be2dd5a8/attachment.html>


More information about the SciPy-Dev mailing list