acf_plot¶
- acf_plot(ts: TSDataset, n_segments: int = 10, lags: int = 21, partial: bool = False, columns_num: int = 2, segments: Optional[List[str]] = None, figsize: Tuple[int, int] = (10, 5))[source]¶
Autocorrelation and partial autocorrelation plot for multiple timeseries.
Notes
Definition of autocorrelation.
Definition of partial autocorrelation.
If
partial=False
function works with NaNs at any place of the time-series.if
partial=True
function works only with NaNs at the edges of the time-series and fails if there are NaNs inside it.
- Parameters
ts (TSDataset) – TSDataset with timeseries data
n_segments (int) – number of random segments to plot
lags (int) – number of timeseries shifts for cross-correlation
partial (bool) – plot autocorrelation or partial autocorrelation
columns_num (int) – number of columns in subplots
segments (Optional[List[str]]) – segments to plot
figsize (Tuple[int, int]) – size of the figure per subplot with one segment in inches
- Raises
ValueError: – If partial=True and there is a NaN in the middle of the time series