bashtage/arch

arch_lm_test fails when the AR mean model is used.

borderite opened this issue · 1 comments

The arch_lm_test method in the class arch.univariate.base.ARCHModelResult fails if the mean model uses the AR model (p>0). It seems to me that the problem comes from "nan" at the top of resid2, but I am not too sure.

import scipy as sp
from arch import arch_model
Y = sp.stats.distributions.norm.rvs(size=1000)
model = arch_model(Y,
mean="AR", lags=1,
vol="GARCH",
rescale=True)
fit = model.fit()
print(fit.arch_lm_test())

Thanks.

Thanks.