I have a series of data that has a seasonal component, a trend, and part of the arm. I want to predict 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 at the same time, I cannot select the parameters of the Arima part that I would like. The above seems to use something like auto.arima, as I select the arima parameters on my own, but it works very fast and much faster than auto.arima, so I'm not sure what is going on.
As an alternative, I can use the above to split the season data by trend and the rest. But how can I predict this? Should I create an arm model for both the trend and the rest?
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))
then use the forecast () and add the two above components and the season. Or is there a way to extract the trend model found by stl?
Thanks for any tips :) Benjamin
source
share