Description Usage Arguments Details Value References See Also Examples
View source: R/thief_probreco.R
This function fits a specified thief model and then uses probabilistic reconciliation based on the supplied grouping structure to reconcile base forecast distributions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | thief_probreco(
y,
k = 1,
frequency = 52,
lambda = NULL,
model = "thief_ensemble",
prob_train_horizon = 2,
horizon = NULL,
max_agg = NULL,
groups,
keep_total = TRUE,
cores = parallel::detectCores() - 1,
discrete = FALSE,
...
)
|
y |
|
k |
|
frequency |
|
lambda |
|
model |
One of codec(thief_ensemble, thief_rfsrc, thief_vets) |
prob_train_horizon |
|
horizon |
|
max_agg |
(optional) |
groups |
Group matrix indicates the group structure, with one column for each series when
completely disaggregated, and one row or each grouping of the time series. It allows either a numerical matrix or a
matrix consisting of strings that can be used for labelling. See |
keep_total |
|
cores |
|
... |
Other arguments to be passed on to the specified thief model |
Series in y
are aggregated at all possible levels up to annual using tsaggregates
.
The specified model is used on the unaggregated series, with forecasts reconciled
using reconcilethief
. Finally, the grouping structure is used in gts
to create
the group summing structure. Forecasts of the summed series, including the final total, are generated using
thief_ensemble
and the final base forecast distributions are reconciled using weights calculated through
energy score optimisation using scoreopt
A list
containing the reconciled forecast distributions for each series in y
. Each element in
the list
is a horizon x 1000 matrix
of forecast predictions
Athanasopoulos, G., Hyndman, R., Kourentzes, N., and Petropoulos, F. Forecasting with temporal hierarchies.
(2017) European Journal of Operational Research 262(1) 60–74
Panagiotelis, A., Gamakumara, P., Athanasopoulos, G., and Hyndman, R.
Probabilistic Forecast Reconciliation: Propoerties, Evaluation and Score Optimisation. (2020)
Monash EBS Working Paper 26/20
Panagiotelis, A., Athanasopoulos, G., Gamakumara, P., and Hyndman, R. (2021). Forecast reconciliation:
A geometric view with new insights on bias correction. International Journal of Forecasting, 37(1), 343-359.
thief_ensemble
, gts
,
reconcilethief
, scoreopt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(mvforecast)
data("ixodes_vets_dat")
#Fit a probabilistic thief_ensemble model
groups <- ixodes_vets_dat$groups
mod1 <- thief_probreco(y = ixodes_vets_dat$y_train,
model = 'thief_ensemble',
frequency = 52,
prob_train_horizon = 12,
keep_total = FALSE,
groups = groups)
#Calculate the out-of-sample CRPS
calc_crps(mod1, y_test = ixodes_vets_dat$y_test)
Plot simulation results for one of the plots in the NEON dataset
plot_mvforecast(simulation = mod1[[4]])
points(as.vector(ixodes_vets_dat$y_test[,4]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.