我的时间序列数据包括日期时间和温度列,如下所示:
rn25_29_o:
ambtemp dt
1 -1.96 2007-09-28 23:55:00
2 -2.02 2007-09-28 23:57:00
3 -1.92 2007-09-28 23:59:00
4 -1.64 2007-09-29 00:01:00
5 -1.76 2007-09-29 00:03:00
6 -1.83 2007-09-29 00:05:00
我使用中值平滑函数来增强由于测量不精确而导致的小波动。
unique_timeStamp <- make.time.unique(rn25_29_o$dt)
temp.zoo<-zoo(rn25_29_o$ambtemp,unique_timeStamp)
m.av<-rollmedian(temp.zoo, n,fill = list(NA, NULL, NA))
随后,中值平滑的输出用于构建时间模型并通过使用以下代码实现预测:
te = (x.fit = arima(m.av, order = c(1, 0, 0)))
# fit the model and print the results
x.fore = predict(te, n.ahead=50)
最后,我遇到了以下错误:
seq.default(head(tt,1),tail(tt、1),delta)中出错:'by'
争论太小了
仅供参考:通过使用原始时间序列数据,建模和预测功能可以正常工作。
请引导我克服这个错误。