1
在某些情況下,我必須手工做預測,這意味着使用模型的公式。對於AR(p)模型,這很容易。但對於ARIMA模型(p,d,q),d> = 1,我有點困難。 下面的例子,我用模型AR(2)計算。我有系列2090至10年,我需要預測的2011:ARIMA模型的計算公式?
> a<-c(198,150,120,84,150,136,80,128,160,132,144,234,300,312,400,468,420,500,650,612,516)
> series<-ts(a,frequency=1,start=c(1990))
> fit<-Arima(series,c(2,0,0),method="ML")
> fit
Series: series
ARIMA(2,0,0) with non-zero mean
Coefficients:
ar1 ar2 intercept
1.1923 -0.2881 305.3748
s.e. 0.2174 0.2346 111.5251
sigma^2 estimated as 3727: log likelihood=-117.2
AIC=242.4 AICc=244.9 BIC=246.58
我接收模型AR(2)的計算式:
y[t]=305.3748+1.1923*y[t-1]-0.2881*y[t-2]
我藉此爲2011預測:
y[2011] = 305.3748+1.1923*y[2010]-0.2881*y[2009]
= 305.3748+1.1923*516-0.2881*612
= 744
然而,當我適合ARIMA模型(2,1,0):
> fit2<-Arima(series,c(2,1,0),method="ML")
> fit2
Series: series
ARIMA(2,1,0)
Coefficients:
ar1 ar2
0.2561 -0.3494
s.e. 0.2196 0.2117
sigma^2 estimated as 3489: log likelihood=-110.1
AIC=226.2 AICc=227.7 BIC=229.19
當d = 1時,我不知道如何寫公式? 還有一個問題,爲什麼當我用功能forecast()
進行預測時,結果與我用公式計算時不同 -
> forecast(fit,h=1)
Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
2011 468.1754 389.9369 546.4138 348.52 587.8308
非常感謝@ mra68 :) –