Bagged Theta Models | R Documentation |
Bagged implementation (Bergmeir et al, 2016) of Dynamic Optimised Theta Model, Dynamic Standard Theta Model, Optimised Theta Model and Standard Theta Model (Fiorucci et al, 2016).
bagged_dotm(y, h=5, level=c(80,90,95), num_bootstrap = 100, bs_bootstrap = NULL,
s_type="multiplicative", s_test="default", lambda=NULL,
par_ini=c(y[1]/2, 0.5, 2), estimation=TRUE, lower=c(-1e+10, 0.1, 1.0),
upper=c(1e+10, 0.99, 1e+10), opt.method="Nelder-Mead", xreg=NULL)
bagged_dstm(y, h=5, level=c(80,90,95), num_bootstrap = 100, bs_bootstrap = NULL,
s_type="multiplicative", s_test="default", lambda=NULL, par_ini=c(y[1]/2, 0.5),
estimation=TRUE, lower=c(-1e+10, 0.1), upper=c(1e+10, 0.99),
opt.method="Nelder-Mead", xreg=NULL)
bagged_otm(y, h=5, level=c(80,90,95), num_bootstrap = 100, bs_bootstrap = NULL,
s_type="multiplicative", s_test="default", lambda=NULL, par_ini=c(y[1]/2, 0.5, 2),
estimation=TRUE, lower=c(-1e+10, 0.1, 1.0), upper=c(1e+10, 0.99, 1e+10),
opt.method="Nelder-Mead", xreg=NULL)
bagged_stm(y, h=5, level=c(80,90,95), num_bootstrap = 100, bs_bootstrap = NULL,
s_type="multiplicative", s_test="default", lambda=NULL, par_ini=c(y[1]/2, 0.5),
estimation=TRUE, lower=c(-1e+10, 0.1), upper=c(1e+10, 0.99),
opt.method="Nelder-Mead", xreg=NULL)
y |
Object of time series class. |
h |
Number of required forecasting periods. |
level |
Levels for prediction intervals. |
num_bootstrap |
Number of bootstrap samples to be considered in the forecast ( |
bs_bootstrap |
Block size for bootstrap samples to be considered in the forecast ( |
s_type |
Use |
s_test |
If |
lambda |
Parameter for Box-Cox transformation ( |
par_ini |
Vector of initialization for |
estimation |
If |
lower |
The lower limit of parametric space. |
upper |
The upper limit of parametric space. |
opt.method |
The numeric optimisation method for |
xreg |
A matrix with the regressor variables including the out-of-sample data. |
This version allows bagging to be used in conjunction with the models DOTM, DSTM, OTM and STM (Fiorucci et al, 2016), which usually generates considerably more accurate results, whether point or interval forecasts. In this case, Box-Cox and Loess-based decomposition bootstrap (BLD-MBB) is used, for details see Bergmeir et al, 2016.
If num_bootstrap > 1
, then the bagged series are extrapolated through simulation. In the end, point forecasts are calculated as the mean ($mean
) or the median ($median
) of these series, while interval forecasts are computed based on quantiles. To ensure a substantial number of simulations, each bagged series can be extrapolated multiple times through simulation, aiming for a total simulation volume of at least 10,000 series.
By default, the 90% significance seasonal Z-test, used by Assimakopoulos and Nikolopoulos (2000), is applied for quarterly and monthly time series. The possibility of first checking the unit root was included because it was pointed out that this test presents many flaws for time series with this characteristic (Fiorucci et al, 2016). In this case, the KPSS test is performed with a significance level of 5% and in the case of a unit root, then the series is differentiated before checking for seasonal behavior.
An object of thetaModel
class with one list containing the elements:
$method |
The name of the model/method |
$y |
The original time series. |
$s |
A binary indication for seasonal decomposition (original time series). |
type |
Seasonal decomposition type (original time series). |
opt.method |
The optimisation method used in the |
$par |
The estimated values of |
$weights |
The estimated weights values (original time series). |
$fitted |
A time series element with the fitted points (original time series). |
$residuals |
A time series element with the residual points (original time series). |
$mean |
The forecasting values calculed as the mean of bootstrapping simulations. |
$median |
The forecasting values calculed as the median of bootstrapping simulations. |
$level |
The levels for prediction intervals. |
$lower |
Lower limits for prediction intervals. |
$upper |
Upper limits for prediction intervals. |
Jose Augusto Fiorucci, Francisco Louzada, Igor De Oliveira Barros Faluhelyi.
Assimakopoulos, V. and Nikolopoulos k. (2000). The theta model: a decomposition approach to forecasting. International Journal of Forecasting 16 (4), 521–530, <doi:10.1016/S0169-2070(00)00066-2>.
Bergmeir, C., Hyndman, R.J. and Benítez, J. M. (2016). Bagging exponential smoothing methods using STL decomposition and Box–Cox transformation. International journal of forecasting 32 (2), 303–312, <doi:10.1016/j.ijforecast.2015.07.002>.
Fiorucci J.A., Pellegrini T.R., Louzada F., Petropoulos F., Koehler, A. (2016). Models for optimising the theta method and their relationship to state space models, International Journal of Forecasting, 32 (4), 1151–1161, <doi:10.1016/j.ijforecast.2016.02.005>.
forecTheta-package
, dotm
,
dstm
, otm
,
stm
#### additive seasonal decomposition ###
x = sin(2*pi*seq(0,9,len=300)) + exp((1:300)/150) + rnorm(mean=100,sd=0.5,n=300)
y = ts(x, frequency=33)
out <- bagged_dotm(y, h=50, s_type='additive', num_bootstrap = 5)
summary(out)
plot(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.