Raise a `ValueError` when the central value is outside of the percentiles
Created by: scarlehoff
Fixes issue #1860 (closed)
This (and other reports that we have received) about the negative error bars are due a combination of factors:
- The fact that the central value is the average of the replicas is only true for the PDF and linear quantities (so, not for hadronic observable such as some of the positivity obs)
- While the PDF is gaussian that's not a problem, but in fringe regions of the phase space (which are probed by the positivity observables) the PDF can have non gaussianities, which are even more pronounced if you use a fit with not many replicas.
When this happens matplotlib
will raise a ValueError
if you try to plot error bars due to changes in matplotlib. Since this is usually a weird situation and stemming from bad fits (in one way or another), I've decided to catch the error and add a bit of an explanation.
My first thought was to set the extremes with the central value, but I've realised this could have unintended consequences in other parts so better to keep the error but leave an explanation.