I'm modelling a time series data using ARIMA. Now, I'm trying to test for the serial correlation of my model SARIMA(1,1,1) using the durbin watson test.
My problem is that I don't know what linear model I would put on the formula of the
dwtest function in R. Here's the usage of the function,
dwtest(formula, order.by = NULL, alternative = c("greater", "two.sided", "less"), iterations = 15, exact = NULL, tol = 1e-10, data = list())
Here's my code below,
To download the data just right click the link and click "Save Link As..."
library(forecast) library(lmtest) ChickenProd <- ts(ChickenProd, start = 1980, frequency = 4) SARIMA111 <- Arima(ChickenProd, seasonal = list(order = c(1,1,1), period = 4))
The residuals of my model SARIMA111 is obtain by
Now, I want to test the serial correlation of it using the Durbin-Watson test, but I don't know what linear model I would use in the
formula argument of
dwtest function in R. Is it the SARIMA(1,1,1) model? If so, how will I extract the coefficients of the SARIMA(1,1,1) model, and make a linear model formula in R?
Thank you in Advance!