# NOT RUN {
# }
# NOT RUN {
m <- seas(AirPassengers)
series(m, "fct") # re-evaluate with the forecast spec activated
# more than one series
series(m, c("rsd", "fct"))
m <- seas(AirPassengers, forecast.save = "fct")
series(m, "fct") # no re-evaluation (much faster!)
# using long names
series(m, "forecast.forecasts")
# history spec
series(m, "history.trendestimates")
series(m, "history.sfestimates")
series(m, "history.saestimates")
series(m, c("history.sfestimates", "history.trendestimates"))
# slidingspans spec
series(m, "slidingspans.sfspans")
series(m, "slidingspans.tdspans")
# fundamental identities of seasonal adjustment
# Y = T * I * (S * TD)
all.equal(AirPassengers, series(m, "seats.trend") *
series(m, "seats.irregular") * series(m, "seats.adjustfac"))
# Y_sa = Y / (S * TD)
all.equal(final(m), AirPassengers / series(m, "seats.adjustfac"))
### Some X-13ARIMA-SEATS functions can be replicated in R:
# X-13ARIMA-SEATS spectrum
plot(series(m, "spectrum.specorig")[,-1], t = "l")
# R equivalent: spectrum from stats
spectrum(diff(log(AirPassengers)), method = "ar")
# X-13ARIMA-SEATS pacf
x13.pacf <- series(m, "identify.pacf")
plot(x13.pacf[,1], t = "h")
lines(x13.pacf[,2])
lines(-x13.pacf[,2])
# R equivalent: pacf from stats
pacf(AirPassengers, lag.max = 35)
# }
Run the code above in your browser using DataLab