tsPartition: Generate training and test indices for time series cross...

Description Usage Arguments Value Author(s) Examples

View source: R/cvts.R

Description

Training and test indices are generated for time series cross validation. Generated indices are based on the training windowSize, forecast horizons and whether a rolling or non-rolling cross validation procedure is desired.

Usage

1
tsPartition(x, rolling, windowSize, maxHorizon)

Arguments

x

A time series

rolling

Should indices be generated for a rolling or non-rolling procedure?

windowSize

Size of window for training

maxHorizon

Maximum forecast horizon

Value

List containing train and test indices for each fold

Author(s)

Ganesh Krishnan

Examples

1
tsPartition(AirPassengers, rolling = TRUE, windowSize = 10, maxHorizon = 2)

forecastHybrid documentation built on Aug. 28, 2020, 9:08 a.m.