1

This question is a duplicate from Stack Overflow but in the previous (now deleted version) there was a suggestion to ask it here because it concerns methods.

I’m fitting a regression with ARIMA errors with the fable package and as mentioned im my previous question the Breusch-Godfrey test is not available there.

The regression part of the model has two pairs of Fourier terms to account for yearly seasonality and several exogenous regressors. The residuals are modeled with a seasonal ARIMA(2,0,0)(1,0,0)[7] model. My goal is to check for autocorrelation in residuals.

Of course, I can use the Ljung-Box test but according to this thread and textbook sources there it will not be valid in presence of lags of the dependent variable.

And I’m afraid i will loose my model specification using different packages/libraries. An alternative might be to use Arima from the forecast package and retain model specification. Then use bgtest from lmtest package. But I can’t figure out how to do this.

According to this R forum the Breusch-Godfrey test for an ARIMA model can be done by fitting a simple regression of the residuals from the fitted model on a constant and then perform a bgtest. But it only concerns a simple AR(1) model with no exogenous regressors.

Is this the right way to do it? I’m concerned that for the BG test you have to perform an auxiliary regression on the regressors and lagged resuduals up to order p. How in this case the bgtest knows the X variables since they are not stored in the residuals object - this should be a simple vector.

Richard Hardy
  • 54,375
  • 10
  • 95
  • 219
  • I'm just asking myself: Is it the case that the Ljung-Box test is still valid in the case of exogenous regressors. Consider Hayashi (2000) pp146-147: "..when the regressors are not strictly exogenous we need to modify the Q statistics to restore its asymptotic distribution". Basically we only have to assume that that the error does not depend on the lagged regressors and they are conditionaly homoskedastic. I'm not a statistician by training (obvioulsy) but the proof looks straightforward to me.Thus using Ljung-Box test is justified and there is something wrong with the reasoning that it isn't – QuantumJazz Oct 14 '20 at 14:37

0 Answers0