Approach to time series problem (xgboost)

xgboost
time_series

#1

Hi,
I have a time series problem (price ~ time (by month)).
I have tried a simple HoltWinters and an xgboost model (month and observations id as variables).

Then I had the idea to try to add also the last five observations as seperate variables (so for each Xn which is the target variable I use the Xn-1…Xn-5 as idependent variables). Then I modelled this with xgboost again.

The last approach gives me quite better results and now I am wondering if this a valid approach to this kind of problems or there are some hidden dangers that I should be aware off.

Thanks for any comment!


#2

Dear Fedias,

I also did that. It is kind of an AR model. Check some literature on that.

Can you share your code?

Thank you.


#3

Fedias,

Try this

fit and forecast with auto.arima()

autoArimaFit <- auto.arima(tsData)

plot(forecast(autoArimaFit,h=20))

Fit and forecast with Arima()

arimaFit <- Arima(tsData,order=c(3,1,0))

plot(forecast(arimafit,h=20))

regards,
Tony