PredictiveCheckTest._flags#

PredictiveCheckTest._flags(level)[source]#

Mark the (m, k) cells whose tail probability lies outside (level, 1 - level).

The one place the two-sided rule is evaluated; extreme(), adequate(), and the marker column of summary() all read it, so the three can never disagree about which cells are in a tail. The comparison is two-sided because a p-value near one is as much a failure as one near zero: the observed statistic then sits below every replication.

nan p-values compare false on both sides, so an undefined cell is never flagged; the invalid floating-point warning that the comparison would otherwise raise on nan is suppressed rather than allowed to reach the caller as noise.

Parameters:

level (float) – The tail size on each side, already validated by the caller to lie strictly inside (0, 0.5); this method does not check it.

Return type:

NDArray[bool]

Returns:

(m, k) booleans, True where the cell is in a tail.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(3)
>>> y = 2.0 + rng.standard_normal((100, 1))
>>> check = replication_check(y, rng.standard_normal((200, 100, 1)))
>>> check._flags(0.05)[:, 0].tolist()
[True, False, False, False, False]