plot=TRUE, produces a time plot of the residuals, the
corresponding ACF, and a histogram. If the degrees of freedom for the model
can be determined and
test is not
FALSE, the output from
either a Ljung-Box test or Breusch-Godfrey test is printed.
checkresiduals(object, lag, df = NULL, test, plot = TRUE, ...)
Either a time series model, a forecast object, or a time series (assumed to be residuals).
Number of lags to use in the Ljung-Box or Breusch-Godfrey test.
If missing, it is set to
Number of degrees of freedom for fitted model, required for the
Ljung-Box or Breusch-Godfrey test. Ignored if the degrees of freedom can be
Test to use for serial correlation. By default, if
Other arguments are passed to
Rob J Hyndman
fit <- ets(WWWusage) checkresiduals(fit)#> #> Ljung-Box test #> #> data: Residuals from ETS(A,Ad,N) #> Q* = 28.995, df = 5, p-value = 2.324e-05 #> #> Model df: 5. Total lags used: 10 #>