I have a data series that has a seasonal component, a trend and an arma part. I want to forecast this series based on history.
I can use the procedure
data_ts <- ts(data, frequency = 24)
data_deseason <- stl(data_ts, t.window=50, s.window='periodic', robust=TRUE)
f <- forecast(data_deseason, method='arima', h = N)
but in doing this I am not able to choose the parameters of the Arima part, which I would like to. The above seems to be using something like auto.arima as i chooses the arima parameters by itself - but it runs really fast and much faster than auto.arima - so not sure what happens.
Alternatively I can use the above to split the data into a season a trend and a remainder part. But then how do I forecast it? Should I make an arma model for both the trend and the remainder?
trend_arima <- Arima(data_deseason$time.series[,'trend'], order = c(1,1,1))
remainder_arima <- Arima(data_deseason$time.series[,'remainder'], order = c(1,1,1))
and then use forecast() and add the two above components and the season. Or is there some way to extract the trend model that stl has found?
Thanks for any hints :) Benjamin
stl
'decomposes a time series into seasonal, trend and irregular components using loess' (local regression), see?stl
. Thus, this is no ARIMA model. If you know that your time series follows an ARIMA process with seasonality and trend, why don't you fit a seasonal ARIMA model and difference the data accordingly? See e.g. otexts.org/fpp/8/9. If STL or ARIMA performs better is up to interpretation/testing. - thie1e