x <- seas(AirPassengers)
summary(x)
# invoke X-13ARIMA-SEATS options as 'spec.argument'
# (consult the X-13ARIMA-SEATS manual for many more options and the wiki for
# for more examples)
seas(AirPassengers, regression.aictest = c("td")) # no easter testing
seas(AirPassengers, force.type = "denton") # force equality of annual values
seas(AirPassengers, x11 = list()) # use x11, overrides the 'seats' spec
# turn off automatic procedures:
seas(x = AirPassengers, regression.variables = c("td1coef", "easter[1]",
"ao1951.May"), arima.model = "(0 1 1)(0 1 1)", regression.aictest = NULL,
outlier = NULL, transform.function = "log")
# static replication of the first call
static(x) # this also tests the equivalence of the static call
static(x, test = FALSE) # no testing (for debuging)
static(x, coef = TRUE) # also fixes the coefficients
# extractor functions
final(x)
original(x)
resid(x)
coef(x)
# five best models
fivebestmdl(x)
# replicating the default plots in Win X-13
plot(x)
plot(x, trend = TRUE)
monthplot(x)
monthplot(x, choice = "irregular")
spectrum(diff(final(x)) )
spectrum(diff(original(x)))
residplot(x)
# user defined regressors:
# a temporary level shift in R base
tls <- ts(0, start = 1949, end = 1965, freq = 12)
window(tls, start = c(1955, 1), end = c(1957, 12)) <- 1
seas(AirPassengers, xreg = tls, outlier = NULL)
# identical to a X-13ARIMA-SEATS specification of the the level shift
seas(AirPassengers, regression.variables = c("tl1955.01-1957.12"),
outlier = NULL)
# analyzing X-13ARIMA-SEATS input and output files (for debuging)
spc(x) # the .spc file, as generated by seas
mdl(x) # the .mdl file, as received by seas
x3 <- seas(AirPassengers, out = TRUE)
out(x3) # the full .out output from X-13ARIMA-SEATS (very long!)
# more components in a "seats" object
x$est$variance
x$lks
# standard NA handling with na.action
AirPassengersNA <- window(AirPassengers, start = c(1948, 6), end = c(1961, 4),
extend = TRUE)
final(seas(AirPassengersNA, na.action = na.omit)) # default
final(seas(AirPassengersNA, na.action = na.exclude))
# final(seas(AirPassengersNA, na.action = na.fail)) # fails
# inspection tool
inspect(AirPassengers)
Run the code above in your browser using DataLab