PredictiveCheckTest.replicated_quantiles#

PredictiveCheckTest.replicated_quantiles(levels=(0.05, 0.5, 0.95))[source]#

Quantiles of each replicated statistic across the replications.

For a prior check this is the primary reading: the band says what the prior considers plausible for each feature of the data, on the data’s own scale, and a band that spans orders of magnitude is the signature of a prior that has not been thought about. For a posterior check it is the band the observed statistic is being located in; the q05, median, and q95 columns of summary() are this method at its default levels.

Parameters:

levels (tuple[float, ...]) – Probability levels in (0, 1), in the order the first axis of the result should carry them.

Return type:

NDArray[double]

Returns:

(len(levels), m, k), rows following statistics and columns names. nan wherever a replication’s statistic is undefined, since numpy.quantile() propagates it.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(2)
>>> y = rng.standard_normal((100, 3))
>>> check = replication_check(y, rng.standard_normal((200, 100, 3)))
>>> bands = check.replicated_quantiles((0.1, 0.9))
>>> bands.shape, bool(np.all(bands[0] <= bands[1]))
((2, 5, 3), True)