## 5 Our Approach
### Arima  
A time series is a sequence of measurements of the same variable(s) made over time. Usually the measurements are made at evenly spaced times - for example, daily or monthly. An ARIMA (\(p,d,q\)) (Autoregressive Integrated Moving Average) model, in time series analysis, is a stochastic process [16] that fits to time series data, and predicts future points in the series. ARIMA is well suited for the proposed use case because it allows working, not only with (_price_, _date_) tuples, but also with external information included within the model as exogenous features. For instance, we can see if adding a new exogenous feature improves the overall accuracy or not. This can be useful to understand how the model reacts to different external features and how much they influence the precision of the forecast. Since in our study we found out that an external feature like _Product's Manufacturer Popularity_ affects the forecast, this particular functionality of the algorithm is quite useful. More information on ARIMA can be found in literature [28; 32]. The model is a combination of three parts _AR_, \(I\), _MA_. These parts are affected by the parameters (_p_, \(d\), _q_). Below, we shortly explain each of them:  
* **AutoRegressive model (AR):** An autoregressive model AR(_p_) specifies that the output variable depends linearly on its own previous values and on a stochastic term. The order of an autoregressive model is the number of immediately preceding values in the series that are used to predict the value at the present time. The notation AR(p) indicates an autoregressive model of order p. The AR(_p_) model is defined as: \[X_{t}=c+\sum_{i=1}^{p}\varphi_{i}X_{t-1}+\varepsilon_{t}\] where \(\varphi_{1},\ldots,\varphi_{p}\) are the _parameters_ of the model, \(c\) is a constant and \(\varepsilon_{t}\) is white noise. * **Integrated (I):** It indicates the degree of differencing of order \(d\) of the series. Differencing in statistics is a transformation applied to time series data in order to make it stationary. As formalized in [16], a process \(\{Y_{t}\}\) is stationary if the probability distributions of the random vectors \((Y_{t_{1}},Y_{t_{2}},\ldots,Y_{t_{n}})\) and \((Y_{t_{1+1}},Y_{t_{2+1}},\ldots,Y_{t_{n+1}})\) are the same arbitrary times \(t_{1},t_{2},\ldots,t_{n}\), all \(n\), and all lags or leads \(l=0,\pm 1,\pm 2,\ldots\). A stationary time series does not depend on the time at which the series is observed. To differentiate the data, the difference between consecutive observations is computed. Mathematically, this is shown as: \[y^{\prime}_{t}=y_{t}-y_{t-1}\]where \(y_{t},y_{t-1}\) are the values of the series, respectively, at time \(t\), \(t\)-\(I\), and \(y^{\prime}_{t}\) is the differenced value of the series at time \(t\). More formally, denoting as \(y\) the \(d^{th}\) difference of \(Y\), the forecasting equation can be defined as follows: \[ \begin{array}{ll}If&d=0:y_{t}=Y_{t}\\ If&d=1:y_{t}=Y_{t}-Y_{t-1}\\ If&d=2:y_{t}=(Y_{t}-Y_{t-1})-(Y_{t-1}-Y_{t-2})=Y_{t}-2Y_{t-1}+Y_{t-2}\end{array} \] It should be noted that the second difference of \(Y\) (i.e., \(d=2\) case) does not represent the difference from 2 periods ago but the _first-difference-of-the-first difference_, since it is the discrete analog of a second derivative [43]. The ARIMA approach requires that the data are stationary. When the times series is already stationary, then an ARMA model is estimated. On the contrary, if the time series is not stationary, then the series must be transformed to become stationary (order of integration \"I\" meaning the number of times that the series must be differentiated to get stationarity), and we work with an ARIMA model. If a time series is stationary, then taking first-differences is not needed. The series is integrated of order zero (\(d=0\)), and we specify an ARMA model since differencing does not eliminate the seasonal structure existing in the data.