def check_acf(df):
df_num = df.select_dtypes(include=[np.float, np.int])
for index in df_num.columns:
plt.figure(figsize=(8,10))
if index in ['LOG_BULL_RETURN', 'LOG_BEAR_RETURN','RTISf', 'TOTAL_SCANNED_MESSAGES_DIFF', 'TOTAL_SENTIMENT_MESSAGES_DIFF']:
fig = sm.graphics.tsa.plot_acf(df_num[index][1:],lags=40)
plt.title(index)
elif index in ['LOG_BULL_BEAR_RATIO']:
fig = sm.graphics.tsa.plot_acf(df_num[index][2:],lags=40)
plt.title(index)
else:
fig = sm.graphics.tsa.plot_acf(df_num[index],lags=40)
plt.title(index)
return fig
# check adf test
评论列表
文章目录