14

I am working with multivariate financial time series data and having problems using the createTimeSlices function. I cannot find any use of the function except the one used by Max Kuhn. Can anybody help me in understanding the usage of the function?

Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
Panchacookie
  • 427
  • 1
  • 6
  • 22

1 Answers1

15

The documentation is being "improved" on this feature (in other words, it currently sucks). Another person contacted me recently about this and here is the example:

library(caret)
library(ggplot2)
data(economics)
myTimeControl <- trainControl(method = "timeslice",
                              initialWindow = 36,
                              horizon = 12,
                              fixedWindow = TRUE)

plsFitTime <- train(unemploy ~ pce + pop + psavert,
                    data = economics,
                    method = "pls",
                    preProc = c("center", "scale"),
                    trControl = myTimeControl)

Max

topepo
  • 13,534
  • 3
  • 39
  • 52
  • is timeslice doing time-series cross-validation? – William Chiu Aug 18 '15 at 03:25
  • 4
    Same here...is timeslice doing time-series cross-validation or do I have to partition via `createTimeSlices`first an then cross-validation? Thankx –  Nov 01 '15 at 23:07
  • 1
    Check out the diagram at the bottom of [this page](http://topepo.github.io/caret/splitting.html) for a good illustration on `createTimeSlices` – n1k31t4 Feb 02 '16 at 12:38
  • 1
    @n1k31t4: that page was renamed to [here](https://topepo.github.io/caret/data-splitting.html#data-splitting-for-time-series) – smci Nov 12 '19 at 01:14
  • 1
    The `createTimeSlices` doc has moved to [here](https://topepo.github.io/caret/data-splitting.html#data-splitting-for-time-series) – smci Nov 12 '19 at 06:49