gwin.geweke module¶
Functions for computing the Geweke convergence statistic.
-
gwin.geweke.
geweke
(x, seg_length, seg_stride, end_idx, ref_start, ref_end=None, seg_start=0)[source]¶ Calculates Geweke conervergence statistic for a chain of data. This function will advance along the chain and calculate the statistic for each step.
Parameters: - x (numpy.array) – A one-dimensional array of data.
- seg_length (int) – Number of samples to use for each Geweke calculation.
- seg_stride (int) – Number of samples to advance before next Geweke calculation.
- end_idx (int) – Index of last start.
- ref_start (int) – Index of beginning of end reference segment.
- ref_end (int) – Index of end of end reference segment. Default is None which will go to the end of the data array.
- seg_start (int) – What index to start computing the statistic. Default is 0 which will go to the beginning of the data array.
Returns: - starts (numpy.array) – The start index of the first segment in the chain.
- ends (numpy.array) – The end index of the first segment in the chain.
- stats (numpy.array) – The Geweke convergence diagnostic statistic for the segment.