add_mase_scale_feat: Add a scale feature by using a factor derived from the MASE...

View source: R/add-mase-scale-feat.R

add_mase_scale_featR Documentation

Add a scale feature by using a factor derived from the MASE error function

Description

add_mase_scale_feat() calculates a MASE scale factor and divides this factor by the group average scale factor to produce a scale feature.

Usage

add_mase_scale_feat(.tbl, .value, ...)

Arguments

.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

Details

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.

Value

The original tibble with an additional column, "scale."

References

Pablo Montero-Manso, Rob J. Hyndman, Principles and algorithms for forecasting groups of time series: Locality and globality, International Journal of Forecasting, 2021 link

Examples


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)

ercbk/ebtools documentation built on Feb. 22, 2025, 1:51 p.m.