statsmodels.tsa.stattools.ccf

statsmodels.tsa.stattools.ccf(x, y, adjusted=True)[source]

The cross-correlation function.

Parameters
x, yarray_like

The time series data to use in the calculation.

adjustedbool

If True, then denominators for autocovariance is n-k, otherwise n.

Returns
ndarray

The cross-correlation function of x and y.

Notes

This is based np.correlate which does full convolution. For very long time series it is recommended to use fft convolution instead.

If adjusted is true, the denominator for the autocovariance is adjusted.