1
我是R新手。我試圖預測使用holt方法,但得到這個奇怪的錯誤。我使用R(版本3.2.5)和Rstudio(版本0.99.896)使用預測軟件包V-7.1。我重新安裝了所有從R到Rstudio,但沒有奏效。從1到10只有h工作。任何想法??預測軟件包R中的預測範圍問題
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
謝謝:)它的工作原理但是你能否向我解釋一下holt和包裝aTSA的「Holt」之間的區別。我應該爲我的數據使用哪一個都具有相同的MAPE值。 – Kal
兩者均實現[Holt的線性趨勢的指數平滑](https://www.otexts.org/fpp/7/2)。實施細節可能存在差異,但這些都不重要。去任何你想要的。 (我會試着更多地信任'forecast :: holt()'一小點*,因爲我認識它的作者Rob Hyndman並相信他的工作 - 我從未聽說過aTSA包的作者,也不能保證爲了他。) –