statsmodels.graphics.tsaplots.plot_pacf¶
-
statsmodels.graphics.tsaplots.
plot_pacf
(x, ax=None, lags=None, alpha=0.05, method='ywm', use_vlines=True, title='Partial Autocorrelation', zero=True, **kwargs)[source]¶ Plot the partial autocorrelation function
Plots lags on the horizontal and the correlations on vertical axis.
Parameters: x : array_like
Array of time-series values
ax : Matplotlib AxesSubplot instance, optional
If given, this subplot is used to plot in instead of a new figure being created.
lags : int or array_like, optional
int or Array of lag values, used on horizontal axis. Uses np.arange(lags) when lags is an int. If not provided,
lags=np.arange(len(corr))
is used.alpha : scalar, optional
If a number is given, the confidence intervals for the given level are returned. For instance if alpha=.05, 95 % confidence intervals are returned where the standard deviation is computed according to 1/sqrt(len(x))
method : ‘ywunbiased’ (default) or ‘ywmle’ or ‘ols’
specifies which method for the calculations to use:
- yw or ywunbiased : yule walker with bias correction in denominator for acovf
- ywm or ywmle : yule walker without bias correction
- ols - regression of time series on lags of it and on constant
- ld or ldunbiased : Levinson-Durbin recursion with bias correction
- ldb or ldbiased : Levinson-Durbin recursion without bias correction
use_vlines : bool, optional
If True, vertical lines and markers are plotted. If False, only markers are plotted. The default marker is ‘o’; it can be overridden with a
marker
kwarg.title : str, optional
Title to place on plot. Default is ‘Partial Autocorrelation’
zero : bool, optional
Flag indicating whether to include the 0-lag autocorrelation. Default is True.
**kwargs : kwargs, optional
Optional keyword arguments that are directly passed on to the Matplotlib
plot
andaxhline
functions.Returns: fig : Matplotlib figure instance
If ax is None, the created figure. Otherwise the figure to which ax is connected.
See also
matplotlib.pyplot.xcorr
,matplotlib.pyplot.acorr
,mpl_examples
Notes
Adapted from matplotlib’s xcorr.
Data are plotted as
plot(lags, corr, **kwargs)