## 5 Conclusions  
A common obstacle in using ARIMA models for forecasting is that the order selection process is usually considered subjective and difficult to apply. Identifying an appropriate state space model for a time series is also not an easy task. In this work, a cross-validation procedure is used to identify an appropriate ARIMA model and an appropriate state space model for a time series. A minimum size for the training set is specified. The procedure is based on one-step forecasts and uses different training sets, each containing one more observation than the previous one. All possible ETS models and all ARIMA models where the orders are allowed to range reasonably are fitted considering raw data and log-transformed data with regular differencing (up to second order differences) and, if the time series is seasonal, seasonal differencing (up to first order differences). The value of RMSE for each model is calculated averaging the one-step forecasts obtained. The model which has the lowest RMSE value and passes the Ljung-Box test using all of the available data with a reasonable significance level is selected among all the ARIMA and ETS models considered. One of the advantages of this model identification procedure is to be able to compare models that have different orders of differencing and/or different transformations, which is not the case when models are compared using Akaike's Information Criterion or Bayesian Information Criterion values. The application of the model identification procedure is exemplified in the paper with a case study of retail sales of different categories of women's footwear from a Portuguese retailer. To be able to compare the accuracies of the forecasts obtained with the ETS and ARIMA models selected by the cross-validation procedure developed, we also evaluated the forecasts from another three forecasting approaches: the Hyndman and Khandakar [23] algorithm for ARIMA models, the Hyndman and Athanasopoulos [16] statistical framework for ETS models and the seasonal naive method. According to the results, our procedure to find an ARIMA model produces the most accurate forecasts when judged by RMSE, MAE, MAPE and MASE. The RMSE, MAE and MASE produce the same accuracy ranking. The MAPE consistently ranks differently, which reinforces the impact that its limitations can have on the results. Our procedure to find a state space model and an ARIMA model consistently forecasts more accurately than the Hyndman and Athanasopoulos [16] statistical framework and the Hyndman and Khandakar [23] algorithm, and the improvements in the forecast accuracy are significant. Both transformation and differencing were important for improving ARIMA's ability to model. Transformation did not seem to be significant for accuracy for state space models. Large values of MAPE were found when data contained numbers close to zero, which shows the effect that the limitations of this accuracy measure may have on forecasting results.  
Project \"TEC4 Growth-Pervasive Intelligence, Enhancers and Proofs of Concept with Industrial Impact/NORTE-01-0145-FEDER-000020\" is financed by the North Portugal Regional Operational Programme (NORTE 2020), under the FORTUGAL 2020 Partnership Agreement, and through the European Regional Development Fund (ERDF).  
[PERSON] designed the cross-validation procedure and [PERSON] implemented the algorithm and performed the empirical study. [PERSON] wrote the paper and [PERSON] helped to improve the manuscript. Both authors read and approved the final manuscript.  
The authors declare no conflict of interest.