我在python中遇到了一个GARCH模型的问题。我的代码如下所示
import sys
import numpy as np
import pandas as pd
from arch import arch_model
sys.setrecursionlimit(1800)
spotmarket = pd.read_excel("./data/external/Spotmarket.xlsx", index=True)
l = spotmarket['Price'].pct_change().dropna()
returns = 100 * l
returns.plot()
plt.show()
model=arch_model(returns, vol='Garch', p=1, o=0, q=1, dist='Normal')
results=model.fit()
print(results.summary())
代码的第一部分效果很好。我在一个单独的excel表中有一天结束价格,并希望用GARCH模型对它们进行建模。问题是,我收到错误消息The optimizer returned code 9. The message is:
Iteration limit exceeded
See scipy.optimize.fmin_slsqp for code meaning.
有人有想法,我如何处理迭代限制的问题?谢谢!