2016-06-18 4 views
0
m7 = arima(lill,order=c(0,0,1), 
      seasonal=list(order=c(1,0,0),period=22), 
      xreg=data.frame(lpGDP)) 

preds = predict(m7,n.ahead = 1, newxreg = 1) 

lill 개체에는 329 회의 관측이 있습니다. 330 관찰 대신에 마지막 관찰 328을 어떻게 예측할 수 있습니까? 고맙습니다.arima : ARIMA 시계열을 어떻게 얻을 수 있습니까?

답변

1

관찰 된 데이터를 예측하기 위해 predict 번으로 전화 할 필요는 없습니다. 다음을 할 수 있습니다 :

fitted_values <- lill - m7$residuals 

이것은 맞는 ARIMA 모델입니다. 3백28번째 값을 검사하기 위해, 당신의 데이터가없는

fitted_values[328] 

을, 그래서 R의 내장 데이터 장난감 데모로 LakeHuron을 설정하십시오.

fit <- arima(LakeHuron, order = c(2,0,0), xreg = time(LakeHuron) - 1920) 
fitted_values <- LakeHuron - fit$residuals 
ts.plot(LakeHuron) ## observed time series (black) 
lines(fitted_values, col = 2) ## fitted time series (red) 

toy

관련 문제