rolling_autocorrΒΆ

Defined in fynance.features.indicators

rolling_autocorr(X, w=21, lag=1, axis=0, dtype=None)[source]

Rolling lag-lag autocorrelation over a strictly-past window w.

Parameters:
Xnp.ndarray[dtype, ndim=1 or 2]

Input series.

wint, optional

Rolling window. Default 21.

lagint, optional

Autocorrelation lag. Default 1.

axis{0, 1}, optional

Axis of computation. Default 0.

dtypenp.dtype, optional

Output dtype.

Returns:
np.ndarray[dtype, ndim=1 or 2]

Rolling autocorrelation (0 where the window is too short).