View source: R/add-mase-scale-feat.R
add_mase_scale_feat | R Documentation |
add_mase_scale_feat()
calculates a MASE scale factor and divides this factor by the group average scale factor to produce a scale feature.
add_mase_scale_feat(.tbl, .value, ...)
.tbl |
tibble; data with grouping column and value column |
.value |
numeric; unquoted name of the column that contains the numeric values of the time series |
... |
character; one or more unquoted grouping columns |
Designed to use with a global forecasting method. It's recommended to standardize the stacked series that is used as input for this method. Standardizing the stacked series removes the scale information about each series in the stack which might be useful in generating the forecast. Adding a scale feature reintroduces this information back into the model.
The original tibble with an additional column, "scale."
Pablo Montero-Manso, Rob J. Hyndman, Principles and algorithms for forecasting groups of time series: Locality and globality, International Journal of Forecasting, 2021 link
library(dplyr, warn.conflicts = FALSE)
group_ts_tbl <- tsbox::ts_tbl(fpp2::arrivals)
head(group_ts_tbl)
new_tbl <- add_mase_scale_feat(group_ts_tbl, .value = value, id)
head(new_tbl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.