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_dim
int,optional The maximum embedding dimension.
- epsilon
float,optional The threshold distance to use in calculating the correlation sum. If not provided, computed as
distancetimes the standard deviation ofx.- distance
float,optional Specifies the distance multiplier to use when computing the test statistic if epsilon is omitted.
- Returns:
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)})