bashtage / arch

ARCH models in Python
Other
1.34k stars 248 forks source link

arch_lm_test fails when the AR mean model is used. #599

Closed borderite closed 2 years ago

borderite commented 2 years ago

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.

bashtage commented 2 years ago

Thanks.