We have experienced some issues in the past with statsmodels' KDE implementation (see in-line comments in ridgeplot._kde.estimate_density_trace().
- Most obvious option: scipy.stats.gaussian_kde
- Some dedicated libraries:
- Python 3.13 will ship a
kde() utility as part of the built-in statistics module:
Things to keep in mind:
- Backwards compatibility with the existing
ridgeplot() arguments that are passed to statsmodels' KDEUnivariate
- Performance. e.g., statsmodels provides a faster FFT implementation when using the gaussian kernel.
- ...more?
We have experienced some issues in the past with statsmodels' KDE implementation (see in-line comments in
ridgeplot._kde.estimate_density_trace().kde()utility as part of the built-instatisticsmodule:Things to keep in mind:
ridgeplot()arguments that are passed to statsmodels'KDEUnivariate