Breaking Examples (and Possible Solutions) - christophsax/seasonal GitHub Wiki

This is a collection of non-working calls. Only post reproducible examples including the data (use dput to include a time series). Solutions will be posted if present.

The goal is to use these tricks in a function robust.seas which can be used like seas but will always work.

With Solution

increasing estimate.maxiter

A relatively frequent error occurs with the following message:

- Estimation failed to converge for automatically identified
  model when convergence tolerence reset to 0.100000E-04. Rerun
  program trying one of the following: Allow more iterations
  (set a larger value of maxiter).Try a different model or
  different modeling options.  See Section 5 of the
  X-13ARIMA-SEATS Reference Manual for more discussion.

This can be usually resolved by increasing estimate.maxiter. The default is 1500.

x <- structure(c(19417.3928571429, 45972.2666666667, 32022.0666666667, 28879.9666666667, 54809.3333333333, 30519.1333333333, 35770.3, 55299.6666666667, 36442.3333333333, 29105.6333333333, 81848.8666666667, 19724.1, 43769.9285714286, 52962.8333333333, 36452.4666666667, 53843.8333333333, 53915.8666666667, 72668.5, 25476.2666666667, 34662.4333333333, 33834.9333333333, 19594.4, 16672.9333333333, 31796.4, 35283.7857142857, 41425.9333333333, 36978.5, 51590.0333333333, 42310.0333333333, 19611.2666666667, 52798.9, 53071.3666666667, 37243.4, 36889.8, 44344.3333333333, 61687.6, 20538.4137931034, 60844.7666666667, 32238.9, 77784.7, 44554.7333333333, 68849.3, 106992.433333333, 70492.2333333333, 34431.3, 38312.5666666667, 74304.3666666667, 14250.8, 54351.6428571429, 58852.1666666667, 62319.0333333333, 59778, 75861.4, 85470.4333333333, 71769.4, 77430.3, 72673.8, 123107.066666667, 82854.5, 83784.3, 108406.071428571, 94750.5333333333, 52229.0666666667, 97035.9666666667, 113617.033333333, 112633.4, 127362.366666667, 137018.133333333, 145378.533333333, 169994.5, 139293.633333333, 132820.766666667, 198369.142857143, 172950.466666667, 121245.033333333, 194360.933333333, 209015.133333333, 151824.133333333, 220533.3, 186770.7, 193123.533333333, 237052.3, 247668.8, 152692.366666667, 321633.379310345, 273340.966666667, 322115.333333333, 283810.733333333, 363098, 391152.8, 359816.933333333, 408162.966666667, 328136.566666667, 436230.966666667, 478174.233333333, 398249.066666667, 363322.75, 479312.433333333, 497511.733333333, 546064.633333333, 448807.466666667, 565908.766666667, 375429.8, 387245.8, 418897.066666667, 510947.433333333, 415386.133333333, 523388.166666667, 411543.5, 444851.4, 389457.8, 523729.833333333, 497049.733333333, 430838.3, 550301, 469251.533333333, 496916.1, 410737.733333333, 562960.6, 379367.233333333, 500492.035714286, 506790.633333333, 529261.2, 534482.8, 560861.333333333, 556543.366666667, 440261.233333333, 609776.633333333, 538758.566666667), .Tsp = c(2005.08333333333, 2015.75, 12), class = "ts")

# not working
seas(x)

# working
seas(x, estimate.maxiter = 3000)

Using X11 instead of SEATS

Some ugly errors can be avoided by using X11 instead of SEATS. Here, the series i

Error: X-13 has run but produced no data
a1 <- structure(c(5479.1, 5536.7, 5641.8, 5663.3, 5557.9, 5493.7, 5695.4, 5817.9, 5606, 5300, 4788.9, 5603.3, 6380, 5630, 5700, 5700, 5550, 5830, 5860, 5900, 5620, 5850, 5680, 5940, 5650, 5720, 5730, 5040, 5070, 5450, 5590, 6000, 5360, 5520, 5630, 5440), .Tsp = c(1984, 1992.75, 4), class = "ts")

# not working
seas(a1)

# working
seas(a1, x11 = "")

Here, X-13 hangs forever:

library(seasonal)
myseries <- ts(c(98.8, 99.2, 99.3, 99.9, 99.7, 99.1, 99.4, 99.5, 100.1, 
            100.1, 99.9, 100.9, 100.7, 100.3, 99.8, 98.4, 98.2, 98.1, 98.5, 
            99.1, 100.3, 101.2, 100.5, 99.8, 100.9, 102, 102.9, 104, 104.4, 
            104.8, 104.6, 104, 102.7, 102, 101.9, 102.8, 102.2, 101.3, 101.1, 
            101, 101.5, 101.3, 101, 101.1, 101, 101.3, 101.6, 101.5, 101.2, 
            101.3, 101.6, 101.6, 101.2, 101, 101.1, 101.2, 101.2, 102.1, 
            101.6, 101.5, 102.4, 102.1, 102.6, 103, 103.6, 104.4, 104.3, 
            104.5, 106.2, 106.6, 106.9, 107.8, 106.3, 106.4, 105.8, 105.3, 
            105.1, 104.5, 104.4, 103.8, 101.4, 99.6, 99.5, 98.3, 99.4, 99.2, 
            98.9, 99, 99, 98.9, 99.3, 99.5, 100.6, 102.1, 102.1, 102.9, 102.4, 
            102.7, 102.7, 102.3, 102.3, 103, 102.8, 103.8, 105, 104.4, 104.1, 
            104.3, 104.3, 104.3, 104.7, 105.5, 105.9, 105.8, 106.1, 105.4, 
            103.8, 104.2, 104.6, 103.3), start = c(2002, 3), f = 12)
seas(x = myseries, outlier = NULL)

But using x11 solves the problem:

seas(x = myseries, outlier = NULL, x11 = "")

Also, not setting outlier = NULL:

seas(x = myseries)

Without Solution