Using Forecast Profiles

Objective

After completing this lesson, you will be able to use forecast profiles.

Statistical Forecast

You can use statistical forecasting to generate forecasts for various scenarios or for specific parts of your business.

  • Short-term demand forecasting (also known as; demand sensing): Days to Weeks
  • Mid-term to long-term demand forecasting: Months to Years

General Parameters for Statistical Forecasting

General Information ParametersDescription
PeriodicityMost granular time period the forecast models should be generated on (that is, weekly)
Historical PeriodsNumber of past time periods used
Forecast PeriodsFuture periods to be forecasted

General parameterization information is defined on the General tab of the forecast model.

Overview Statistical Forecasting Algorithms

IBP Demand Planning has multiple algorithms available. They range from basic algorithms to advanced algorithms using machine learning techniques. In this section, the properties of the most common algorithm used on the spectrum are highlighted. In IBP Demand Planning a number of questions are important to answer when using the appropriate algorithm(s) for forecasting: What is my sales history characteristics? Do I have sufficient historical values? What are the relevant parameters to be maintained? How can I explain the results of the forecast?

  • Basic Algorithms: Copy Past Periods | Simple Moving Average | Single Exponential Smoothing
  • Advanced Algorithms: Automated Exponential Smoothing | Croston | Auto-ARIMAX/SARIMAX

Forecasts using advanced machine learning will be explained in a dedicated chapter.

A forecast model is a self-contained configuration entity that describes how forecasting should be done, what are the inputs, where are outputs stored, and what algorithms are executed during the forecasting process and which are the parameters that drive the calculations.

The figure describes the Forecasting Models in SAP IBP for demand

Forecast Algorithms

The figure describes the Triple Exponential Smoothing (Additive Seasonality) algorithm.

An algorithm you can use to model a time series that has both trend and seasonality in it. By smoothing the trend and the seasonality along with the key figure values, the algorithm reduces the effect they have on the forecast.

If you assume that the seasonality pattern is more or less constant through the time series, set the system to define seasonal variation in terms of added or subtracted amounts that do not depend on the demand history.

If you assume that the seasonality pattern increases as the historical demand values increase, set the system to define seasonal variation in terms of multiplied values of the demand history.

The figure describes the Triple Exponential Smoothing (Multiplicative Seasonality) algorithm.

Triple Exponential Smoothing

PropertiesDescription
Time-Series Property (Recommended)Constant Models (Season)
Min. Sales History RequiredMin. 2 Historical Periods required
Relevant Parameters
  • Alpha - Degree to which sales history pattern is followed
  • Phi - Trend dampening
  • Periods in a Season
Procedure for Selection
  • MASE
  • MAPE
Practical Purpose

Quantity smoothing with seasonal and trend considerations

As with the simple moving average algorithm, weighted moving average analyzes time series data by creating a series of averages for different subsets of values measured in different subsets of periods. However, in this case, the averages for the subsets are calculated by multiplying the key figure values by predefined weights and the sum of these multiplied values is divided by the sum of the weights.

The figure describes the Weighted Moving Average algorithm.

Weighted Moving Average

PropertiesDescription
Time-Series Property (Recommended)Constant Models
Min. Sales History Requirednone
Relevant Parameters
  • Source of Weights
  • Number of Periods
Procedure for Selection
  • MASE
  • MAPE
Practical PurposeUsed for mature products with a stable sales history

An algorithm that allows the system to automatically select the most suitable exponential smoothing algorithm and coefficients for the forecast. The algorithm uses local search and optimization techniques to find the right model and smoothing parameters

The figure describes the Automated Exponential Smoothing algorithm.

Automated Exponential Smoothing

PropertiesDescription
Time-Series Property (Recommended)with/without Trend and Seasonality
Min. Sales History RequiredMin. 2 Historical Periods required (seasonal pattern: 1 seasonal cycle)
Relevant Parameters
  • Optimization of parameters within automatically selected smoothing procedure
  • Optimize parameter in manually selected smoothing procedure
Procedure for Selection
  • MASE
  • MAPE
Practical PurposeUncertainty if the product has seasonal and/or trend patterns

An algorithm you can use for products with intermittent demand, which causes a large number of zero values in the time series. By defining how the system is to handle the non-zero values when calculating a forecast, you can control the distortions that the zero values may cause in the calculation.

The figure describes the Croston Model algorithm.

Croston

PropertiesDescription
Time-Series Property (Recommended)Intermittent demand
Min. Sales History RequiredMinimum 1 Season cycle required
Relevant ParametersAlpha - Degree to which sales history pattern is followed
Procedure for Selection
  • MASE
  • MAPE
Practical PurposeTo not smooth a intermittent demand of a product over time
Additional remarks
  • Sporadic or constant forecast can be produced
  • Exponential Smoothing used to determine average demand
  • The pre-processing step should not include missing value substitution or outlier correction, as the missing values are used by croston to calculate the average interval of demand (FORECAST_ESCAPENULL is the global parameter to substitute missing values with zeros)

Linear Regression Approach

Linear regression is an approach to modeling the linear relationship between a dependent variable and one or more independent variables such as price, temperature, or GDP. The forecast depends on the future values of these independent variables, which are known or can be estimated. Note that there must be no interdependency (collinearity) between the independent variables. The forecast is calculated using linear functions, and unknown model parameters are estimated from the data.

In the demand application, linear regression is useful when various external conditions are to be considered during the forecast calculation (for example, the average temperature during certain time periods). The system looks for coefficients to multiply the independent variables with, thus getting results that are as close to the historical values as possible. This way it can predict the future values of the independent variables and calculate a forecast for the future that takes these variables into consideration.

The figure describes the Multiple Linear Regression Model algorithm.

As the demand planner, you need to consider other methods of forecasting that might be more effective in certain situations. Causal analysis can be used in situations where you have independent variables, such as price that have some influence on a dependent variable such as sales quantity. You want to use this functional context so that you can set the system to make sales react in a certain way when you change the price for the future.

Causal analysis is based on causal factors, such as prices, budgets, and campaigns. The system uses Multiple Linear Regression (MLR) to calculate the influence of causal factors on past sales. In this way, the system allows you to analyze the success of specific actions. The calculated connection between causal factors and past sales is then used as a basis for modeling future actions.

  • You use MLR to determine how a dependent variable, such as sales, is connected with independent variables called casual variables, such as prices, advertising, and seasonal factors.

  • MLR uses historical data as a basis for calculating the regression coefficients (beta) for causal analysis.

Options in Configuration of MLR

In SAP Integrated Business Planning (SAP IBP) you can define how the system is to choose the independent variables that have a significant influence on the forecast. In configuration of MLR, you have the following options:

  • None

    The system considers all independent variables for the forecast.

  • Forward Selection

    The system starts with one independent variable, then add the others one by one until it identifies all factors that are relevant for the forecast.

  • Backward Selection

    The system takes all independent variables into consideration at the beginning of the forecast calculation and one by one excludes all factors that are irrelevant for the forecast.

Independent Variables

These are the key figures to be considered by the algorithm as external factors when it calculates the forecast. Note that the number of historical periods must be two more than the number of independent variables.

Slope Dummy

The algorithm can consider the effects of trends on the forecast even when those trends cannot be explained by any known independent variables.

The slope dummy is a system-generated independent variable. The values of this variable increase by one from one period to another so they form a 45-degree slope in a chart in which the X-axis contains the time periods, the Y-axis contains time series values for the input key figure, and the intercept is always zero. The algorithm multiplies the values of the slope dummy variable with a regression coefficient, which is calculated in a way that the modified values are as close to the historical values as possible. This allows the system to predict trend values for the future and calculate a forecast that takes the trend into consideration.

Multiple Linear Regressions

PropertiesDescription
Time-Series Property (Recommended)Seasonal, product forecast in relationship to recorded independent variables (that is, Price, Temperature, GDP)
Min. Sales History RequiredMin. 2 Historical Periods required
Relevant Parameters
  • Variable Selection - how multiple independent variables should be incorporated into the forecast model
  • Independent Variable Key Figure
  • Categorical Variables - events marked with an event code for the system to learn from
Procedure for Section
  1. Learning Phase: Coefficients calculated to multiply independent variable and compare to dependent variables (independent to dependent variable change comparison)
  2. Forecasting Phase: Multiplication of future independent variable(s) with determined future coefficients
Practical PurposeForecast based on known factors that the forecast can/will have correlation in the future
Additional remarks
  • Independent Variable Key Figure should have values for historical-and forecast horizon
  • Independent Variables cannot have interdependency (co-linearity)

Forecast Accuracy

All error measurements are comparisons between the ex-post forecast and the historical values of the selected key figure. Error measurements are used to evaluate the accuracy of the algorithms used. Below, the importance of using forecast error measurements in demand planning is emphasized.

  1. Forecast Value Add: Review the benefit a planning step in improving the overall accuracy of the demand plan.
  2. Prioritization: Analyzing accuracies based on product or customer segments.
  3. Algorithm Selection: Best-Fit algorithm selection is based upon the error measurement.
  4. Algorithm Parametrization: Automatic parameter calculations are based on the error measurement.
  5. Supply Chain Network Implications: that is, Demand Variability used as input factor for Safety Stock calculations.
The figure describes the Segmenting Error Results based on a Prioritization Example.

Forecast Value Add (FVA) is a structured accuracy comparison of interdependent process steps. Error measurements can be used to compare the statistical accuracy improvement (value add) additional demand inputs have on the consensus demand.

The figure describes the Forecast Value Add Pyramid.

In SAP Integrated Business Planning (SAP IBP), the following forecast error measures can be used:

  • Mean Percentage Error (MPE)

    The mean percentage by which the ex-post forecast differs from the historical values.

  • Mean Absolute Percentage Error (MAPE)

    The mean absolute percentage by which the ex-post forecast differs from the historical values.

  • Mean Squared Error (MSE)

    The mean-squared error by which the ex-post forecast differs from the historical values.

  • Root-Mean-Square Error (RMSE)

    The root-mean-square error by which the ex-post forecast differs from the historical values.

  • Mean Absolute Deviation (MAD)

    The absolute value by which the ex-post forecast differs from the historical values, averaged over all periods for which the ex-post forecast is calculated.

  • Error Total (ET)

    The sum of all differences between the ex-post forecast and the historical values.

  • Mean Absolute Scaled Error (MASE)

    The mean absolute scaled error of one data point is defined as the one-period-ahead forecast error divided by the average forecast error of the naïve method.

  • Weighted Mean Absolute Percentage Error (WMAPE)

    Also called the "MAD/mean ratio", WMAPE is the sum of absolute errors divided by the sum of the historical values.

Forecast Post-Processing Algorithms

Error MeasurementCharacteristics
Mean Percentage Error (MPE)
  • Useful for average demand time-series
  • Negates errors caused by events
  • Positive and negative errors can yield zero
  
Mean Absolute Percentage Error (MAPE)

Similar to MPE with difference in relative error calculation

Mean Squared Error (MSE)

Appropriate for seasonal patterns with events

Root-Mean-Square Error (RMSE)

Appropriate for seasonal patterns with events

Mean Absolute Deviation (MAD)
  • Appropriate for seasonal patterns with events
  • Similar to MAPE with absolute error calculation
Error Total (ET)
  • Appropriate for seasonal patterns & events
  • Larger errors get larger weights in the final error
Mean Absolute Scaled Error (MASE)

Appropriate for multiple scenarios: trend, seasonality, intermittent demand & different time series

Weighted Mean Absolute Percentage Error (WMAPE)

Used for events and seasonality

Stock-Keeping-Oriented Prediction Error Costs (SPEC) 

Forecast Selection

You can add more than one forecasting algorithm to a forecast model, but you need to specify how the system should use the selected algorithms.

The figure describes the usage of Multiple Forecast Algorithms.

You can choose the following method:

  • Choose Best Forecast: If you choose this method and select an error measure in the Measure Used for Forecast Comparison field, the system compares the sales history with the ex-post forecasts based on the selected error measure to determine the algorithm that yields the most accurate results.

    The figure describes the usage of the Forecast Error Selection for Best-fit.

    If you specify a number in the Test Phase Periods field after selecting the Choose Best Forecast method, you split the forecasting process into the following phases:

    • Test Phase: In this phase, the system divides the historical data into a training data set and a test data set. It uses the training data set to calculate the forecast with each algorithm in the forecast model, and compares the results with the test data set to choose the algorithm that calculates the best forecast.

    • Forecasting Phase: In this phase, the system uses the algorithm with the best forecast to calculate the forecast again, this time leveraging all data in the historical horizon. The final results of this phase are saved in the target key figure.

  • Calculate Weighted Average Forecast: If you choose this method, you can assign weights to the forecasting algorithms you have added to the model. The system calculates the average forecast after multiplying each result by the weight assigned to the algorithm that was used for its calculation. Sliders make the relative weights of individual algorithms more transparent.

    The figure describes the usage of the Calculate Weighted Average Forecast.

Apart from the best forecast or calculate weighted average forecast, you can also save the results calculated by the individual algorithms. For this, you need to specify a target key figure for each relevant algorithm separately.

Auto-ARIMA/SARIMA Algorithms

The automated AutoRegressive Integrated Moving Average (Auto-ARIMA) algorithm combines auto-regression and moving average techniques to provide reliable forecasts after calculating the optimal values for certain parameters automatically and differencing the historical data to make it stationary if needed. It is useful for the high-level automation of forecasting jobs that are characterized by the following:

  • Forecasts are calculated for the near future.

  • Products typically have long lifecycles.

  • Considerable sales history is available.

  • Sudden changes in trends require automatic and rapid adjustments of the forecast OR there are no noticeable long-term correlations between the historical data points.

  • There are no noticeable dependencies between the historical sales and other variables OR data on other demand influencing variables is not available.

The figure describes the usage of the Auto-ARIMA / SARIMA Algorithm.

ARIMA is an acronym: AR – I – MA and it stands for

AAuto
RRegressive
IIntegrated
MMoving
AAverage

For each part that forms this powerful and complex algorithm, there is a certain parameter describing that component:

  • p – for AR (auto-regressive) component

  • q – for the MA (moving average) component

  • d – for the I (integrated) component

The ARIMA algorithm is suitable to be used for analyzing and forecasting various time series, but different models are used for different times series depending on the properties of the time series, for example, whether it has a trend or not, whether it has short or long memory, and so on.

An ARIMA model is a certain parameterized ARIMA algorithm that describes what values should be used for the p, d, q parameters and it is noted as ARIMA(p,d,q) triplet. For example, ARIMA(2,1,0).

The parameters are non-negative integers, usually small values below 5.

The AR component expresses how many previous values influence a certain value of the time series. As opposed to exponential smoothing where all previous values are used with decaying weights (going backwards) for predicting the next value, in ARIMA only some periods, p, are used to influence the next predication by applying auto-regression with as many lags.

The MA component is used to estimate the regression error as a moving average of previous regression errors. So, if q = 3, that means that a moving average of three periods is used to estimate the error term based on previous regressions during the training phase.

The Integrated component is used to make the time series stationary, only thenAR, and MA components (also called ARMA models) can be estimated and a prediction made.

A time series is stationary when its mean and standard deviation does not change over time. For example, if a time series contains a trend, it means that it is not stationary. By differencing it (subtracting neighboring time series values from each other, a new time series is obtained that may be stationary). The differencing techniques are repeated multiple times (d) until a stationary time series is obtained.

SARIMA Algorithm

SARIMA is a variation of ARIMA that caters for seasonality. It is often called "Seasonal ARIMA".

It has the original set of parameters, plus additional ones for seasonal regressions.

ARIMA ParametersAdditional SARIMA Parameters

p – for the AR (auto-regressive) component

q – for the MA (moving average) component

d – for the integrated component

P – for the seasonal AR component

Q – for the seasonal MA component

D – for the seasonal differencing

m – for the length of the seasonal cycle

An ARIMA model is described using the notation ARIMA(p,d,q,P,D,Q)m.

For example: ARIMA(2,1,0,0,1,0)12. In this case, p = 2, d = 1, q = 0, P = 0, D = 1, Q = 0, and the length of the seasonal cycle is 12 periods.

Using ARIMA for prediction requires a lot of expert knowledge and entails the analysis of the time series especially analysis of the auto-correlation (AFC) and the partial auto-correlation (PACF) functions and various other plots, especially on residuals, to determine the most appropriate ARIMA model to be used to create the prediction.

SAP Integrated Business Planning (SAP IBP) offers an automated version of the ARIMA and SARIMA implementation where the system internally does various tests to determine how many times the input time series needs to be differenced to come to a stationary time series (parameters d and D), also determines the optimal orders for the AR and MA components (p, P, q, Q) automatically by minimizing a certain criterion.

If seasonal items are to be forecasted, the seasonality needs to be enabled for auto-ARIMA/SARIMA, in which case, it can automatically check for seasonality by using a seasonality test and can determine automatically the length of the seasonality cycle if not provided.

The optimal model during the ARIMA execution in SAP IBP can be determined by minimizing a certain information criterion: AIC, AICc, or BIC.

Gradient Boosting

Gradient boosting of decision trees (shortened here as gradient boosting) is an ensemble machine learning algorithm for regression and classification problems. It is useful in demand planning when several external conditions are to be considered during the forecast calculation (the average temperature during certain time periods, the price, and so on).

Gradient boosting is similar to other regression models in that it considers independent variables to explain a target variable such as sales history and calculates a forecast based on the results. However, as an ensemble method for regression it performs repeated optimization on several decision trees, each of which is a tree-like model of decisions and their possible consequences. The goal of this tree-building process is to create a tree that determines which independent variables should be considered at which level of the tree from what threshold during the forecast calculations. The individual trees are thus combined into an ensemble model to achieve overall better accuracy than a single decision tree.

For example, while building a decision tree, the algorithm may conclude that out of the values of the average monthly temperature, 20°C has the largest influence on the sales values. This is one split in the tree. If the algorithm finds that the average monthly temperature is to be considered before another independent variable such as the price of the product, this priority is also reflected in the tree. Once these splits are determined and the decision tree is built, the algorithm can use it to determine future outcomes for given inputs.

The following graphic shows a part of a decision tree that could be used for demand planning:

The figure shows a part of a decision tree that could be used for demand planning.

The following chart shows an example of the input and results of a gradient boosting process in which the average temperature is considered as an independent variable:

The figure shows an example of the input and results of a gradient boosting process in which the average temperature is considered as an independent variable.

Copy Past Periods

Copy Past Periods is a basic algorithm that is useful when the sales history is repetitive and the demand is easily forecastable. For example, you may want to copy past periods when the monthly sales data is expected to be similar from one year to the other.

The algorithm also allows you to assess the efficiency of more complex forecasting algorithms by comparing their accuracy to the accuracy of a simple algorithm like this.

The algorithm calculates the forecast by copying the selected number of the most recent data points from the sales history to the future horizon. If the forecast horizon is longer than X, the remaining periods are filled with the same set of values in a repeated manner.

For example, if the current month is July, there are six periods in the past, and you choose to copy the most recent three periods, the algorithm copies those three values to every subsequent set of three periods in the future. This is illustrated by the following table:

The figure shows an example for the relationship between Sales History & Forecast.

You can also decide that the system should copy an increased or decreased version of the historical data. For this purpose, you can specify a percentage adjustment for the algorithm that should be applied to all historical values. For example, if you set the percentage adjustment to 120, the system will calculate the 120% of each value and copy the results to future periods.

Before the copying, missing historical values are substituted as specified in the pre-processing steps of the forecast model or defined by the MIN_FORECAST global configuration parameter.

Calculation of the Ex-Post Forecast

For the ex-post forecast, the number of periods that should be copied is used by the system as it was a lag. This means the following:

  • For the first set of the selected number of historical periods, the ex-post forecast can’t be calculated as there’s no data to copy.
  • For the other historical periods, the ex-post forecast is equal to the actual sales obtained the selected number of periods before.

For example, if the current month is July, there are six periods in the past, and you choose to copy the most recent three periods, the algorithm doesn't calculate an ex-post forecast for the first three periods. Instead, it copies the sales history values from January to April, from February to May, and from March to June, and uses these copied values as the ex-post forecast. This is illustrated by the following table:

The figure shows an example for the relationship between Sales History, Ex-Post Forecast & Forecast.

Use Statistical Forecasting

You need to create a statistical forecast profile in the Manage Forecast Models app.

Steps

  1. Create a forecast profile with a three week moving average, called SimpleMovingAvg## using the data in the following table.

    Field

    Value

    General

    Model NameSimpleMovingAvg##
    DescriptionSimple Moving Average GR##
    PeriodicityWeekly
    Historical Periods12
    Forecast Periods12

    Forecasting Steps

    Main Input for Forecasting StepsDelivered Qty Adjusted
    Target Key Figure for ForecastStatistical Forecast Qty
    Target Key Figure for Ex-Post ForecastExpost Forecast Qty

    Algorithms

    Simple Moving Average

    Number of Periods3
    Extended Calculation to Future Periods

    Selected

    Post-processing Steps

    Mean Absolute Percentage Error (MAPE)

    Selected

    Target Key Figure for MAPEModel Fit Error: MAPE
    Mean Absolute Scaled Error (MASE)

    Selected

    Target Key Figure for MASEModel Fit Error: MASE
    1. In the Web UI, in the Demand Planner group, choose the Manage Forecast Models tile.

    2. Choose Create Model on the right side of the screen and choose planning area ZSAP6 in the dialog box that appears.

    3. Enter the data from the table on the appropriate tabs and choose Save.

  2. Open the demand planning favorite that you have created for the HT_0## Product ID at the Product ID, Location ID, and Customer ID level and run the forecast model SimpleMovingAvg## that you have created in the previous exercise. Make sure that the Location ID has been added in the Planning View. Note: When running an application job from the Excel add-in or Planner Workspace, the filters are automatically adapted from the planning view filters.

    1. To refresh the available forecast models and update it with the newly created model, first log off in the Excel add-in and log in to a new session.

    2. In the add-in for Microsoft Excel, choose FavoritesDemand Planning. Open the favorite and confirm that the data is displayed at Product, Location, Customer level.

    3. In the Application Jobs section, choose Statistical Forecasting → Run.

    4. A message will pop up informing you that the settings of the view will be copied over to the job prompt. Choose Ok.

    5. Ensure that the Product ID, Location ID, and Customer ID attributes are selected.

    6. Ensure that the pre-filled values for Time period as Weekly and versions as Baseline are selected.

    7. Choose PC for the Target UoM value.

    8. Select your SimpleMovingAvg## forecast profile.

    9. Select the Filter tab and select the attribute Product ID and value HT_0##.

    10. Choose Next and Run (the Reason Code and Comment are optional).

    11. A message will pop up informing you about the status of the job with navigation to the detailed status overview, from where job logs can be checked. Choose either Navigate to Status to see the status of the job in detail, or choose OK to close the pop up.

    12. When the job has finished, go to the next exercise step.

  3. Refresh your planning view after the forecast job has finished, to see the results of the forecasting run. Add the key figures Delivered Qty Adjusted and Statistical Forecast Qty to the embedded chart on top of the data structure.

    1. In the Data Input section, choose the Refresh icon.

    2. Observe the update of the Statistical Forecast Qty key figure values in future weeks.

    3. Add both the Delivered Qty Adjusted and Statistical Forecast Qty key figures to the chart and display them as line charts. Add them by marking the Excel cells with both key figure names (Cells J6 and J7) . Then choose + in the Series section of the chart area.

    4. Confirm that both key figures are displayed in the chart. If they are not displayed as line charts use the native Excel options to change the chart layout, by clicking into one of the chart elements. Observe that a new Excel menu for Chart Tools is visible. Navigate to Design and choose Change Chart Type. Now, you can choose to display the key figures as line charts. Ensure that you are displaying at least three periods in the past.

    5. Observe that the forecast does not immediately start as a constant, but only future periods are constant. This is due to the Extend Calculation to Future Periods indicator being set in the forecast profile.

  4. Check the values of MAPE and MASE in the business log.

    1. In the add-in for Microsoft Excel, in the Application Jobs section, choose Statistical Forecasting → Status.

    2. Locate your planning run and choose Show Business Log.

    3. You do not need to filter the list, just choose OK.

      What was the MAPE value for the Product, Location, Customer combination?

      What was the MASE value for the Product, Location, Customer combination?