Generates train/test splits given a vector of dates and other options
time_splits(
x,
start = x[1],
test_length = 1,
by = test_length,
window_size = NULL,
calendar_end = NULL,
complete_index = TRUE,
...
)A list with each slot having the training dates and test dates
a vector of timestamps (POSIXct) or dates (Date) in the dataset
starting date (first estimation/train date)
type of calendar period to split on
every how many periods to split on
the size of the training set (for moving window). If NULL will use an expanding window.
an optional function to use for the period ending split,
such as calendar_eow, applied to x. This should be greater in
frequency than the underlying frequency of x (i.e. do not use calendar_eow on
monthly indices). This overwrites the use of window_size.
whether to return the full indices for train and test else just the start and end indices.
any additional parameters passed to the calendar_end function. For example, the “day” argument when using the calendar_eow function.
Alexios Galanos