forecast.setartree {setartree} | R Documentation |
Forecast method for SETAR-Tree fits
Description
Obtains forecasts for a given set of time series or a dataframe/matrix of new instances from a fitted SETAR-Tree model.
Usage
## S3 method for class 'setartree'
forecast(object, newdata, h = 5, level = c(80, 95), ...)
Arguments
object |
An object of class |
newdata |
A list of time series which needs forecasts or a dataframe/matrix of new instances which need predictions. |
h |
The required number of forecasts (forecast horizon). This parameter is only required when |
level |
Confidence level for prediction intervals. Default value is c(80, 95). |
... |
Other arguments. |
Value
If newdata
is a list of time series, then an object of class mforecast
is returned.
The plot
or autoplot
functions in the R forecast
package can then be used to produce a plot of any time series in the returned object which contains the following properties.
method |
A vector containing the name of the forecasting method ("SETAR-Tree"). |
forecast |
A list of objects of class |
If newdata
is a dataframe/matrix, then a list containing the predictions, prediction intervals (upper and lower bounds), the size and standard deviations of the residuals of the models used to get each prediction is returned.
Examples
# Obtaining forecasts for a list of time series
tree1 <- setartree(chaotic_logistic_series)
forecast(tree1, chaotic_logistic_series)
# Obtaining forecasts for a set of test instances
tree2 <- setartree(data = web_traffic_train[,-1],
label = web_traffic_train[,1],
stopping_criteria = "both",
categorical_covariates = "Project")
forecast(tree2, web_traffic_test)