Hi all I'm trying to do one step ahead forecast. Lets say I have 1000 data and fit an ARIMA model with it and then I do a forecast for one period ahead. When I get more data I would like to forecast another step using the new data without having to reestimate all coefficients and so on...
This is my code but for some reason it's very slow for a bigger dataset and am not too sure that is doing what I want:
set.seed(1234)
y=ts(log(35+10*rnorm(1000)))
set.seed(4567)
new.data=ts(log(35+10*rnorm(10)))
library(forecast)
model = auto.arima(y)
onestep.for=forecast(model,h=1)
for (i in 1:10) {
data=c()
data=c(y,new.data[1:i])
newfit=Arima(data, model=model)
forec=forecast(newfit,h=1)
onestep.for=c(onestep.for,forec)
}