xyplot.Arima: Diagnostic Plots for ARIMA Models

View source: R/xyplot.Arima.R

xyplot.ArimaR Documentation

Diagnostic Plots for ARIMA Models

Description

Diagnostic plots modelled after stats::tsdiag() with some modifications and corrections of p-values in the Box–Ljung test.

Usage

## S3 method for class 'Arima'
xyplot(
  x,
  data = NULL,
  which = 1:4,
  lag.max = NULL,
  gof.lag = NULL,
  qq.aspect = "iso",
  na.action = na.pass,
  main = NULL,
  layout = NULL,
  ...
)

Arguments

x

A fitted time-series model of class Arima.

data

Ignored

which

A sequence of integers between 1 and 4, identifying the plots to be shown.

lag.max

Number of lags to compute ACF for.

gof.lag

The maximum number of lags for the Ljung–Box test.

qq.aspect

Aspect of Q-Q plot (see lattice::qqmath()).

na.action

Treatment of NAs.

main

Optional titles for the plots. Can also be TRUE, in which case a default list of titles will be added.

layout

Either a numeric vector with (columns, rows) to use in the call to gridExtra::grid.arrange(), or a layout matrix which will then be passed as the layout_matrix in grid.arrange().

...

Parameters to pass to xyplot().

Value

Plots a lattice plot and returns a trellis object.

See Also

stats::tsdiag(), stats::arima(), lattice::xyplot(), gridExtra::grid.arrange(), stats::Box.test().

Examples

fit <- arima(lh, order = c(1, 1, 0))
xyplot(fit, layout = c(2, 2))
xyplot(fit, which = c(1:2, 4), layout = rbind(c(1, 1), c(2, 3)))

jolars/trelliswork documentation built on June 5, 2023, 11:52 a.m.