
Map a 95% prediction interval to a [0, 1] confidence score
Source:R/spectra-ossl.R
pi_to_confidence.RdTightens confidence as the prediction interval narrows relative to
the predicted value: confidence = 1 - (PI95_width / |value|) / 4,
floored at 0 and capped at 1. When value is near zero we
fall back to an absolute-width heuristic so we never blow up.