[SciPy-user] KDE question

Zachary Pincus zpincus at stanford.edu
Fri Nov 9 14:34:11 EST 2007


Hello all,

I'm using scipy.stats.gaussian_kde to estimate the a probability  
density based on some scattered 2D samples. What I would like to do  
eventually is plot a line that surrounds (say) 90% of the probability  
density.

Clearly this line corresponds to some contour of the density function  
(which I can extract out easily enough from KDE density estimates on  
a grid), but I'm not sure how to figure out what exact contour value  
it is that I want.

Given the KDE density estimates on a grid, I could empirically figure  
out which value is closest, but I was wondering if there's a simpler  
closed-form solution... (And apologies if it's somehow obvious; I'm  
feeling a bit foggy-headed about this.)

Best,

Zach




More information about the SciPy-User mailing list