Fits a SETAR-Tree model either using a list of time series or an embedded input matrix and labels.
setartree(
data,
label = NULL,
lag = 10,
depth = 1000,
significance = 0.05,
significance_divider = 2,
error_threshold = 0.03,
stopping_criteria = "both",
mean_normalisation = FALSE,
window_normalisation = FALSE,
verbose = 2,
categorical_covariates = NULL
)An object of class setartree which contains the following properties.
Trained global pooled regression models in each leaf node.
Optimal features used to split each node.
Optimal threshold values used to split each node.
The number of features used to train the SETAR-Tree.
Names of the input features.
Names of the coefficients of leaf node regresion models.
Number of leaf nodes in the SETAR-Tree.
Depth of the SETAR-Tree which was determined based on the specified stopping criterion.
Number of instances used to train the regression models at each leaf node.
The standard deviations of the residuals of each leaf node.
Information about the categorical covarites used during training (only if applicable).
Whether mean normalisation was applied for the training data.
Whether window normalisation was applied for the training data.
Type of input data used to train the SETAR-Tree. This is list if data is a list of time series, and df if data is a dataframe/matrix containing model inputs.
Execution time of SETAR-Tree.
A list of time series (each list element is a separate time series) or a dataframe/matrix containing model inputs (the columns can contain past time series lags and/or external numerical/categorical covariates).
A vector of true outputs. This parameter is only required when data is a dataframe/matrix containing the model inputs.
The number of past time series lags that should be used when fitting the SETAR-Tree. This parameter is only required when data is a list of time series. Default value is 10.
Maximum tree depth. Default value is 1000. Thus, unless specify a lower value, the depth is actually controlled by the stopping criterion.
Initial significance used by the linearity test (alpha_0). Default value is 0.05.
The corresponding significance in each tree level is divided by this value. Default value is 2.
The minimum error reduction percentage between parent and child nodes to make a split. Default value is 0.03.
The required stopping criteria: linearity test (lin_test), error reduction percentage (error_imp) or linearity test and error reduction percentage (both). Default value is "both".
Whether each series should be normalised by deducting its mean value before building the tree. This parameter is only required when data is a list of time series. Default value is FALSE.
Whether the window-wise normalisation should be applied before building the tree. This parameter is only required when data is a list of time series. When this is TRUE, each row of the training embedded matrix is normalised by deducting its mean value before building the tree. Default value is FALSE.
Controls the level of the verbosity of SETAR-Tree: 0 (errors/warnings), 1 (limited amount of information including the current tree depth), 2 (full training information including the current tree depth and stopping criterion results in each tree node). Default value is 2.
Names of the categorical covariates in the input data. This parameter is only required when data is a dataframe/matrix and it contains categorical variables.
# \donttest{
# Training SETAR-Tree with a list of time series
setartree(chaotic_logistic_series)
# Training SETAR-Tree with a dataframe containing model inputs where the model inputs may contain
# past time series lags and numerical/categorical covariates
setartree(data = web_traffic_train[,-1],
label = web_traffic_train[,1],
stopping_criteria = "both",
categorical_covariates = "Project")
# }
Run the code above in your browser using DataLab