您可以使用以下功能提前预测predict()
:
> y=c(1,4,5,2,0,8,9,4,-3,-3)
> mymodel = arima(c(1,4,5,2,0,8,9,4,-3,-3) ,order=c(1,1,0),seasonal=list(order=c(1,1,0), period=2))
> mymodel
Call:
arima(x = c(1, 4, 5, 2, 0, 8, 9, 4, -3, -3), order = c(1, 1, 0), seasonal = list(order = c(1,
1, 0), period = 2))
Coefficients:
ar1 sar1
0.7368 -0.9169
s.e. 0.3696 0.1089
sigma^2 estimated as 11.25: log likelihood = -20.23, aic = 46.46
> predict(mymodel, n.ahead = 5)
$pred
Time Series:
Start = 11
End = 15
Frequency = 1
[1] -7.763438 -16.104376 -25.686464 -28.419524 -35.086436
$se
Time Series:
Start = 11
End = 15
Frequency = 1
[1] 3.354151 6.722215 10.392430 14.061929 19.640317
我缩短了周期,以便您的模型具有足够长的数据向量。