1

I could not find an extension package that allows for resampling methods that are suitable for financial market/time series data (e.g. training the model on a "rolling window" or "growing window" and testing on the data points immediately after the training window. The book mentions extra packages generally but I could not find them yet. Can anyone help here?

ds_col
  • 129
  • 10

2 Answers2

2

There is a package mlr3forecasting that goes in this direction. It is however currently unfinished and lacks a maintainer. So, unfortunately, this is currently not directly supported for time-series. If you are interested in contributing I would gladly help out there.

Other than that, a simple CV method for classification/regression might come at some point if we can find time to work on it.

pfistfl
  • 311
  • 1
  • 2
  • Thank you. I saw that the mlr3forecasting package has the methods forecastHoldout and cv. This seems to be exactly what I need. But it is not yet available via CRAN. – ds_col Mar 12 '21 at 13:48
  • 1
    If, instead, I use rsmp("custom"), would I have to manually write something like `resampling1$instantiate(task, train=c(1:10), test=(11))` `resampling2$instantiate(task, train=c(1:11), test=(12))` ? Or is there a way to make "custom" to this automatically? – ds_col Mar 12 '21 at 13:56
2

according to https://mlr3forecasting.mlr-org.com/, it looks like there's a rolling-window cv, like the following:

task = tsk("petrol")
learner = LearnerRegrForecastVAR$new()
rr = rsmp("RollingWindowCV", folds = 5, fixed_window = F)
rr$instantiate(task)
resample = resample(task, learner, rr, store_models = TRUE)
resample$predictions()