thief {thief} | R Documentation |
Temporal hierarchical forecasting
Description
Takes a time series as input and produces forecasts using the temporal hierarchical approach of Athanasopoulos et al (2016).
Usage
thief(y, m = frequency(y), h = m * 2, comb = c("struc", "mse", "ols",
"bu", "shr", "sam"), usemodel = c("ets", "arima", "theta", "naive",
"snaive"), forecastfunction = NULL, aggregatelist = NULL, ...)
Arguments
y |
Time series input |
m |
Seasonal period |
h |
Forecast horizon |
comb |
Combination method of temporal hierarchies, taking one of the following values:
|
usemodel |
Model used for forecasting each aggregation level:
|
forecastfunction |
User-defined function to be used instead of |
aggregatelist |
User-selected list of forecast aggregates to consider |
... |
Arguments to be passed to the time series modelling function
(such as |
Details
This function computes the temporal aggregates of y
using
tsaggregates
, then calculates all forecasts using the model function
specified by usemodel
or forecastfunction
, and finally reconciles the
forecasts using reconcilethief
. The reconciled forecasts of y
are returned.
Value
forecast object.
Author(s)
Rob J Hyndman and Nikolaos Kourentzes
See Also
Examples
## Not run:
# Select ARIMA models for all series using auto.arima()
z <- thief(AEdemand[,12], usemodel='arima')
plot(z)
# Use your own function
ftbats <- function(y,h,...){forecast(tbats(y),h,...)}
z <- thief(AEdemand[,12], forecastfunction=ftbats)
plot(z)
## End(Not run)