Description Usage Arguments Details Value See Also Examples
robust.seas has exactly the same usage as seas, the main
function of seasonal, but will always work. If seas is failing,
robust.seas tries an an alternative specification, and returns a
message. robust.seas currently works with all 3000+ series of the M3
forecast competition.
1 |
... |
arguments passed on to |
If seas fails, robust.seas tries the following:
adjusting invalid start year
increasing maxiter to 10000 (if suggested in the error)
switch to X-11
fix model to (0 1 1)(0 1 1)
turn off AIC testing
turn off outlier detection
If robust.seas is applied to annual series (in which case you do not
need seasonal adjustment), it will proceed slightly different:
adjusting invalid start year
ensure SEATS, X11 and AIC testing are off
turn off outlier detection
fix model to (1 1 0)
If it still fails, it will return an error, along with the suggestion to post the example on: https://github.com/christophsax/seasonal/wiki/Breaking-Examples-(and-Possible-Solutions).
returns an object of class "seas".
seas for the main function of seasonal.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
x <- ts(1:40) # an annual time series with an invalid start year
# not working
seas(x)
# working
robust.seas(x)
### X-13 in the IJF-M3 forecast competition
# Original analysis by Peter Ellis
# http://ellisp.github.io/blog/2015/12/21/m3-and-x13/
library(Mcomp) # IJF-M3 forecast competition data
library(parallel) # part of R base, but needs to be loaded
# using cluster parallelization, which also works on Windows
# (on Linux and Mac, you could simply use mclapply)
# a) set up cluster
cl <- makeCluster(detectCores())
# b) load 'seasonal' and 'Mcomp' for each node
clusterEvalQ(cl, {library(seasonal); library(Mcomp)})
# c) run in parallel (60 sec on an older Macbook Pro with 8 cores)
ff <- function(e){
m <- robust.seas(e$x, forecast.save = "fct", forecast.maxlead = 18, seats = NULL)
series(m, "forecast.forecasts")[, 1]
}
lx13 <- parLapply(cl, M3, ff)
# d) stop the cluster
stopCluster(cl)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.