pastas.plotting.plots.acf#
- pastas.plotting.plots.acf(series: pandas.Series, alpha: float = 0.05, lags: int = 365, acf_options: dict | None = None, smooth_conf: bool = True, color: str = 'k', ax: pastas.typing.Axes | None = None, figsize: tuple = (5, 2)) pastas.typing.Axes#
Plot of the autocorrelation function of a time series.
- Parameters:
series (pandas.Series) – Residual series to plot the autocorrelation function for.
alpha (float, optional) – Significance level to calculate the (1-alpha)-confidence intervals. For 95% confidence intervals, alpha should be 0.05.
lags (int, optional) – Maximum number of lags (in days) to compute the autocorrelation for.
acf_options (dict, optional) – Dictionary with keyword arguments passed on to pastas.stats.acf.
smooth_conf (bool, optional) – For irregular time series the confidence interval may be.
color (str, optional) – Color of the vertical autocorrelation lines.
ax (matplotlib.axes.Axes, optional) – Matplotlib Axes instance to plot the ACF on. A new Figure and Axes is created when no value for ax is provided.
figsize (tuple, optional) – 2-D Tuple to determine the size of the figure created. Ignored if ax is also provided.
- Returns:
ax
- Return type:
Examples
>>> res = pd.Series(index=pd.date_range(start=0, periods=1000, freq="D"), >>> data=np.random.rand(1000)) >>> ps.plots.acf(res)
- Raises:
Warning if the ACF is empty. The plot will still be created to ensure that scripts –
will still run when dealing with many models. –