Improving forecasting by subsampling seasonal time series
The R package foss
provides implementations of the forecasting by subsampling seasonal time series, see our paper for the details.
You can install the package foss
from GitHub Repository with:
devtools::install_github("lixixibj/foss")
library(foss)
h=4
y <- ts(c(123,39,78,52,110,100,200,46,19,12,12,23,24,24,25,70), start=c(2012,2),frequency=4)
#library(forecast)
train <- head(y,(length(y)-h))
test <- tail(y, h)
type.of.ts='Q'
method.option='ets'
level.value=95
ts.entry <- list(x = train, xx = test,n = length(train), h = h)
library(foreach)
res=forecasting_with_multiple_approaches(ts.entry,type.of.ts,method.option,level.value)
> res$point.forecasts
[1] 27.54827 26.46702 35.15327 29.13441
> res$point.forecasts
[1] 27.54827 26.46702 35.15327 29.13441
#plot many new ts(with different seasons)
p2=plot_different_sub_seasonal_series(ts.entry,type.of.ts)
library(forecast)
p1=plot_time_series_and_its_forecast(train,test,res)
print(p1)
p3=plot_model_components(type.of.ts,res,method.option)
p4=plot_forecasts_of_new_mutiple_series(ts.entry,type.of.ts,res)
print(p4)
- Li, X., Petropoulos, F, Kang, Y. (2020). Improving forecasting by subsampling seasonal time series. Working paper on arXiv.