ARIMA algorithm in ATT forecast engine
The AI service is developed as a REST service that provides endpoints to allow the calling of various Machine Learning or AI packages implemented in Python. Python is widely used in the Machine Learning forecasting community and frameworks such as Tensorflow, Keras, and Pmdarima.
Representational state transfer (REST) is an existing standard for a software architecture for interactive applications that use multiple Web services. A REST API (RESTful API) is an application programming interface (API) that conforms to the constraints of REST architectural style and allows for interaction with RESTful web services.
Currently, single item forecasting calls are supported in the AI service, in which the forecast input data for a single item is passed to the server and the engine result is returned.
Functionality
- The python ARIMA technique (auto_arima) implements the Seasonal ARIMA (SARIMA) method.
The non-seasonal ARIMA models are denoted as ARIMA(p,d,q) where p, d, and q parameters
are non-negative integers such as:
- p: the order (number of time lags) of the autoregressive model
- d: the degree of differencing, which means the number of times the data have had subtracted the past values.
- q: the order of the moving-average model
- The Seasonal ARIMA models are usually denoted as ARIMA(p,d,q)(P,D,Q)m, where m refers to the number of periods in each season, and the P,D,Q refers to the autoregressive, differencing, and moving average terms for the seasonal part of the ARIMA model.
- The auto_arima method uses various tests to determine the level of differencing
required and subsequently fits multiple ARIMA models with different values for p, q, P
and Q, the auto-regressive and moving average parameters for the non-seasonal and
seasonal elements of the model respectively.Note: The model with the lowest Information Criterion is selected and returned.
The history and mask of each item and location must be retrieved and passed to the AI service as follows:
- Normalize the history as per other algorithms.
- Perform the standard short history check and SMP check, as per other algorithms.
For example, consider these history indexes and history values:
- Index: 5, 6, 7
- History: 100, 400, 110
Masking index period ‘6’ condenses the history which is now passed to ARIMA as:
- 5, 6
- 100, 110
- Index 7 become index 6
Consequently, the period is shifted with respect to the index position which effects the seasonality.
This process differs from other SCP forecast algorithms which maintain the history in place, however, processes the history as a missing value. For example, where period index ‘6’ is masked, Index (5, 6, 7) and History (100, 400, 110) becomes Index (5, 6, 7) and History (100, , 110).
The masked period is missing (not assumed as 0) and the next non-masked period is maintained as index 7.
The auto_arima method can fail based on a specified data set. You can consider this process as an example:
- Call auto_arima with seasonal = True (irrespective of the Model Form parameter).
- If the call passes, exit and return from the engine with the selected model.
- If the call fails, recall auto_arima with seasonal = False:
- If this call passes, exit and return from the engine with the selected model.
- If this call fails, return to the main forecast engine with the python exception:
- Return from the forecasting engine to SCP with the python exception and without a model.
Result
These are the results of forecast engine call with ARIMA algorithm:
- The exceptions generated by the third-party technique cannot be determined, hence the call is returned to SCP directly. The related messages must be reported to Infor Support Portal and are displayed in the English language, irrespective of the current language of the user.
- The appropriate results are retrieved from the forecast engine result set based on the Forecast Engine measure mapping settings and the results are applied to Scenario values. The forecast is returned and processed as per other algorithms.
- An automated ARIMA model fits seasonal and non-seasonal models and picks the “best” using the information criteria (cAIC). If the fit fails with an exception, the automated ARIMA model is refitted without a seasonal model. A check is performed based on certain criteria of the returned model to decide whether the resultant model form is Seasonal, Linear, or Constant.
- Degrees of Freedom, returned for other algorithms, is not populated by the implemented ARIMA technique. If Degrees of Freedom is mapped in the Engine, the value is returned as 0. For more details on Forecast Engine output values and forecasting parameters applicable to ARIMA. See CallForecastEngine parameters.
- When the forecast engine is called using ARIMA algorithm and the SCP AI service is not configured or available, a warning message is logged in the Audit Log listing each item and location combinations that are not processed.