Skip to content

Instantly share code, notes, and snippets.

@christophsax
Created June 9, 2021 11:23
Show Gist options
  • Save christophsax/63830c8ed9e1fcc794847d34b03e4792 to your computer and use it in GitHub Desktop.
Save christophsax/63830c8ed9e1fcc794847d34b03e4792 to your computer and use it in GitHub Desktop.
library(seasonal)
# basic use
m <- seas(AirPassengers)
summary(m)
# understanding the defaults
?seas
# some methods
final(m)
fivebestmdl(m)
plot(m)
monthplot(m)
out(m)
spc(m)
identify(m)
# compare with stl from stats
m0 <- stl(AirPassengers, "per")
plot(m0)
r.adj <- AirPassengers - m0$time.series[, 'seasonal']
plot(m)
lines(r.adj, col = "blue")
# invoke 'spec.argument' through the ...
seas(AirPassengers, force.type = "denton") # force equality of annual values
seas(AirPassengers, x11 = "") # use x11 instead of 'seats'
# static replication of 'm <- seas(AirPassengers)'
static(m)
# generic extractor function X-13 series
series(m, "forecast.forecasts")
series(m, "history.trendestimates")
# keeping output of X-13 in a user defined directory
seas(AirPassengers, dir = "~/mydir")
# user defined regressors
myseries <- genhol(cny, start = 0, end = 0, center = "calendar")
m1 <- seas(
imp,
xreg = myseries,
regression.aictest = "td",
regression.usertype = "holiday"
)
summary(m1)
# GUI
view(m)
# X-13 diagnostical output
out(m)
# Multi-mode
seas(cbind(mdeaths, fdeaths))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment