statsmodels.tsa.stattools.acovf#
- statsmodels.tsa.stattools.acovf(x, adjusted=False, demean=True, fft=True, missing='none', nlag=None)[source]#
Estimate autocovariances
- Parameters:
- xarray_like
Time series data. Must be 1d.
- adjustedbool,
optional If True, then denominators is n-k, otherwise n.
- demeanbool,
optional If True, then subtract the mean x from each element of x.
- fftbool,
optional If True, use FFT convolution. This method should be preferred for long time series.
- missing{“none”, “raise”, “conservative”, “drop”},
optional Specifies how the NaNs are to be treated. “none” performs no checks. “raise” raises an exception if NaN values are found. “drop” removes the missing observations and then estimates the autocovariances treating the non-missing as contiguous. “conservative” computes the autocovariance using nan-ops so that nans are removed when computing the mean and cross-products that are used to estimate the autocovariance. When using “conservative”, n is set to the number of non-missing observations.
- nlag
int,optional Limit the number of autocovariances returned. Size of returned array is nlag + 1. Setting nlag when fft is False uses a simple, direct estimator of the autocovariances that only computes the first nlag + 1 values. This can be much faster when the time series is long and only a small number of autocovariances are needed.
- Returns:
ndarrayThe estimated autocovariances.
References
[1]Parzen, E., 1963. On spectral analysis with missing observations and amplitude modulation. Sankhya: The Indian Journal of Statistics, Series A, pp.383-392.