ARCH效应检验
import pandas as pd
SHret=pd.read_table('TRD_IndexSum.txt', index_col='Trddt', sep='\t')
/Users/yaochenli/anaconda3/lib/python3.7/site-packages/ipykernel_launcher.py:1: FutureWarning: read_table is deprecated, use read_csv instead.
"""Entry point for launching an IPython kernel.
SHret.index=pd.to_datetime(SHret.index)
SHret.head()
Retindex
Trddt
2009-01-05
0.032904
2009-01-06
0.030004
2009-01-07
-0.006780
2009-01-08
-0.023821
2009-01-09
0.014205
import matplotlib.pyplot as plt
import numpy as np
plt.subplot(211)
plt.plot(SHret**2)
plt.xticks([])
plt.title('Squared Daily Return of SH Index')
plt.subplot(212)
plt.plot(np.abs(SHret))
plt.title('