statsmodels.tsa.stattools.bds#

statsmodels.tsa.stattools.bds(x, max_dim=2, epsilon=None, distance=1.5)[source]#

BDS Test Statistic for Independence of a Time Series

Parameters:
xarray_like

Observations of time series for which bds statistics is calculated.

max_dimint, optional

The maximum embedding dimension.

epsilonfloat, optional

The threshold distance to use in calculating the correlation sum. If not provided, computed as distance times the standard deviation of x.

distancefloat, optional

Specifies the distance multiplier to use when computing the test statistic if epsilon is omitted.

Returns:
bds_statfloat or ndarray

The BDS statistic. An ndarray is returned if max_dim > 2.

pvaluefloat or ndarray

The p-values associated with the BDS statistic. An ndarray is returned if max_dim > 2.

Notes

The null hypothesis of the test statistic is for an independent and identically distributed (i.i.d.) time series, and an unspecified alternative hypothesis.

This test is often used as a residual diagnostic.

The calculation involves matrices of size (nobs, nobs), so this test will not work with very long datasets.

Implementation conditions on the first m-1 initial values, which are required to calculate the m-histories: x_t^m = (x_t, x_{t-1}, … x_{t-(m-1)})