I am using the arch package in python to fit a GARCH(1,1) to fit daily S&P 500 returns from 1990 to 2017 (about 6800 data points). The code I am using is as follows:
sp500 = pd.read_csv('sp.csv', index_col=0, parse_dates=True, squeeze=True)
sp500 = (np.log(sp500) - np.log(sp500.shift(1))).dropna()[::-1]
from arch import arch_model
garch11 = arch_model(sp500, p=1, q=1)
res = garch11.fit(update_freq=10)
print res.summary()
Even for just 50 data points, the solver fails to converge, citing
The optimizer returned code 8. The message is:
Positive directional derivative for linesearch
See scipy.optimize.fmin_slsqp for code meaning. ConvergenceWarning)
It seems ridiculous that it can't fit 50 data points. Are there any tweaks to get this working?