【问题标题】:X-13 Arima Seats with weekly data does not work每周数据的 X-13 Arima Seats 不起作用
【发布时间】:2018-07-11 23:48:35
【问题描述】:

我正在使用 R 并且我有每周数据(总共 660 次观察),我想使用季节性包中的 X-13 Arima-Seats 来对我的数据进行季节性调整。我将数据存储在 ts 对象中:

library(lubridate)
x <- ts(data, freq=365.25/7, start=decimal_date(ymd("2004-02-01")))
library(seasonal)
x_sa <- seas(x)

但是,我得到了错误:

Error: X-13 run failed

Errors:
- Seasonal period too large. See Section 2.7 of the Reference Manual on program limits
- Expected argument name or "}" but found ".1785714285714"
- Time series could not be read due to previously found errors
- Expected specification name but found "}"
- Specify series before user-defined adjustments
- Need to specify a series to identify outliers

我也尝试了较短的时间,但错误仍然相同。

【问题讨论】:

  • 抱歉,不行。 X13-ARIMA-SEATS 只能按季度或按月进行。
  • 参考手册是here,它的第 2.8 节(不是 2.7)有限制:最大频率 = 12(每月)和最大点数 = 780。

标签: r time-series arima


【解决方案1】:

我会按月平均你的每周数据并运行以下 ts 对象:

ts(data, freq=12, start=c(2004,2))

您将失去一些数据粒度,转换为月而不是周,但季节性软件包至少能够处理您的数据。

【讨论】:

    【解决方案2】:

    尝试 STL(使用黄土进行季节和趋势分解)。您可以将它与任何类型的季节性一起使用,不仅是每月和每季度。

    它具有自动分解 mstl()。因此,对于您的数据,公式为:

    x_sa

    t.windows.window 函数有调整参数,您可以控制趋势周期和季节性组件的速度改变。 您可以从 Rob J Hyndman 和 George Athanasopoulos 的“预测:原则与实践”一书中获得更多详细信息。在“时间序列分解”部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多