subset: Subsetting data into training and testing sets

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/tspred.r

Description

subset is a generic function for subsetting time series data into training and testing sets. The function invokes particular methods which depend on the class of the first argument.

Usage

1
2
3
4
subset(obj, ...)

## S3 method for class 'tspred'
subset(obj, data = NULL, ...)

Arguments

obj

An object of class tspred defining a particular time series prediction process.

...

Other parameters passed to the method preprocess of object subsetting from obj.

data

A list of time series to be transformed.

Details

The function subset.tspred calls the method preprocess on the subsetting object from obj. The produced training and testing sets of time series data are introduced in the structure of the tspred class object in obj.

Value

An object of class tspred with updated structure containing the produced training and testing sets of time series data.

Author(s)

Rebecca Pontes Salles

See Also

[tspred()] for defining a particular time series prediction process, and [subsetting()] for defining a time series subsetting transformation.

Other preprocess: postprocess.tspred(), preprocess.tspred()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data(CATS)

#Obtaining objects of the processing class
proc1 <- subsetting(test_len=20)
proc2 <- BoxCoxT(lambda=NULL)

#Obtaining objects of the modeling class
modl1 <- ARIMA()

#Obtaining objects of the evaluating class
eval1 <- MSE_eval()

#Defining a time series prediction process
tspred_1 <- tspred(subsetting=proc1,
                   processing=list(BCT=proc2),
                   modeling=modl1,
                   evaluating=list(MSE=eval1)
)
summary(tspred_1)

tspred_1_subset <- subset(tspred_1, data=CATS[3])

TSPred documentation built on Jan. 21, 2021, 5:10 p.m.