A generic function to plot time-series diagnostics.
tsdiag(object, gof.lag, ...)
a fitted time-series model
the maximum number of lags for a Portmanteau goodness-of-fit test
further arguments to be passed to particular methods
This is a generic function. It will generally plot the residuals,
often standardized, the autocorrelation function of the residuals, and
the p-values of a Portmanteau test for all lags up to
The methods for
plots residuals scaled by the estimate of their (individual) variance,
and use the Ljung–Box version of the portmanteau test.
None. Diagnostics are plotted.
require(graphics) fit <- arima(lh, c(1,0,0)) tsdiag(fit) ## see also examples(arima) (fit <- StructTS(log10(JohnsonJohnson), type = "BSM")) tsdiag(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.