Bagging: Bagging Forecasts for Multivariate Time Series

Description Usage Arguments Value Note Author(s) See Also

Description

This function generates forecasts for multivariate time series based on bagging methods. The bootstrapping process is done using block bootstrapping, and one-step-ahead forecasts are made for each bootstrapping with the maeforecast.simplified function. Forecasts of the bootstrapped time series then are aggregated to produce a single set of forecasts.

Usage

1
2
Bagging(data, boot, sim="fixed", l=12L, norm=TRUE, n.sim=NROW(data),
        model="ar", w_size, window="recursive", y.index=1, ...)

Arguments

data

a data frame or a matrix; the first column should contain the time series variable for which the forecasts are to be made. Other columns should contain the covariates.

boot

number of bootstrapped versions to generate.

sim

The type of simulation required to generate the replicate time series. Defualt is "fixed". Refer to tsboot for a full list of possible inputs.

l

If sim is "fixed" then l is the fixed block length used in generating the replicate time series. If sim is "geom" then l is the mean of the geometric distribution used to generate the block lengths. l should be a positive integer less than the length of tseries. This argument is not required when sim is "model" but it is required for all other simulation types. Defualt is 12L.

endcorr

A logical variable indicating whether end corrections are to be applied when sim is "fixed". When sim is "geom", endcorr is automatically set to TRUE; endcorr is not used when sim is "model" or "scramble".

norm

A logical argument indicating whether normal margins should be used for phase scrambling. If norm is FALSE then margins corresponding to the exact empirical margins are used.

n.sim

The length of the simulated time series. Defualt is the length of the original time series.

model

character, indicating which model should be used to make the forecasts. Default is an AR(1) model. Supported models include "ar", "lasso", "postlasso" (Post-Lasso), "ridge", "alasso" (Adaptive Lasso), "postalasso" (Post-AdaptiveLasso), "postnet" (Post-Adaptive ElasticNet), "rf" (Random Forests), "dfm", "dfm2" (Dynamic Factor Models). Note that a random walk model cannot be used in this function.

w_size

numeric, indicating the index where the forecasting should begin. If the first point forecast should be made at the 73th observation, for example, w_size should be set to be 72.

window

character, indicating the forecasting scheme to be applied. Options include "recursive", "rolling", and "fixed".

y.index

numeric, indicating the column position of the time series for which the forecasts are made (Y). Defualt is 1.

...

extra arguments supported by the maeforecast function.

Value

This function returns an object of class "MaeBagging" that contains the following components:

Forecasts

data matrix, containing the point forecasts, realized values, forecast errors, signs of the forecasts and realized values, and success in predicting the signs.

MSE

numeric, mean squred error of the point forecasts.

SRatio

numeric, success ratio of the point forecasts. Success is claimed when the point forecasts and realized values have the same sign.

Data

the data as used in the model.

Model

some specifics about the model used.

Note

For more detailed description of the arguments used in the bootstrapping process, refer to tsboot.

Author(s)

Zehua Wu

See Also

maeforecast


google-trends-v1/gtm documentation built on June 5, 2019, 5:13 p.m.