【发布时间】:2016-08-23 16:57:58
【问题描述】:
我是 R 新手。我试图使用 holt 方法进行预测,但遇到了这个奇怪的错误。我正在使用带有 R(版本 3.2.5)和 Rstudio(版本 0.99.896)的预测包 V-7.1。我将所有从 R 重新安装到 Rstudio,但没有工作。只有 h 从 1 到 10 有效。有什么想法吗??
library(forecast)
library(stats)
library(base)
x=data$cost
k<-holt(x,damped=TRUE)
m=forecast(k,h=20)
Error in forecast.forecast(k, h = 20) :
Please select a longer horizon when the forecasts are first computed
其他测试用例:
m=forecast(k,h=2000)
Error in forecast.forecast(k, h = 2000) :
Please select a longer horizon when the forecasts are first computed
m=forecast(k,h=10)
m=forecast(k,h=11)
Error in forecast.forecast(k, h = 11) :
Please select a longer horizon when the forecasts are first computed
m=forecast(k,h=100)
Error in forecast.forecast(k, h = 100) :
Please select a longer horizon when the forecasts are first computed
【问题讨论】:
标签: r forecasting prediction