Dependence aware tests for ppc_loo_pit_ecdf#428
Dependence aware tests for ppc_loo_pit_ecdf#428florence-bockting wants to merge 135 commits intostan-dev:masterfrom
ppc_loo_pit_ecdf#428Conversation
…improve input validation checks
…e-bockting/bayesplot into dependence-aware-LOO-PIT
…e-bockting/bayesplot-private into dependence-aware-LOO-PIT
|
Because this copies a lot of code from stan-dev/posterior#435 and other parts of the posterior package, I think we should wait to merge it until that posterior PR is merged so we can remove the extra code before adding it to bayesplot. Related to this, I spoke with @avehtari and we think that it could be useful to have all the uniformity test code in posterior also because it could be used without making a plot. So that code could be added to stan-dev/posterior#435 and then used in bayesplot. |
Yes, I am totally with you.
Alright. I moved the respective code from this PR to stan-dev/posterior#435 |
…of local implementation
Description
Context
LOO-PIT is used for model checking within the Bayesian workflow. The LOO-PIT values are asymptotically uniform (for continuous data) if the model is calibrated. Within this approach, each data point is iteratively held out; the model is then conditioned on the remaining data and the corresponding LOO predictive distribution is compared to the held-out point to test for departures from uniformity. A corresponding graphical uniformity test was developed by Säilynoja et al. (2022) and is implemented in the
ppc_loo_pit_ecdffunction in the bayesplot package. This function visualizes the empirical cumulative distribution function (ECDF) of the LOO-PITs, overlaid with simultaneous confidence intervals (creating an envelope) for a standard uniform sample.Issue
The current approach assumes independence of LOO-PIT values which is not valid (Marhunenda et al., 2005). The corresponding graphical test yields an envelope that is too wide, reducing the test's ability to reveal model miscalibration.
Suggested solution (Content of this PR)
Tesso & Vehtari (2026, see preprint) propose three testing procedures that can handle any dependent uniform values and provide an updated graphical representation that uses color coding to indicate influential regions or most influential points of the ECDF. This PR implements the new development, by replacing the current
ppc_loo_pit_ecdfimplementation.TODOs
ppc_loo_pit_ecdf()function inppc-loo.Rhelpers-ppc.Rtest-helpers-ppc.Randtest-ppc-loo.Rppc_loo_pit_ecdf()intest-ppc-loo.Rmethodargumentmethodargument