random forest, bagging, time series code