m <- seas(AirPassengers)
summary(m)
# invoke X-13ARIMA-SEATS options as 'spec.argument' through the ... 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
# options can be entered as vectors
seas(AirPassengers, regression.variables = c("td1coef", "easter[1]"))
seas(AirPassengers, arima.model = c(0, 1, 1, 0, 1, 1))
seas(AirPassengers, arima.model = "(0 1 1)(0 1 1)") # equivalent
# 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 'm <- seas(AirPassengers)'
static(m) # this also tests the equivalence of the static call
static(m, test = FALSE) # no testing (much faster)
static(m, coef = TRUE) # also fixes the coefficients
# specific extractor functions
final(m)
original(m)
resid(m)
coef(m)
fivebestmdl(m)
out(m) # the X-13 .out file (see ?out, for details)
spc(m) # the .spc input file to X-13 (for debugging)
# universal extractor function for any X-13ARIMA-SEATS output (see ?series)
series(m, "forecast.forecasts")
# copying the output of X-13 to a user defined directory
seas(AirPassengers, dir = "~/mydir")
# user defined regressors (see ?genhol for more examples)
# 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)
# 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
# NA handling by X-13 (works with internal NAs)
AirPassengersNA[20] <- NA
final(seas(AirPassengersNA, na.action = na.x13))
# inspect tool
inspect(m)
Run the code above in your browser using DataLab