One of the observations is labeled as volatility clustering, which means that high volatility is usually followed by a high-volatility period, while low volatility is usually followed by a low-volatility period. The following program shows this phenomenon by using S&P500 daily returns from 1988 to 2006. Note that, in the following code, in order to show 1988 on the x axis, we add a few months before 1988:
import numpy as np import matplotlib.pyplot as plt from matplotlib.finance import quotes_historical_yahoo_ochl as getData # ticker='^GSPC' begdate=(1987,11,1) enddate=(2006,12,31) # p = getData(ticker, begdate, enddate,asobject=True, adjusted=True) x=p.date[1:] ret = p.aclose[1:]/p.aclose[:-1]-1 # plt.title('Illustration of volatility clustering (S&P500)') plt.ylabel('Daily returns') plt.xlabel('Date') plt.plot(x,ret) plt.show()
This program is inspired by the graph drawn by M.P. Visser; refer to https://pure.uva.nl/ws/files/922823...