Data-Driven Bandwidth Selector for Kernel Density Est.?

Hey everybody,

is there any module in root to perform a data-driven optimization of the bandwidth (rho) for a kernel density estimation with the TKDE class?
There are several algorithms described in papers mostly concerning the Sheather and Jones bandwidth selection scheme.
I was wondering whether anyone implemented some of them into root yet.
If not: wouldn’t that be a great idea to do so for the next release? [-o<

Kind Regards,


I agree this could be something useful, but unfortunately we don’t have this yet implemented. If you want to contribute you are welcomed to do, otherwise we could add this in our to-do list of things to do for the next release

Best Regards


Hi Lorenzo,

I recently found a quite nice algorithm from Vikas Raykar, that seems to be free to download and to use:
It has been discussed in some papers already and seems to work fast and stable.
However, I couldn’t locate the actual bandwidth selecting part within his code so far…
I’ll try to contact him, maybe he will agree to integrate his algorithm into ROOT or even write an adapted version for the ROOT package :slight_smile: .
As for now I will try to implement my own code version of his algorithm. I’ll let you know how that turns out.

Nevertheless, I would say its a good idea to put this on the to-do list.

Kind Regards

hi Martin,

Thank you for the link. Yes, please try to implement the algorithm and once you have it, please let me know

Best Regards