geweke_z

utils.diagnostics.geweke_z(x, frac_first=0.1, frac_last=0.5)

Geweke convergence z-score comparing early and late chain segments.

Compares the means of the first frac_first and last frac_last fractions of the chain, with segment variances scaled by their own effective sample sizes (an ESS-based stand-in for the spectral-density estimator of the classical statistic).

Parameters

Name Type Description Default
x np.ndarray The chain. required
frac_first float Fractions defining the two segments. 0.1
frac_last float Fractions defining the two segments. 0.1

Returns

Name Type Description
float nan when the segments are too short.