CouplingReport

class telescopic.testing.CouplingReport(stay, moves, met, stale, near_misses)

The checks of check_coupling().

Attributes:
staytuple of two floats

For the first and the second chain of the pairs, the Bonferroni-corrected p-value of Fisher’s exact tests, one from each starting point, that the chain stays put as often in a coupled step as in a step of the kernel alone.

movestuple of two floats

For the first and the second chain, the Bonferroni-corrected p-value of two-sample Kolmogorov-Smirnov tests, from each starting point, that compare the moved positions of a coupled step with those of a step alone, along random directions and in the distance moved; NaN where a position is NaN.

metfloat

The fraction of pairs that met, with equal positions and equal markov_fields: a coupling that never meets gives no estimate.

staleint

Chains whose returned log-density or gradient differs from a fresh evaluation at their position, which the engine reuses, and chains whose next step with the kernel’s caches, the fields of extra outside its Markov fields, differs from the same step without them.

near_missesint

Pairs whose positions differ by at most 64 units in the last place in every coordinate: a coupling that recomputes Y where it should copy X’s proposal leaves them, and the engine never sees such pairs meet.

passed(alpha=0.001)

Whether every p-value is at least alpha and pairs met, with no stale state or near miss.

A p-value of NaN fails. Each of the four p-values is compared with alpha without a correction for their number, so a correct coupling fails these checks with probability at most about 4 * alpha.

Parameters:
alphafloat

The level below which a p-value fails, in (0, 1).

Returns:
bool