Data Science And Analytics For Operations
November 19, 2026
Predictive robustness: evaluation of time series models for demand projection in Brazilian e-commerce
Giullia Bueno Marinho; Edivan Alexandre Ferreira
DOI: 10.22167/2675-6528-202603858
Article derived from a Final Course Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by the Pecege Institute for textual synthesis and organization.
Summary
Brazilian e-commerce presented volatile scenarios that require continuous improvement of demand forecasting techniques. Traditional approaches and baseline methods demonstrated limitations in incorporating large volumes of data and complex trend and seasonality variables. The study analyzed the accuracy achieved by applying advanced statistical models and machine learning, specifically SARIMA (Seasonal Autoregressive Integrated Moving Average) and Prophet, an algorithm developed by Meta, compared to baseline methods such as Recursive Moving Average and Homologous Seasonality. A quantitative and experimental approach was adopted, using the public Olist dataset, with real transactions, for statistical validation. The results indicated that, although the time series presented high daily volatility, the use of additive decomposition models allowed for more accurate capture of seasonality patterns and commercial peaks. This resulted in a significant reduction in error indicators, consolidating predictive robustness as a strategic differentiator for the sector.
Keywords: demand; ecommerce; forecast; statistical models; prediction.
1. Introduction
The diffusion of e-commerce in Brazil has driven the transition from traditional retail to an omnichannel context, where digital and physical increasingly integrate. This transformation requires the reformulation of national logistics chains, introducing complexities and the need to rethink supply chain planning and management approaches (Christopher, 2011).
Despite its relative youth, with beginnings just over two decades ago (Albertin, 2000), Brazilian e-commerce shows exponential growth. The sector consolidated itself as the second largest channel in national retail since 2023, with a total sales of over 351.4 billion reais in 2024 and the highest growth of 19.1% in the period, surpassing traditional models (Nielseniq Ebit, 2025).
This acceleration highlights the speed of retail transformation and adaptability in an environment of intense competition, volatility, promotion elasticity, commercial calendars, and seasonality. Events like the COVID-19 pandemic have accentuated this complexity, profoundly altering consumption patterns and demonstrating that forecasting solutions based solely on historical data have become insufficient (Carreiro & Nose, 2023; Silva, 2022).
In this dynamic scenario, logistical and operational success depends on the ability to respond quickly to market trends and customer demands (Christopher, 2011). The adoption of robust planning techniques and accuracy targets in demand forecasting models is fundamental, as the integration between sales, inventory, and logistics services constitutes a pillar of retail performance.
The significant investments by major Brazilian e-commerce companies in Fulfillment, where the marketplace assumes responsibility for inventory planning, reinforce supply chain management as a crucial element for operational efficiency. However, this strategy intrinsically depends on robustness and predictive accuracy (Staudt et al., 2016).
The advance of e-commerce, with its inherent complexities and the high volume of data generated (Big Data), demands the increasing use of Data Analytics methodologies and predictive modeling. Qualitative approaches and simplistic baseline methods, such as Simple Moving Average or the Naive Method, fail to incorporate trend and seasonality components of the time series (Staudt et al., 2016).
These limitations can generate significant operational costs and customer experience issues, negatively impacting the supply chain. Risks of overestimation result in increased storage costs and obsolescence, while underestimation of demand causes stockouts and lost sales, a crucial challenge for business sustainability in the volatile Brazilian online market (Michel, 2022).
Time series models, such as SARIMA (Seasonal Autoregressive Integrated Moving Average), are widely recognized in the literature for their robustness in predictive analyses, isolating and projecting components of demand trend, seasonality, and residuals (Michel, 2022). Their effectiveness in dealing with market cyclicity and volatility is proven by comparative studies (Lucas et al., 2025).
With the development of new technologies, more robust predictive models have emerged, such as Prophet, from Meta (Taylor and Letham, 2017). This tool uses an additive model to decompose time series into trend, seasonality, and holiday effects, allowing for Big Data processing and optimizing forecasts for seasonal patterns and dynamic variables (Rafferty, 2021). Its efficiency has been demonstrated in practical studies for e-commerce sales forecasting (Ongaro, 2025) and in other Brazilian sectors (Souza, Silva & Paixão, 2026).
Although more modern models like Prophet can outperform SARIMA in point accuracy, the statistical model is still valued for its ability to generate detailed and structural information about the time series (Crispim, 2022). Given these specificities for dealing with the volatility of digital retail data, the present study proposes to evaluate whether, in fact, the characteristics of statistical models such as SARIMA and Prophet result in superior accuracy compared to simpler projections from baseline methods.
2. Material and Methods
This research adopted a quantitative approach, with a case study design and experimental character. The choice for the quantitative approach was justified by the focus on collecting, processing, and analyzing numerical data from historical sales. The case study allowed for a contextualized investigation, applied to real public sales data from Brazilian e-commerce. The experimental nature consisted of simulating different treatments, comparing SARIMA and Prophet forecasting models with baseline models under controlled conditions, aiming to evaluate predictive performance through statistical metrics (Cooper & Schindler, 2016).
The information source selected for analysis was the public domain dataset Olist E-commerce, available in the Kaggle repository. Specifically, the files olist_orders_dataset.csv and olist_order_items_dataset.csv were used. This database contains real records of orders, customers, and products transacted in Brazil via the Olist platform, a digital retail intermediary. The data period covered the interval between September 2016 and October 2018. The use of a public dataset exempted the submission to the Research Ethics Committee (CEP).
The explored dataset totaled 110,197 items sold and delivered, spanning 714 days, from September 15, 2016, to August 29, 2018. Initially, the dataset underwent exploratory analysis to identify time series characteristics. Only orders with the status “delivered” were filtered out to reflect effective demand. Identified outliers were kept in the database, considering the sector’s nature. For data processing and manipulation, the Python programming language was used in a Google Colab environment, with the support of libraries such as Pandas, Matplotlib, Seaborn, and Statsmodels.
In order to perform projection versus actual values tests, the time series was divided into two samples. The training set consisted of historical data from January 2017 to May 2018, used to learn the trend and seasonality and statistically parameterize the predictive models. The test set corresponded to the actual data from the last ninety days, from June 2018 to August 2018, reserved for contrasting with the projections and measuring the accuracy of the models.
For the predictions to be made, four distinct models were created. Model A, named Recursive Moving Average (RMA), employed a seven-day window for simple demand projection. This technique was based on an initial level of moving averages that was iteratively recalculated, using its own predicted values. Model B, Homologous Seasonality, simulated a common market practice, calculating the total monthly demand with growth rates from the previous year and distributing the daily amount according to the weights of homologous days from the previous year (Slack, Brandon-Jones, and Johnston, 2018).
Model C, SARIMA (Seasonal Autoregressive Integrated Moving Average), used the Box-Jenkins statistical methodology. Through the Auto-Arima function, the parameters that minimized the AIC (Akaike Information Criterion) were specified, resulting in the optimal configuration (1, 1, 3)x(0, 0, 2, 7), which identified weekly seasonality (s=7). Model D, Prophet, an open-source algorithm developed by Meta, treated forecasting as an additive model, decomposing the time series into trend, seasonality, and holiday effects (Taylor and Letham, 2017). Brazilian national holidays were added using the add_country_holidays function.
The predictive performance of the selected approaches was evaluated through an accuracy test that compared the projections with the actual data. Widely consolidated metrics in time series forecasting literature were used (Hyndman and Athanasopoulos, 2018): MAE (Mean Absolute Error), MAPE (Mean Absolute Percentage Error), and RMSE (Root Mean Squared Error). The premise adopted was that the model with the lowest error values would possess greater robustness for demand forecasting. For SARIMA, the Ljung-Box test was performed, which presented a p-value of 0.94, indicating the absence of residual autocorrelation (Box, Jenkins, and Reinsel, 2015).
3. Results and Discussion
The analysis of data from the Olist platform revealed a detailed panorama of demand in Brazilian e-commerce, characterized by high volatility and specific seasonal patterns. The study period, comprising 714 days between September 2016 and August 2018, covered 110,197 items sold and delivered. It was observed that the time series stabilized from 2017 onwards, exhibiting constant demand growth over time. This initial stabilization is crucial for modeling, as it allows underlying trends to be identified more clearly, according to the literature on time series (Hyndman and Athanasopoulos, 2018).
In terms of daily volume, the average number of items sold was 154.34, with a median of 150 units, indicating a relatively symmetrical distribution but with significant peaks. High volatility was confirmed by a standard deviation of 114.95, reflecting the dynamic nature of e-commerce. A notable event was the peak of 1,345 units sold on November 24, 2017, attributed to Black Friday, a date that, in that year, recorded record sales in national e-commerce, with a 15% increase compared to the previous year (G1, 2017). The retention of these outliers in the database was intentional, as they represent real demand events that must be considered in projections.
The exploration of weekly seasonality revealed a distinct behavior from traditional physical retail. While physical stores tend to have more traffic on weekends, Olist’s e-commerce registered the highest transaction volume on weekdays, especially on Mondays and Tuesdays. This pattern is consistent with industry reports, such as Webshoppers (NielsenIQ Ebit, 2021), which indicate that Brazilian consumers use weekends for leisure and in-person consumption, concentrating their online purchases during the week. This characteristic is fundamental for building predictive models that consider weekly cyclicity.
Although the research scope did not include forecasting by product category, the database characterization identified the “Bed, Bath, and Home” and “Beauty and Health” departments as leaders in sales volume on the Olist platform during the analyzed period. This information contextualizes the overall demand and may be relevant for future, more segmented analyses, although it was not the focus of this study. The additive decomposition of the time series, in turn, visually confirmed the growth trend, the marked weekly seasonality, and isolated the impact of the Black Friday outlier, validating the patterns observed in the raw data.
Model A: Recursive Moving Average
The first model evaluated, the Recursive Moving Average (RMA) with a seven-day window, served as a baseline method for comparison. Supply Chain literature recognizes RMA as a naive extrapolation technique, effective for smoothing short-term fluctuations in stable time series, but with limitations for long-term forecasts (Morettin and Toloi, 2006). The main characteristic observed was the rapid convergence of the projection to a constant average, around 140 to 150 daily items, disregarding the growth trend and the characteristic oscillations of Olist’s demand.
This limitation is evident in the model’s inability to react to sales spikes, which frequently exceeded 400 items per day in real demand, while the MMR projection remained stable at its central average. The model also proved susceptible to “error loading”, as it uses its own predicted values to recalculate future averages, which can amplify deviations over time. The function of this model was to establish a “zero mark” of accuracy, against which the utility of more sophisticated models would be measured (Silver, 2012).
The performance indicators ratified the deficiencies of Model A. The RMSE (Root Mean Squared Error) was 117.21, indicating a considerable deviation between predictions and reality. The MAPE (Mean Absolute Percentage Error) reached 49.72%, suggesting that the model’s accuracy was only about half of the actual volume. Finally, the MAE (Mean Absolute Error) of 99.51 showed that, on average, the planner would err the projection by approximately 100 units per day. Such results indicate that the adoption of this model in a real planning scenario would result in stockouts and revenue loss, given the inability to predict periods of higher transactional volume.
Model B: Homologous Seasonality
Model B, based on Homologous Seasonality, introduced a higher level of complexity than Model A, incorporating the premise that future demand repeats past patterns, adjusted by current trends (Slack, Brandon-Jones, and Johnston, 2018). The model’s rationale involved two steps: first, applying monthly growth rates observed in 2017 to the 2018 base; then, distributing the monthly volume calculated at the daily level, using the weights observed on homologous days of the previous year. This approach allowed the projection to incorporate Olist’s oscillatory demand behavior, unlike the stable curve of Model A.
Despite the improvement in the visual representation of demand oscillations, Model B’s error indicators still presented challenges. The RMSE was 87.00, a significant reduction from Model A’s 117.21, indicating a better ability to react to demand volatility and control large magnitude errors. However, the MAPE increased to 61.35%, suggesting that, although the model captured peaks better, the proportion of error relative to actual demand was still high. The MAE of 56.29, while lower than Model A’s, still represented a considerable deviation in daily forecasts.
The decrease in RMSE, which more rigorously penalizes large magnitude errors, proved the technical superiority of Model B over Model A in controlling large oscillations, which are critical for stockout risk. However, the increase in MAPE indicated that, proportionally, the model still had difficulties in predicting demand with high accuracy at all points in the series. This reinforces that, although the incorporation of seasonal components is an advance, the methodology was not yet fully robust for the complexity of e-commerce demand.
Model C: SARIMA
Model C employed the Box-Jenkins statistical methodology, using the SARIMA (Seasonal Autoregressive Integrated Moving Average) algorithm, seeking a more robust mathematical basis for planning. Through the Auto-Arima function, the parameters that minimize the AIC (Akaike Information Criterion) were specified, resulting in the optimal configuration (1, 1, 3)x(0, 0, 2, 7). This order reflects the autoregressive (p), differencing (d), and moving average (q) components, as well as identifying the weekly seasonality (s=7) present in the Olist time series, according to the theory of Box, Jenkins, and Reinsel (2015).
In terms of accuracy, SARIMA presented superior results compared to the baseline models. The RMSE was 80.61, the lowest among the models tested so far, surpassing the 117.21 of Recursive Moving Average and the 87.00 of Homologous Seasonality. This demonstrated SARIMA’s better ability to mitigate large-magnitude errors, generating a more balanced forecast. The MAE of 65.02 and MAPE of 51.38% reinforced this performance, indicating that statistical intelligence was more effective in balancing the noise of daily predictions and capturing the systematic structure of the series.
Graphically, the SARIMA curve showed smoothing over the forecast horizon, with fewer fluctuations compared to Model B. This behavior is inherent to the theoretical foundation of SARIMA, which tends to converge to the average of seasonality and trend components, aiming for a more stable projection (Box, Jenkins, and Reinsel, 2015). The statistical adequacy of the model was validated by the Ljung-Box test, which presented a p-value of 0.94, indicating the absence of residual autocorrelation and confirming that SARIMA was able to extract and model all relevant information from Olist’s historical series.
Model D: Prophet
The fourth model evaluated was Prophet, an open-source algorithm developed by Meta, which represents a more modern Machine Learning approach. According to Taylor and Letham (2017), Prophet treats forecasting as an additive model, decomposing the series into trend, seasonality, and holiday effect components. For the Olist sample, Brazilian national holidays were added, allowing the algorithm to identify atypical events present in demand, such as Black Friday, and incorporate them more effectively into projections.
The Prophet curve demonstrated superior adherence to the daily fluctuations of actual demand compared to the stability trend of SARIMA. The Prophet projection more accurately followed the peaks and valleys of demand, capturing abrupt changes in the series’ trajectory without compromising the stability of the long-term trend (Taylor and Letham, 2017). This ability to minimize inertia in highly seasonal series resulted in a significant accuracy gain compared to purely statistical models, validating its robustness for operations with high volatility.
In statistical terms, Prophet consolidated itself as the model with the best accuracy performance among all tested. It presented the lowest absolute error of the study, with an MAE of 57.99. The RMSE was 73.44, a value 8.8% lower than SARIMA’s and 37.3% lower compared to the initial Moving Average projection. The MAPE, in turn, reached 43.66%, being 3.57 percentage points above SARIMA, but significantly below Model B. This behavior indicates that, despite the resilience in handling high volatility, distortions on valley days are not excessive, validating the robustness of the tool for Olist’s operation.
Comparative Synthesis of Models
The comparison of error indicators among the four models demonstrated a clear evolution in predictive accuracy as the sophistication of the techniques increased. Model A (Recursive Moving Average) presented the highest errors, with an RMSE of 117.21, MAPE of 49.72%, and MAE of 99.51, confirming its inadequacy for volatile time series like e-commerce. Model B (Homologous Seasonality) reduced the RMSE to 87.00 and the MAE to 56.29, but had a higher MAPE (61.35%), indicating that, although it better captured the peaks, proportional accuracy remained a challenge.
Model C (SARIMA) represented a significant advancement, with an RMSE of 80.61, a MAPE of 51.38%, and an MAE of 65.02. These results confirmed the ability of statistical time series models to capture the systematic structure of demand and generate more balanced forecasts, mitigating large magnitude errors. However, Model D (Prophet) outperformed all others, achieving the lowest RMSE of 73.44, the lowest MAPE of 43.66%, and the lowest MAE of 57.99. This superior performance validates the hypothesis that machine learning models, with their capacity for additive decomposition and incorporation of external events, offer greater predictive robustness.
The gradual reduction of error indicators, from Model A to Model D, corroborates the hypothesis of accuracy gain of robust Machine Learning models compared to simple heuristic techniques. Prophet, by achieving an RMSE of 73.44, demonstrated a 37.3% improvement over the initial error of Model A, consolidating itself as the most efficient for modeling Olist’s demand in the analyzed scope. This result is attributed to its ability to absorb holiday effects, react to seasonal peaks, and resiliently adapt to high volatility scenarios, validating its applicability in daily granularity planning within the dynamic context of Brazilian e-commerce.
4. Conclusion
The study aimed to evaluate whether the characteristics of advanced statistical models, such as SARIMA, and machine learning models, such as Prophet, resulted in superior accuracy for forecasting demand in Brazilian e-commerce, compared to baseline methods. It was found that Olist’s time series presented high daily volatility and marked seasonal patterns, with peaks like Black Friday and higher transaction volume on weekdays. The baseline methods, Recursive Moving Average and Homologous Seasonality, demonstrated significant limitations in capturing these complexities, resulting in high predictive errors. In contrast, the SARIMA model showed a notable improvement in mitigating large-magnitude errors by capturing the systematic structure of demand. However, the Prophet algorithm established itself as the most efficient, achieving the lowest error indicators and demonstrating greater adherence to the daily fluctuations of real demand. Prophet’s ability to map variations derived from holidays and commercial events allowed for more assertive sales planning, optimizing resource allocation and logistical capacity, and mitigating stockouts. The study’s main practical contribution lies in demonstrating the significant gain in operational efficiency through the mathematical evolution of models, transforming sales forecasting into a more reliable strategic asset for the sector.
Despite the advances, this work presented limitations by grounding the projections strictly in historical and calendar data, and the reduced sample size may have influenced the results. External variables, such as the macroeconomic scenario or promotional aggressiveness, were not incorporated, and the dynamics of the daily series impose natural challenges to predictability. For future studies, it is recommended to recurrently update the projections through iterative recalculation techniques, such as the Walk-forward method, to incorporate new data and react to market changes. It is also suggested to aggregate the series to weekly or monthly levels for more assertive long-term strategic planning, in addition to applying these models to other product families and historical series, adapting the data treatment according to their particularities.
Bibliographic References
Albertin, Alberto Luiz. 2000. O comércio eletrônico evolui e consolida-se no mercado brasileiro. RAE Revista de Administração de Empresas 40(4): 94-102. Disponível em https://periodicos.fgv.br/rae/article/view/37788. Acesso em 05 out. 2025.
Carreiro, Augusto Almeida Sobral; Nose, Enio Tadashi. 2023. O avanço do e-commerce brasileiro pré e pós pandemia. Revista de Inovação e Tecnologia RIT 13(1): 85-108. Disponível em https://rit.openjournalsolutions.com.br/index.php/rit/article/view/97. Acesso em 02 dez. 2025.
Christopher, Martin. 2011. Logistics and supply chain management: creating value-adding networks. 4. ed. Harlow: Pearson Education Limited.
NIELSENIQ EBIT. 2025. Webshoppers 51ª edição – versão free: dados referentes ao panorama do e-commerce brasileiro em 2024. NielsenIQ Ebit. Disponível em https://nielseniq.com/global/pt/landing-page/ebit/nielseniq-ebit-brasil/webshoppers/. Acesso em 29 nov. 2025.
Silva, F. dos Santos; et al
Article originating from the Final Course Work of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform