Partition a time series object

splitts(y, split_prob = 0.5, return_indices = FALSE)

Arguments

y

A time series object

split_prob

Splitting ratio

return_indices

if TRUE, returns series' indices, otherwise, time series objects

Examples


misc::splitts(ts(1:10))
#> $training
#> Time Series:
#> Start = 1 
#> End = 5 
#> Frequency = 1 
#> [1] 1 2 3 4 5
#> 
#> $testing
#> Time Series:
#> Start = 6 
#> End = 10 
#> Frequency = 1 
#> [1]  6  7  8  9 10
#>