testts: Cross-validated time series test set

Description Usage Arguments Details Value Examples

View source: R/testts.R

Description

Creates a cross-validated test set for a given number of time series iterations.

Usage

1
testts(data, cv_size, lead_time, keep_prev = FALSE)

Arguments

data

a dataframe with the time series data that the user wants to iterate.

cv_size

Numeric. Cross-validation window that the user want to test the performance of a model.

lead_time

Numeric. How many periods ahead (lead time) the user wants to predict.

keep_prev

Logical. Controls if the test set includes previous data when lead_time>2

Details

This function follows a tidy approach to create test sets applicable to time series data. It admits tsibble, tibble and data frame objects.

Value

a tibble with rows=iterations.

Examples

1
testts(rainfall, cv_size=6, lead_time=3, keep_prev=TRUE)

opoyc/fcsttools documentation built on Feb. 19, 2020, 12:52 p.m.