Description Usage Arguments Details Value References See Also Examples
This function fits multivariate Breiman random forests on a multivariate xts timeseries object and then uses ensemble univariate forecast models on all higher levels of temporal aggregation to reconcile the forecasts
1 2 3 4 5 6 7 8 9 10 11 12 | thief_rfsrc(
y,
k = 1,
lambda = NULL,
frequency = 52,
horizon = NULL,
predict_quantiles = TRUE,
tune_nodesize = FALSE,
cores = parallel::detectCores() - 1,
max_agg = NULL,
discrete = F
)
|
y |
|
k |
|
lambda |
|
frequency |
|
horizon |
|
predict_quantiles |
|
tune_nodesize |
|
cores |
|
max_agg |
(optional) |
discrete |
|
Series in y
are aggregated at all possible levels up to annual using tsaggregates
.
rfsrc
is used on the unaggregated series, with regressors including exponentially
weighted moving averages of each series as well as time features that can be extracted from the series. Run conditions are:
ntree = 2000, nsplit = NULL, nodesize = 12
.
ensemble_base
is used on all aggretated levels to find a weighted ensemble of eight
univariate forecast models that minimises mean absolute scaled error. Forecasts are then reconciled
using reconcilethief
and are optionally constrained using non-negative optimisation if there
are no negative values in y
. Adjustments to the original unaggregated forecast are incorporated and a
distribution of 1000
sample paths for each series' forecast are returned
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
ensemble_base
, rfsrc
,
reconcilethief
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(mvforecast)
data("ixodes_vets_dat")
#Fit a thief_rfsrc model
mod1 <- thief_rfsrc(y = ixodes_vets_dat$y_train,
frequency = 52, k = 1,
cores = parallel::detectCores() - 1)
#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.