everyone。我剛開始學習時間系列。使用rts()函數分析CPI數據的奇怪結果
我有以下來自中國的月度CPI數據(2010.01 - 2015.12)。
我想使用ETS從R.
vector1 <- c(100.6, 101.2, 99.3, 100.2, 99.9, 99.4, 100.4, 100.6, 100.6, 100.7, 101.1, 100.5, 101.0, 101.2, 99.8, 100.1, 100.1, 100.3, 100.5, 100.3, 100.5, 100.1, 99.8, 100.3, 101.5, 99.9, 100.2, 99.9, 99.7, 99.4, 100.1, 100.6, 100.3, 99.9, 100.1, 100.8, 101.0, 101.1, 99.1, 100.2, 99.4, 100.0, 100.1, 100.5, 100.8, 100.1, 99.9, 100.3, 101.0, 100.5, 99.5, 99.7, 100.1, 99.9, 100.1, 100.2, 100.5, 100.0, 99.8, 100.3, 100.3, 101.2, 99.5, 99.8, 99.8, 100.0, 100.3, 100.5, 100.1, 99.7, 100.0, 100.5)
做一些預測與此數據()函數我試圖按照從下面的鏈接的過程: https://stats.stackexchange.com/questions/146098/ets-function-how-to-avoid-forecast-not-in-line-with-historical-data
的代碼是如如下:
train_ts<- ts(vector1, frequency=12)
fit2<-ets(train_ts, model="ZZZ", damped=TRUE, alpha=NULL, beta=NULL, gamma=NULL,
phi=NULL, additive.only=FALSE, lambda=TRUE,
lower=c(0.000,0.000,0.000,0.8),upper=c(0.9999,0.9999,0.9999,0.98),
opt.crit=c("lik","amse","mse","sigma","mae"), nmse=3,
bounds=c("both","usual","admissible"), ic=c("aicc","aic","bic"),
restrict=TRUE)
ets <- forecast(fit2,h=5,method ='ets')
plot(forecast(fit2))
lines(fit2$states[,1],col='red')
但是,我得到了下圖,看起來很奇怪。 我得到α= 0,β= 0和γ= 0 ...這似乎意味着我沒有趨勢,沒有季節性?
對不起,我有很多問題..
是否預測是否正確?我認爲這裏有些問題,但我無法弄清楚問題所在。
「fit2 $ states [,1]」代表什麼?紅線代表什麼?
非常感謝所有幫助那種..
然後我試圖使用數據矢量[1:43]的一部分。我得到的是...
非常感謝您的幫助!我正在使用最新版本的預測8.0。 –