[R] Forecast

1stone p.debski at gmx.net
Thu May 31 17:56:35 CEST 2012


#---------------------------------------------------------------------------------------------------------
USDEUR.xts<-xts(USDEUR[,2:3], # columns with data
             USDEUR$Date) # column with date/time index

USDEUR_sample.xts<-window(USDEUR.xts,end=as.Date("2012-03-25"))
nobs<-length(USDEUR_sample.xts$Value)

arima111_2<-arima(USDEUR_sample.xts$Value,  # variable
                  order=c(1,1,1),  # (p,d,q) parameters
                  xreg=1:nobs # additional regressors - here: linear trend
                  )
fore_111 <- predict(arima111_2, n.ahead=5, 
                   newxreg=(nobs+1):(nobs+5)) # using xreg in model
estimation
#---------------------------------------------------------------------------------------------------------

Problem is that forecast starts at 1184. But my sample ends at 169. I would
like to let start the forecast at 170, but I have no idea where to change
this detail in the above code.  Any idea?

--
View this message in context: http://r.789695.n4.nabble.com/Forecast-tp4631964.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list