arviz-devs / arviz

Exploratory analysis of Bayesian models with Python
https://python.arviz.org
Apache License 2.0
1.59k stars 395 forks source link

Shouldn't smoothing of discrete variables be optional in plot_bpv, especially when using kind=t_stat? #2325

Open lciti opened 6 months ago

lciti commented 6 months ago

Describe the bug

Discrete data passed to plot_bpv are always smoothed: https://github.com/arviz-devs/arviz/blob/29ca5a1823cc745ad3a7013e7bf0ef8da9996e6e/arviz/plots/backends/matplotlib/bpvplot.py#L90 I wonder if this should be made optional (possibly default True), at least in the case of kind='t_stat' where one may want to design a custom t_stat function that deals with the discrete data in a particular way. Having the data "smoothed" makes it hard to work with in this case.

aloctavodia commented 6 months ago

Hi, yes. This makes sense.

Patchouli-Kenntnis commented 5 months ago

This makes sense, but can you give me a small example dataset to show the difference of smoothing / without smoothing?