tsdiagplot {HH} | R Documentation |
Times series diagnostic plots for a structured set of ARIMA models.
Description
Times series diagnostic plots for a structured set of ARIMA models.
Usage
tsdiagplot(x,
p.max=2, q.max=p.max,
model=c(p.max, 0, q.max), ## S-Plus
order=c(p.max, 0, q.max), ## R
lag.max=36, gof.lag=lag.max,
armas=arma.loop(x, order=order,
series=deparse(substitute(x)), ...),
diags=diag.arma.loop(armas, x,
lag.max=lag.max,
gof.lag=gof.lag),
ts.diag=rearrange.diag.arma.loop(diags),
lag.units=ts.diag$tspar["frequency"],
lag.lim=range(pretty(ts.diag$acf$lag))*lag.units,
lag.x.at=pretty(ts.diag$acf$lag)*lag.units,
lag.x.labels={tmp <- lag.x.at
tmp[as.integer(tmp)!=tmp] <- ""
tmp},
lag.0=TRUE,
main, lwd=0,
...)
acfplot(rdal, type="acf",
main=paste("ACF of std.resid:", rdal$series,
" model:", rdal$model),
lag.units=rdal$tspar["frequency"],
lag.lim=range(pretty(rdal[[type]]$lag)*lag.units),
lag.x.at=pretty(rdal[[type]]$lag)*lag.units,
lag.x.labels={tmp <- lag.x.at
tmp[as.integer(tmp)!=tmp] <- ""
tmp},
lag.0=TRUE,
xlim=xlim.function(lag.lim/lag.units),
...)
aicsigplot(z, z.name=deparse(substitute(z)), series.name="ts",
model=NULL,
xlab="", ylab=z.name,
main=paste(z.name, series.name, model),
layout=c(1,2), between=list(x=1,y=1), ...)
residplot(rdal,
main=paste("std.resid:", rdal$series,
" model:", rdal$model),
...)
gofplot(rdal,
main=paste("P-value for gof:", rdal$series,
" model:", rdal$model),
lag.units=rdal$tspar["frequency"],
lag.lim=range(pretty(rdal$gof$lag)*lag.units),
lag.x.at=pretty(rdal$gof$lag)*lag.units,
lag.x.labels={tmp <- lag.x.at
tmp[as.integer(tmp)!=tmp] <- ""
tmp},
xlim=xlim.function(lag.lim/lag.units),
pch=16, ...)
Arguments
x |
Time series vector. |
p.max , q.max |
Maximum number of AR and MA arguments to use in the series of ARIMA models. |
model |
A valid S-Plus |
order |
A valid R The additional argument |
lag.max |
Maximum lag for the acf and pacf plots. |
gof.lag |
Maximum lag for the gof plots. |
armas |
An |
diags |
An |
ts.diag , rdal |
A list constructed as a rearranged |
lag.units |
Units for time series, defaults to |
lag.lim |
scaling for |
lag.x.at , lag.x.labels |
Location of ticks and labels for the acf and pacf plots. |
lag.0 |
Logical. If |
type |
|
z |
A matrix constructed as the |
z.name |
|
series.name |
Character string describing the time series. |
xlab , ylab , layout , between , pch , xlim , main , lwd |
Standard trellis arguments. |
... |
Additional arguments. |
Value
tsdiagplot
returns a "tsdiagplot"
object which is
a list of "trellis"
objects. It is printed with its own
print method.
The other functions return "trellis"
objects.
Author(s)
Richard M. Heiberger (rmh@temple.edu)
References
"Displays for Direct Comparison of ARIMA Models" The American Statistician, May 2002, Vol. 56, No. 2, pp. 131-138. Richard M. Heiberger, Temple University, and Paulo Teles, Faculdade de Economia do Porto.
Heiberger, Richard M. and Holland, Burt (2015). Statistical Analysis and Data Display: An Intermediate Course with Examples in R. Second Edition. Springer-Verlag, New York. https://link.springer.com/book/10.1007/978-1-4939-2122-5
See Also
Examples
data(tser.mystery.X)
X <- tser.mystery.X
X.dataplot <- tsacfplots(X, lwd=1, pch.seq=16, cex=.7)
X.dataplot
X.loop <- if.R(
s=
arma.loop(X, model=list(order=c(2,0,2)))
,r=
arma.loop(X, order=c(2,0,2))
)
X.dal <- diag.arma.loop(X.loop, x=X)
X.diag <- rearrange.diag.arma.loop(X.dal)
X.diagplot <- tsdiagplot(armas=X.loop, ts.diag=X.diag, lwd=1)
X.diagplot
X.loop
X.loop[["1","1"]]