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:
xndarray

Observations of time series for which bds statistics is calculated.

max_dimint

The maximum embedding dimension.

epsilon{float, None}, optional

The threshold distance to use in calculating the correlation sum.

distancefloat, optional

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

Returns:
bds_statfloat

The BDS statistic.

pvaluefloat

The p-values associated with the BDS statistic.

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)})


Last update: Dec 23, 2024