Last active
August 29, 2019 05:47
-
-
Save mvervuurt/ec64f9a220322113bd3c6945ab055fda to your computer and use it in GitHub Desktop.
Python statsmodels Time Series Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ljung-Box test for no autocorrelation | |
statsmodels.stats.diagnostic.acorr_ljungbox() | |
# Augmented Dickey-Fuller unit root test | |
statsmodels.tsa.stattools.adfuller() | |
# Kwiatkowski-Phillips-Schmidt-Shin test for stationarity. | |
statsmodels.tsa.stattools.kpss() | |
from statsmodels.tsa.stattools import ccovf,ccf,periodogram | |
from statsmodels.tsa.stattools import adfuller,kpss,coint,bds,q_stat,grangercausalitytests,levinson_durbin | |
from statsmodels.tools.eval_measures import mse, rmse, meanabs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from statsmodels.graphics.tsaplots import month_plot,quarter_plot
month_plot(df['Thousands of Passengers']);
dfq = df['Thousands of Passengers'].resample(rule='Q').mean()
quarter_plot(dfq);