arviz.geweke

arviz.geweke(ary, first=0.1, last=0.5, intervals=20)[source]

Compute z-scores for convergence diagnostics.

Compare the mean of the first % of series with the mean of the last % of series. x is divided into a number of segments for which this difference is computed. If the series is converged, this score should oscillate between -1 and 1.

Parameters
ary1D array-like

The trace of some stochastic parameter.

firstfloat

The fraction of series at the beginning of the trace.

lastfloat

The fraction of series at the end to be compared with the section at the beginning.

intervalsint

The number of segments.

Returns
scoreslist [[]]

Return a list of [i, score], where i is the starting index for each interval and score the Geweke score on the interval.

Notes

The Geweke score on some series x is computed by:

\[\frac{E[x_s] - E[x_e]}{\sqrt{V[x_s] + V[x_e]}}\]

where \(E\) stands for the mean, \(V\) the variance, \(x_s\) a section at the start of the series and \(x_e\) a section at the end of the series.

References

Geweke (1992)