The previous version of the MAPA package implemented only the univariate aspect of the algorithm. Version 2.0.1 implements MAPAx as well, which allows incorporating regressors in your forecasts. In this paper we demonstrated the usefulness of temporal aggregation in the case of forecasting demand in the presence of promotions. In particular, we showed that MAPAx substantially outperformed regression promotions models (of this type), as well as exponential smoothing with promotional information (see Fig. 1).
To use MAPAx call the usual mapa functions with the addition of the argument
xreg. You can also control whether the regressors are transformed using principal components or not, using the argument
pr.comp. By default no transformation is performed. Note that MAPAx can only be used when
type="es". It is recommended that when the regressors are related to high-frequency information, such as promotions, to use the combination options (argument
w.median that weight high-frequency seasonality and xreg states more heavily.
The following example illustrates the strength of MAPAx when additional information is available. We model the demand of a promoted product with conventional MAPA and MAPAx. Fig. 2 provides the in-sample rolling forecasts and the out-of-sample forecast for 13 weeks.
Observe that MAPAx models the past and future promotions and also provides tighter prediction intervals, since more information in the past sales is captured.
The stable version of the package with MAPAx is 2.0.1 and is available on CRAN. The development version, which includes the latest bugfixes, can be found on GitHub, where I also provide the versions available at both CRAN and GitHub so you can check whether you have the latest version or not. MAPAx, similar to high-frequency MAPA, requires the smooth package. Make sure you have the latest version of that as well!