checkresiduals {forecast} | R Documentation |
Check that residuals from a time series model look like white noise
Description
If plot=TRUE
, produces a time plot of the residuals, the
corresponding ACF, and a histogram. If test
is not FALSE
,
the output from either a Ljung-Box test or Breusch-Godfrey test is printed.
Usage
checkresiduals(object, lag, test, plot = TRUE, ...)
Arguments
object |
Either a time series model, a forecast object, or a time series (assumed to be residuals). |
lag |
Number of lags to use in the Ljung-Box or Breusch-Godfrey test.
If missing, it is set to |
test |
Test to use for serial correlation. By default, if |
plot |
Logical. If |
... |
Other arguments are passed to |
Value
None
Author(s)
Rob J Hyndman
See Also
Examples
fit <- ets(WWWusage)
checkresiduals(fit)