Generate independent replicated datasets under a fully specified null hypothesis and calculate the same predictive discrepancy statistic for them and the observation. Their null exchangeability gives a finite-simulation rank test. The displayed add-one tail probability is valid with conservative treatment of ties, and avoids reporting zero solely because no replicate exceeds the observation.
New to topics? Read the docs here!