plot_pacf
method plot_pacf(columns=None, nlags=None, method="ywadjusted", plot_interval=True, title=None, legend="upper right", figsize=None, filename=None, display=True)[source]
Plot the partial autocorrelation function.
The partial autocorrelation function (PACF) measures the correlation between a time series and lagged versions of itself, after removing the effects of shorter lagged values. In other words, it represents the correlation between two variables while controlling for the influence of other variables. PACF can help to identify the order of the autoregressive (AR) process in a time series model. This plot is only available for forecast tasks.
Parameters |
columns: int, str, segment, sequence, dataframe or None, default=None
Columns to plot the pacf from. If None, it selects the
target column.
nlags: int or None, default=None
Number of lags to return autocorrelation for. If None, it
uses
method : str, default="ywadjusted"min(10 * np.log10(len(y)), len(y) // 2 - 1) . The
returned value includes lag 0 (i.e., 1), so the size of the
vector is (nlags + 1,) .
Specifies which method to use for the calculations.
plot_interval: bool, default=True
Whether to plot the 95% confidence interval.
title: str, dict or None, default=None
Title for the plot.
legend: str, dict or None, default="upper right"
Legend for the plot. See the user guide for
an extended description of the choices.
figsize: tuple or None, default=None
Figure's size in pixels, format as (x, y). If None, it
adapts the size to the number of lags shown.
filename: str, Path or None, default=None
Save the plot using this name. Use "auto" for automatic
naming. The type of the file depends on the provided name
(.html, .png, .pdf, etc...). If
display: bool or None, default=Truefilename has no file type,
the plot is saved as html. If None, the plot is not saved.
Whether to render the plot. If None, it returns the figure.
|
Returns | {#plot_pacf-go.Figure or None}
go.Figure or None
Plot object. Only returned if display=None .
|
See Also
Plot the autocorrelation function.
Plot the trend, seasonality and residuals of a time series.
Plot a data series.
Example
>>> from atom import ATOMForecaster
>>> from sktime.datasets import load_airline
>>> y = load_airline()
>>> atom = ATOMForecaster(y, random_state=1)
>>> atom.plot_pacf()