【发布时间】:2016-03-15 11:47:05
【问题描述】:
我很确定我错过了一些非常简单但仍然无法弄清楚为什么会出现此错误的东西。 我拥有的数据是从 2013 年 4 月到 2014 年 3 月的每个月末数据。现在我想了解 12 个月期间的趋势。
xx <- structure(c(41.52, 41.52, 41.52, 41.68, 41.68, 41.68, 41.84,
41.84, 41.84, 42.05, 42.05, 42.05), .Tsp = c(2013.25, 2014.16666666667,
12), class = "ts");
是我的时间序列数据。 现在当我使用
stl(xx,s.window ="periodic")
我得到错误:
Error in stl(xx, s.window = "periodic") :
series is not periodic or has less than two periods
我不知道出了什么问题,因为我知道这个系列有 12 个时期。请协助
【问题讨论】:
-
您的时间序列太短。您至少需要两年(在您的情况下为两个时期)的数据。
标签: r time-series forecasting trend