我正在尝试使用该seasonal::seas()
函数对我的时间序列数据进行季节性分解并绘制结果。autoplot()
将函数包装起来seas()
通常效果很好,但是对于下面的数据,我遇到了错误。我看过一些关于季节性分解的下标越界错误的帖子,但没有一个可以解决这个问题。该seas()
函数有警告Model used in SEATS is different: (1 1 2)
,但我不知道为什么会导致错误。解决此问题的任何帮助将不胜感激。
编码:
library(forecast)
library(seasonal)
data <- c(11666, 18526, 14955, 13791, 13508, 15682, 23039, 24190, 23628, 23411, 25068, 20204, 16084, 15726, 13677, 14668, 17915, 25673, 30529, 31990, 31334, 30129, 24323, 19584, 20827, 19766, 21886, 25119, 31832, 31032, 26647, 28725, 26160, 22611, 20698, 21711, 20014, 21698, 27068, 27181, 23442, 25894, 22482, 21894, 20365, 20078, 20995, 22959, 25745, 33074, 29875, 27740, 29499, 27302, 19854, 19658, 20850, 20130, 21415, 25808, 35240, 31326, 31128, 29594, 25660, 26359, 25723, 26995, 25283, 26823)
time_series <- ts(data, freq=12, start=c(2013, 10))
autoplot(seas(time_series))
产生错误:
Model used in SEATS is different: (1 1 2)
Error in `[.default`(object$data, , c("trend", "seasonal", "irregular")) :
subscript out of bounds