2

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.

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.

QuantumJazz
  • 139
  • 9
  • I have added a similar question by implementing the B-G test for residuals from ARIMA-GARCH model here: https://stats.stackexchange.com/questions/512990/implementing-breusch-godfrey-test-in-r But, I am not really sure if my implementation is correct, so I have added some additional questions in that post. Please let me know if you were able to solve your problem above. – Chintan Rajvir Mar 09 '21 at 10:49
  • You may find useful to look at this thread: https://stats.stackexchange.com/questions/148004/testing-for-autocorrelation-ljung-box-versus-breusch-godfrey I may be wrong but it seems that you should be fine using Ljung-Box test instead as I did: https://stats.stackexchange.com/a/491951/299883 – QuantumJazz Mar 16 '21 at 12:17
  • Yes, it makes more sense to me now. Referring to answer from "javlacalle" also, for lower order lags, where `lags<=fitdf+1`, the LB test is performing poorly compared to Breusch-Godfrey test. However, I also parallelly could compute the auxiliary equation of the BG test and use it for the R package (code should stay same as in the link in my previous comment above). – Chintan Rajvir Mar 16 '21 at 12:37

0 Answers0