statsmodels.tsa.stattools.ccovf

statsmodels.tsa.stattools.ccovf(x, y, unbiased=True, demean=True)[source]

Calculate the crosscovariance between two series.

Parameters

x, y : array_like

The time series data to use in the calculation.

unbiased : bool, optional

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

demean : bool, optional

Flag indicating whether to demean x and y.

Returns

ndarray

The estimated crosscovariance function.

Notes

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