{"id":1160,"date":"2016-11-17T15:16:01","date_gmt":"2016-11-17T15:16:01","guid":{"rendered":"http:\/\/kourentzes.com\/forecasting\/?p=1160"},"modified":"2016-11-17T17:28:22","modified_gmt":"2016-11-17T17:28:22","slug":"mapax-available-for-r-new-mapa-package-on-cran","status":"publish","type":"post","link":"https:\/\/kourentzes.com\/forecasting\/2016\/11\/17\/mapax-available-for-r-new-mapa-package-on-cran\/","title":{"rendered":"MAPAx available for R &#038; new MAPA package on CRAN"},"content":{"rendered":"<p style=\"text-align: justify;\">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 <a href=\"http:\/\/kourentzes.com\/forecasting\/2015\/09\/08\/forecasting-with-multivariate-temporal-aggregation-the-case-of-promotional-modelling\/\">paper<\/a> 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 <a href=\"http:\/\/kourentzes.com\/forecasting\/2014\/04\/19\/on-the-identification-of-sales-forecasting-models-in-the-presence-of-promotions\/\">type<\/a>), as well as exponential smoothing with promotional information (see Fig. 1).<\/p>\n<div id=\"attachment_1166\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res.png\"><img aria-describedby=\"caption-attachment-1166\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-1166\" src=\"http:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res.png\" alt=\"mapax_res\" width=\"600\" height=\"213\" srcset=\"https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res.png 978w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res-150x53.png 150w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res-300x107.png 300w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res-768x273.png 768w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax_res-660x235.png 660w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-1166\" class=\"wp-caption-text\">Fig. 1. Bias and accuracy results for heavily promoted items. Description and details of the case study and experiment can be found <a href=\"http:\/\/kourentzes.com\/forecasting\/2015\/09\/08\/forecasting-with-multivariate-temporal-aggregation-the-case-of-promotional-modelling\/\">here<\/a>.<\/p><\/div>\n<p style=\"text-align: justify;\">To use MAPAx call the usual mapa functions with the addition of the argument <code>xreg<\/code>. You can also control whether the regressors are transformed using principal components or not, using the argument <code>pr.comp<\/code>.\u00a0 By default no transformation is performed. Note that MAPAx can only be used when <code>type=\"es\"<\/code>. It is recommended that when the regressors are related to high-frequency information, such as promotions, to use the combination options (argument <code>comb<\/code>): <code>w.mean<\/code> or <code>w.median<\/code> that weight high-frequency seasonality and xreg states more heavily.<\/p>\n<p style=\"text-align: justify;\">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.<\/p>\n<div id=\"attachment_1164\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax.png\"><img aria-describedby=\"caption-attachment-1164\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-1164\" src=\"http:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax.png\" alt=\"mapax\" width=\"600\" height=\"250\" srcset=\"https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax.png 1200w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax-150x63.png 150w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax-300x125.png 300w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax-768x320.png 768w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax-1024x427.png 1024w, https:\/\/kourentzes.com\/forecasting\/wp-content\/uploads\/2016\/11\/mapax-660x275.png 660w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-1164\" class=\"wp-caption-text\">Fig. 2. MAPA and MAPAx forecasts for the demand of a promoted product.<\/p><\/div>\n<p style=\"text-align: justify;\">Observe that MAPAx models the past and future promotions and also provides tighter prediction intervals, since more information in the past sales is captured.<\/p>\n<p style=\"text-align: justify;\">The stable version of the package with MAPAx is 2.0.1 and is available on <a href=\"https:\/\/cran.r-project.org\/package=MAPA\" target=\"_blank\">CRAN<\/a>. The development version, which includes the latest bugfixes, can be found on <a href=\"https:\/\/github.com\/trnnick\/mapa\" target=\"_blank\">GitHub<\/a>, 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!<\/p>\n<div class=\"SPOSTARBUST-Related-Posts\"><H3>Related Posts<\/H3><ul class=\"entry-meta\"><li class=\"SPOSTARBUST-Related-Post\"><a title=\"Special issue on innovations in hierarchical forecasting\" href=\"https:\/\/kourentzes.com\/forecasting\/2020\/10\/25\/special-issue-on-innovations-in-hierarchical-forecasting\/\" rel=\"bookmark\">Special issue on innovations in hierarchical forecasting<\/a><\/li>\n<li class=\"SPOSTARBUST-Related-Post\"><a title=\"Automatic robust estimation for exponential smoothing: perspectives from statistics and machine learning\" href=\"https:\/\/kourentzes.com\/forecasting\/2020\/06\/04\/automatic-robust-estimation-for-exponential-smoothing-perspectives-from-statistics-and-machine-learning\/\" rel=\"bookmark\">Automatic robust estimation for exponential smoothing: perspectives from statistics and machine learning<\/a><\/li>\n<li class=\"SPOSTARBUST-Related-Post\"><a title=\"Elucidate structure in intermittent demand time series\" href=\"https:\/\/kourentzes.com\/forecasting\/2020\/05\/25\/elucidate-structure-in-intermittent-demand-time-series\/\" rel=\"bookmark\">Elucidate structure in intermittent demand time series<\/a><\/li>\n<\/ul><\/div><!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>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\u2026 <span class=\"read-more\"><a href=\"https:\/\/kourentzes.com\/forecasting\/2016\/11\/17\/mapax-available-for-r-new-mapa-package-on-cran\/\">Read More &raquo;<\/a><\/span><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[41],"tags":[45,32,38,33,39,36],"_links":{"self":[{"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/posts\/1160"}],"collection":[{"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/comments?post=1160"}],"version-history":[{"count":0,"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/posts\/1160\/revisions"}],"wp:attachment":[{"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/media?parent=1160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/categories?post=1160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kourentzes.com\/forecasting\/wp-json\/wp\/v2\/tags?post=1160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->