m <- seas(AirPassengers)
summary(m)
# 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 the automatic procedures
seas(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(m) # this also tests the equivalence of the static call
static(m, test = FALSE) # no testing (useful for debugging)
static(m, coef = TRUE) # also fixes the coefficients
# extractor functions
final(m)
original(m)
resid(m)
coef(m)
# five best models
fivebestmdl(m)
# replicating the default plots in Win X-13
plot(m)
plot(m, trend = TRUE)
monthplot(m)
monthplot(m, choice = "irregular")
spectrum(diff(final(m)) )
spectrum(diff(original(m)))
residplot(m)
# 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)
# input and output from and to X-13ARIMA-SEATS
spc(m) # analyzing the .spc file (for debugging)
out(m) # display the .out file (see ?out, for details)
# NA handling
AirPassengersNA <- window(AirPassengers, end = 1962, extend = TRUE)
final(seas(AirPassengersNA, na.action = na.omit)) # no NA in final series
final(seas(AirPassengersNA, na.action = na.exclude)) # NA in final series
# final(seas(AirPassengersNA, na.action = na.fail)) # fails
# inspect tool
inspect(m)
Run the code above in your browser using DataLab