DamienIrving / climate-analysis

Code used for the analysis and visualisation of climate data during my PhD
MIT License
40 stars 19 forks source link

Options for smoothing histograms #28

Open DamienIrving opened 9 years ago

DamienIrving commented 9 years ago

Python libraries for calculating your own kernel density estimate: http://stackoverflow.com/questions/33274506/kernel-density-estimation-in-seaborn-for-cyclic-end-points

DamienIrving commented 9 years ago

Here's a nice summary of the Python libraries: https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/

and some other discussions http://stats.stackexchange.com/questions/5960/how-to-identify-a-bimodal-distribution

DamienIrving commented 7 years ago

A problem with the pre-existing KDE packages is that they don't let you specify weights like the numpy.histogram function does. (This is especially problematic when you need to weight by volume.) This post describes the problem: http://blog.technariumas.lt/post/111695107866/weighted-kde-in-python

The people who develop these packages seem to be aware of the problem (e.g. see this issue), but at the moment there's a work around that someone has written: http://nbviewer.jupyter.org/gist/tillahoffmann/f844bce2ec264c1c8cb5 http://stackoverflow.com/questions/27623919/weighted-gaussian-kernel-density-estimation-in-python

(The other solution suggested in the Stack Overflow post is PyQT-Fit, however the code hasn't been updated for 2 years and when I pip installed it I got error upon importing it.)