0
$\begingroup$

I have this dataset that contains multiple series (50 products). My dataset has 50 products (50 columns). each column contains the monthly sales of a product. I recently learned about bootstrap and how it can improve forecast accuracy. Therefore, I decided to compare the results that I will get when using ets, Arima, and when using bootstrapping method. Here is my code and I would love if someone can help me understand how to apply bootstrap on a time series and how to use it with other forecasting techniques. So far I've used ets and Arima without bootstrap and now I want to use bootstrapping and then compare the results of each method and prove which one is the best method to forecast time series.

library(fable)
library(dplyr)
library(tidyr)
library(ggplot2)
y <- ts(matrix(rnorm(175*50), ncol=50), frequency=12, start=c(2007,1)) %>%
  as_tsibble() %>%
  rename(Month = index, Sales=value)
fit.ets <- y %>% model(ETS(Sales))  
fit.ets
f.ets <- forecast(fit.ets, h=12)
f.ets 
$\endgroup$
15
  • $\begingroup$ Bootstrap is not a forecasting technique in itself, unlike ARIMA or exponential smoothing. Where did you get the idea to apply bootstrap for forecasting? $\endgroup$ Commented Nov 27, 2021 at 11:45
  • $\begingroup$ Sorry, I meant using ets and arma after bootstrapping the time series data. Does it make sense? I want to bootstrap the time series first then use forecasting technique and compare it with the results I will get when forecasting the sales without bootstrapping $\endgroup$
    – Abdel_DAS
    Commented Nov 27, 2021 at 11:47
  • $\begingroup$ You probably mean bootstrap aggregation (a.k.a. bagging) combined with time series techniques such as ARIMA or exponential smoothing. The forecast package in R might contain a function that does ets + bagging. There is a paper and, I think, a blog post by Rob J. Hyndman about ets + bagging and how it works very well on M3 competition data. See this chapter of the FPP textbook. $\endgroup$ Commented Nov 27, 2021 at 12:15
  • $\begingroup$ Check out the textbook chapter/section I have referenced, it includes plotting. $\endgroup$ Commented Nov 27, 2021 at 12:28
  • 2
    $\begingroup$ I do not work with pipes or tidyverse myself, so I find it hard to comment on what exactly went wrong here. Consider creating a minimal reproducible example to isolate the error and make it replicable. $\endgroup$ Commented Nov 28, 2021 at 16:03

1 Answer 1

2
$\begingroup$

You probably mean bootstrap aggregation (a.k.a. bagging) combined with time series techniques such as ARIMA or exponential smoothing. There is a paper* and another one** about ets + bagging and how it works very well on M3 competition data. See this section of the "Forecasting Principles and Practice" textbook for a brief overview with R code and an example application.

*Bergmeir, Hyndman and Benitez "Bagging Exponential Smoothing Methods using STL Decomposition and Box-Cox Transformation" (2016)
**Petropoulos, Hyndman and Bergmeir "Exploring the sources of uncertainty: why does bagging for time series forecasting work?" (2018)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.