Skip to content

Instantly share code, notes, and snippets.

@mvervuurt
Created August 28, 2019 11:44
Show Gist options
  • Save mvervuurt/3d2a65b609b58a8b1a41c0c0d1411012 to your computer and use it in GitHub Desktop.
Save mvervuurt/3d2a65b609b58a8b1a41c0c0d1411012 to your computer and use it in GitHub Desktop.
Python statsmodels autocovariance, autocorrelation and partial autocorrelation
# Remember that there are slightly different formulas for weakly stationary and strictly stationary time series
from statsmodels.tsa.stattools import acovf,acf,pacf,pacf_yw,pacf_ols
from statsmodels.graphics.tsaplots import plot_acf,plot_pacf
# Lag plots
from pandas.plotting import lag_plot
lag_plot(df1['Thousands of Passengers']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment