Basti
Basti

Reputation: 23

Reuse ts models once build in R to updated data set (forecast package)

I am quite new to R programming but I cant find anything about my Problem...

I would like to do some forecasting in R with the forecasting package from high resolution data (halfhourly data). I would like to have the forecast working online. That is why I think calculating a fit every single time is not very useful.

Therefore I like the method to pass the already fitted model to the Model and use it for new data:

fcast2 <- forecast ( Arima ( x = extendedSeries , model = oldArimaModel ), h = horizon )

But it does not really work with an HoltWinters model... (or a lm -model which is ok regarding what lm means)

fcastArima <- forecast(Arima(x= extendedseries , model=oldArimaFit),h=horizon)
fcastHoltWinters <- forecast(update(oldHWfit, x=extendedSereies), h=horizon)  

anyway, I would like to keep the code simple and I am looking for a more generic method to apply already fitted ts models to the updated data set.

Does anyone know how to do this?

Cheers

Upvotes: 2

Views: 1033

Answers (1)

Rob Hyndman
Rob Hyndman

Reputation: 31800

HoltWinters() is a very limited function. The ets() function will fit the same models, with better estimation, and will fit a much larger range of similar models. It also allows re-fitting to new data in the same way you are doing with Arima().

Upvotes: 2

Related Questions