
05115130 Supply Chain Modelling and Optimisation
9 Jun 2026
Forecasting is the process of making predictions based on past and present data.
Purpose in Supply Chain:
Forecasting
Planning
Procurement
Production
Delivery
Demand variability
The fluctuations or changes in customer demand for a product or service over a specific period, which could cause disruptions in the supply chain.
Lead time fluctuation
The inconsistency or unpredictability in the duration it takes for tasks or materials to traverse the supply chain.
Data quality issues
An intolerable defect in a dataset that reduces its reliability and trustworthiness. The most common issues are incomplete and inconsistent data.
Bullwhip effect
A SC phenomenon where a change in demand at the retail level leads to increasingly larger fluctuations in demand at the wholesaler and manufacturer levels.
Seasonality and trend shifts
The periodic fluctuations that occur at specific regular intervals, such as weekly, monthly, or quarterly, often influenced by seasonal factors.
Forecasts are often grouped by time horizon.
Short-Term
Medium-Term
Long-Term
Qualitative Methods
Quantitative Methods
Delphi Method
A qualitative forecasting technique that uses a panel of experts who anonymously provide forecasts and opinions through multiple rounds of questionnaires.
Then, the reports are statistically aggregated and shared with the group after each round, allowing experts to revise their forecasts based on the feedback from others.
The process continues until a consensus is reached or a predefined number of rounds is completed.
The method is useful for forecasting in situations where there is a lack of historical data or when the future is highly uncertain, such as in new product development or technological forecasting.
Expert Opinions → Questionnaire → Summary Feedback → Revised Forecasts
↓
Consensus
Consensus is reached through multiple rounds of expert feedback.

The results indicate that
In the first round, experts give very different forecasts.
After seeing the summary of responses, they reconsider their estimates.
Over several rounds, opinions move closer together.
Quantitative forecasting methods use historical data and mathematical models to predict future values.
The examples include:
Naïve forecasting: Assumes the future will be the same as the most recent observation.
Regression analysis: Models the relationship between a dependent variable and one or more independent variables.
Moving average: Averages a fixed number of the most recent data points to smooth out fluctuations.
Exponential smoothing: Applies decreasing weights to past observations to forecast future values.
Time series decomposition: Breaks down a time series into trend, seasonal, and random components.
These methods are typically more objective and can be more accurate than qualitative methods when there is sufficient historical data available.
Demand data often follows different patterns that influence the choice of forecasting method. The most common demand components are
Level
A constant (stable) average demand over time.

Naïve forecasting, moving average, exponential smoothing
Trend
Demand gradually increases or decreases over time.

Linear models, regression, Holt’s exponential smoothing
Seasonality
Regular and predictable fluctuations in demand that occur at specific intervals, such as weekly, monthly, or quarterly. Most commonly observed in retail.

SARIMA, Holt-Winters models, seasonal naïve forecasting
Random variation
No clear pattern and caused by unpredictable factors, such as sudden weather changes, economic shifts, or market disruptions.

Statistical smoothing methods, safety stock planning, scenario analysis
\[ \text{Demand = Trend + Seasonality + Random Variation} \]
Assumes the next period forecast \(F_{t+1}\) will be the same as the current period,
\[ F_{t+1} = F_t \]
| Period | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Demand \(F_t\) | 100 | 108 | 115 | 120 | 118 | 125 | 130 | 128 | 135 | 140 | 145 | 150 |
| Forecast \(F_{t+1}\) | - | 100 | 108 | 115 | 120 | 118 | 125 | 130 | 128 | 135 | 140 | 145 |

\[ \hat{y} = a + bx \]
where \(\hat{y}\) is the predicted value, \(x\) is the independent variable, \(a\) is the intercept, and \(b\) is the slope of the line:
\[ b = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1} \]

In linear regression, the best-fit line is the straight line that most accurately represents the relationship between the independent variable (input) and the dependent variable (output). It is the line that minimises the residuals, given by: \[\text{Residual} = y_i - \hat{y}_i,\]
where \(y_i\) = the actual observed value and \(\hat{y}_i\) = predicted value
The least squares method minimises the sum of the squared residuals (SSE):
\[SSE = \sum (y_i - \hat{y}_i)^2\]

Given \(n\) observations \((X_i, Y_i)\), we can fit a line to the overall pattern of these data points. From the Least Squares Method, we can calculate the slope \(b\) and intercept \(a\) using the following formula:
\[b = \frac{\sum XY - n\bar{x}\bar{y}}{\sum X^2 - n\bar{x}^2} = \frac{\sum (X_i - \bar{x})(Y_i - \bar{y})}{\sum (X_i - \bar{x})^2}\]
\[a = \bar{y} - b\bar{x}, \quad \bar{x} = \frac{\sum X}{n}, \quad \bar{y} = \frac{\sum Y}{n}\]
Predict the demand \(Y\) based on week number \(X\) using SLR.
Step 1: Raw Data
| Week (\(X\)) | Demand (\(Y\)) |
|---|---|
| 1 | 120 |
| 2 | 150 |
| 3 | 170 |
| 4 | 200 |
| 5 | 220 |
Step 2: Compute Intermediate Values
| \(X\) | \(Y\) | \(X^2\) | \(XY\) | |
|---|---|---|---|---|
| 1 | 120 | 1 | 120 | |
| 2 | 150 | 4 | 300 | |
| 3 | 170 | 9 | 510 | |
| 4 | 200 | 16 | 800 | |
| 5 | 220 | 25 | 1100 | |
| \(\sum\) | 15 | 860 | 55 | 2830 |
\[ b = \frac{\sum XY - n\bar{x}\bar{y}}{\sum X^2 - n\bar{x}^2} = \frac{2830 - 5(15/5)(860/5)}{55 - 5(15/5)^2} = 25 \]
\[ a = \bar{y} - b\bar{x} = 860/5 - 25 \cdot 15/5 = 97 \qquad\Rightarrow \hat{Y} = 97 + 25X \]
Calculate the predicted demand for each week and determine the corresponding SSE.
Step 3: Compute \(\hat{Y}\) and \((Y_i - \hat{Y}_i)^2\)
| \(X\) | \(Y\) | \(\hat{Y}\) | \(Y_i - \hat{Y}_i\) | \((Y_i - \hat{Y}_i)^2\) | |
|---|---|---|---|---|---|
| 1 | 120 | ||||
| 2 | 150 | ||||
| 3 | 170 | ||||
| 4 | 200 | 197 | 3 | 9 | |
| 5 | 220 | 222 | -2 | 4 | |
| \(\sum\) | 15 | 860 | 863 |
\[SSE = \sum (y_i - \hat{y}_i)^2\]
Exercise 1: Fit a linear regression model to predict Sales (\(Y\)) from Ad Spend (\(X\)). Use the equation to predict sales when ad spend = 275.
| Ad Spend | 100 | 150 | 200 | 250 | 300 |
|---|---|---|---|---|---|
| Sales | 20 | 25 | 30 | 32 | 35 |
Exercise 2: Fit a regression model to forecast production time based on the number of units.
| Units | 10 | 20 | 30 | 40 | 50 |
|---|---|---|---|---|---|
| Time (hrs) | 50 | 45 | 40 | 35 | 30 |
Exercise 3: Fit a linear regression line. Then, estimate how many visitors the site will get if 6 blog posts are published in a week.
| Post Published | 2 | 4 | 3 | 5 | 1 |
|---|---|---|---|---|---|
| Visitors | 120 | 190 | 170 | 220 | 100 |
\[\hat{Y}_{t+1} = \frac{Y_t + Y_{t-1} + \cdots + Y_{t-n+1}}{n},\]
The choice of number of periods will affect the forecasting results.
Moving averages are widely used in financial markets to analyse stock price trends and make trading decisions. They help investors identify potential buy or sell signals based on the relationship between short-term and long-term moving averages.

Figure 2. Stock Trading Using Moving Average
Given the historical demand from Period 1 to 10, use 3-period moving average to forecast the demand in Period 4 to Period 11.
| Period | Demand (Y) | 3-period MA |
|---|---|---|
| 1 | 120 | |
| 2 | 135 | |
| 3 | 150 | |
| 4 | 140 | 135.00 |
| 5 | 170 | 141.67 |
| 6 | 175 | 153.33 |
| 7 | 165 | 161.67 |
| 8 | 185 | |
| 9 | 170 | |
| 10 | 200 | |
| 11 |
\[\hat{y}_4 = \frac{120 + 135 + 150}{3} = 135\]
\[\hat{y}_5 = \frac{135 + 150 + 140}{3} = 141.67\]
\[\hat{y}_6 = \frac{150 + 140 + 170}{3} = 153.33\]
\[\hat{y}_7 = \frac{140 + 170 + 175}{3} = 161.67\]

A warehouse records the weekly demand (in units) for a specific component. Use moving averages with different periods to forecast demand and evaluate their effectiveness.
| Week | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Demand | 200 | 220 | 210 | 240 | 230 | 250 | 270 | 260 | 240 |
Instructions:
1. Compute forecasts using 2-MA, 3-MA, and 4-MA
| Period | Y | 2-MA | 3-MA | 4-MA |
|---|---|---|---|---|
| 1 | 200 | |||
| 2 | 220 | |||
| 3 | 210 | |||
| 4 | 240 | |||
| 5 | 230 | |||
| 6 | 250 | |||
| 7 | 270 | 240 | ||
| 8 | 260 | 260 | 250.00 | |
| 9 | 240 | 265 | 260.00 | 252.50 |
| 10 | 250 | 256.67 | 255.00 |

2-3. Compute the SSE for each model. Which period MA performed best?
| Period | Y | 2-MA | 3-MA | 4-MA |
|---|---|---|---|---|
| 1 | 200 | |||
| 2 | 220 | |||
| 3 | 210 | |||
| 4 | 240 | |||
| 5 | 230 | |||
| 6 | 250 | |||
| 7 | 270 | 240 | ||
| 8 | 260 | 260 | 250 | |
| 9 | 240 | 265 | 260 | 252.50 |
\[\hat{Y}_{t+1} = w_1Y_t + w_2Y_{t-1} + \cdots + w_nY_{t-n+1}\]
\[\sum w_i = 1\]
The choice of weights will affect the forecasting results.
A logistics manager tracks weekly outbound shipment volumes for a distribution center. To better anticipate outbound volume and optimize truck scheduling, you will forecast demand using both 3-period SMA and 3-period WMA with custom weights as follows:
| Week | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Demand | 400 | 420 | 410 | 450 | 460 | 470 | 440 | 480 | 500 |
| X | Y | 3 MA | Error (SMA) | 3 WMA | Error (WMA) |
|---|---|---|---|---|---|
| 1 | 400 | ||||
| 2 | 420 | ||||
| 3 | 410 | ||||
| 4 | 450 | 410.00 | 40.00 | 39 | |
| 5 | 460 | 426.67 | 33.33 | 28 | |
| 6 | 470 | 440.00 | 30.00 | 23 | |
| 7 | 440 | 460.00 | -20.00 | -23 | |
| 8 | 480 | 456.67 | 23.33 | 27 | |
| 9 | 500 | 463.33 | 36.67 | 34 | |
| 10 | 473.33 |
Which method performed better overall? Why?

Which method performed better overall? Why?
\[\hat{Y}_{t+1} = \alpha Y_t + (1 - \alpha)\hat{Y}_t\]

How different values of \(\alpha\) (smoothing constant) affect the weights assigned
| \(\alpha\) Value | Behaviour | Use Case |
|---|---|---|
| 0.1 - 0.3 | Slow, more smoothing | Stable demand |
| 0.4 - 0.7 | Balanced response | Mild variability |
| 0.8 - 1.0 | Fast, less smoothing | Erratic or fast-changing demand |
Use MAE or RMSE to pick optimal \(\alpha\) using trial/error or optimisation.
A supply chain manager wants to forecast weekly demand using Simple Exponential Smoothing (SES).
\[\hat{Y}_{t+1} = \alpha Y_t + (1 - \alpha)\hat{Y}_t\]
| Period | Actual Demand | Forecast | Calculation |
|---|---|---|---|
| 1 | 200 | 200 (given) | Initial forecast |
| 2 | 220 | 200 | \(0.3 \times 200 + 0.7 \times 200\) |
| 3 | 210 | 206 | \(0.3 \times 220 + 0.7 \times 200\) |
| 4 | 230 | 207.20 | \(0.3 \times 210 + 0.7 \times 206\) |
| 5 | 225 | 214.04 | \(0.3 \times 230 + 0.7 \times 207.2\) |
| 6 | 240 | 217.33 | \(0.3 \times 225 + 0.7 \times 214.04\) |
| 7 | 224.13 | \(0.3 \times 240 + 0.7 \times 217.33\) |
Conduct sensitivity analysis by varying \(\alpha\) and observing how the forecasts change. Try \(\alpha = [0.3, 0.5, 0.7, 0.9]\) and compare the results.
import numpy as np
actual = np.array([200, 220, 210, 230, 225, 240])
alpha = [0.3, 0.5, 0.7, 0.9]
forecasts = {}
for a in alpha:
forecast = np.empty_like(actual, dtype=float)
forecast[0] = 200 # initial forecast
for t in range(1, len(actual)):
forecast[t] = a * actual[t-1] + (1 - a) * forecast[t-1]
forecasts[a] = forecast
## sse for each alpha
sse = {a: np.sum((actual - forecasts[a]) ** 2) for a in alpha}
plt.figure(figsize=(8, 4.5))
plt.plot(np.arange(1, len(actual)+1), actual, marker='o', label='Actual')
for a in alpha:
plt.plot(np.arange(1, len(actual)+1), forecasts[a], marker='o', label=f'{a} (SSE={sse[a]:.2f})')
plt.xlabel('Period')
plt.ylabel('Demand')
plt.title('SES Forecasting with Different Alpha Values')
plt.legend(frameon=False)
plt.grid()
plt.show()
Calculate the SSE for the forecasts and discuss how well SES using the best \(\alpha\) performed compared to a simple moving average with a 3-period window and regression analysis.
import numpy as np
actual = np.array([200, 220, 210, 230, 225, 240])
alpha = 0.7
## SES Forecasting
forecast = np.empty_like(actual, dtype=float)
forecast[0] = 200 # initial forecast
for t in range(1, len(actual)):
forecast[t] = alpha * actual[t-1] + (1 - alpha) * forecast[t-1]
sse_ses = np.sum((actual - forecast) ** 2)
## 3-period MA Forecasting
ma_forecast = np.convolve(actual, np.ones(3)/3, mode='valid')
sse_ma = np.sum((actual[2:] - ma_forecast) ** 2)
## regression curve fitting
x = np.arange(1, len(actual) + 1)
b = np.cov(x, actual, ddof=0)[0, 1] / np.var(x)
a = np.mean(actual) - b * np.mean(x)
reg_forecast = a + b * x
sse_reg = np.sum((actual - reg_forecast) ** 2)
# plotting
plt.figure(figsize=(8, 4.5))
plt.plot(np.arange(1, len(actual)+1), actual, marker='o', label='Actual')
plt.plot(np.arange(1, len(actual)+1), forecast, marker='o', label=r'SES (SSE={:.2f})'.format(sse_ses))
plt.plot(np.arange(3, len(actual)+1), ma_forecast, marker='o', label=r'3-MA (SSE={:.2f})'.format(sse_ma))
plt.plot(x, reg_forecast, marker='o', label=r'Regression (SSE={:.2f})'.format(sse_reg))
plt.xlabel('Period')
plt.ylabel('Demand')
plt.legend(frameon=False)
plt.grid()
plt.show()
An extension of simple linear regression that models the relationship between a dependent variable and multiple independent variables.
Useful for forecasting when demand is influenced by several factors (e.g., price, advertising spend, seasonality).
The model takes the form: \[Y = a + b_1 X_1 + b_2 X_2 + \cdots + b_k X_k,\] where
| Month | Ad Spend ($000) \(X_1\) | Fuel Price ($/L) \(X_2\) | Deliveries \(Y\) |
|---|---|---|---|
| Jan | 5 | 1.2 | 1200 |
| Feb | 7 | 1.3 | 1300 |
| Mar | 6 | 1.1 | 1250 |
| Apr | 8 | 1.2 | 1350 |
| May | 9 | 1.5 | 1400 |
Goal: Predict delivery volume based on advertising spend and fuel price.
\[ Y = a + b_1 X_1 + b_2 X_2 \]
To fit the model manually, we calculate
| Month | \(X_1\) | \(X_2\) | \(Y\) | \(X_1^2\) | \(X_2^2\) | \(X_1X_2\) | \(X_1Y\) | \(X_2Y\) |
|---|---|---|---|---|---|---|---|---|
| Jan | 5 | 1.2 | 1200 | 25 | 1.44 | 6.0 | 6000 | 1440 |
| Feb | 7 | 1.3 | 1300 | 49 | 1.69 | 9.1 | 9100 | 1690 |
| Mar | 6 | 1.1 | 1250 | 36 | 1.21 | 6.6 | 7500 | 1375 |
| Apr | 8 | 1.2 | 1350 | 64 | 1.44 | 9.6 | 10800 | 1620 |
| May | 9 | 1.5 | 1400 | 81 | 2.25 | 13.5 | 12600 | 2100 |
| Sum | 35 | 6.3 | 6500 | 255 | 8.03 | 44.8 | 46000 | 8225 |
\[ \begin{align} \sum Y =&\;\; na + b_1 \sum X_1 + b_2 \sum X_2 \\ \\ \sum X_1Y =&\;\; a \sum X_1 + b_1 \sum X_1^2 + b_2 \sum X_1X_2\\ \\ \sum X_2Y =&\;\; a \sum X_2 + b_1 \sum X_1X_2 + b_2 \sum X_2^2 \end{align} \]
\[ \begin{align} 6500 =&\;\; 5a + 35b_1 + 6.3b_2 \\ \\ 46000 =&\;\; 35a + 255b_1 + 44.8b_2\\ \\ 8225 =&\;\; 6.3a + 44.8b_1 + 8.03b_2 \end{align} \]
\[ a \approx 950; \qquad b_1 \approx 50; \qquad b_2 \approx 0 \]
So the estimated regression equation is
\[ \hat{Y} = 950 + 50X_1 + 0X_2 \]
Suppose that \(X_1 = 10\) and \(X_2 = 1.4\).
Then predicted delivery volume is
\[ \hat{Y} = 950 + 50(10) + 0(1.4) = 950 + 500 = \boxed{1450} \]
Other than the sum of squared errors (SSEs), there are several metrics to evaluate the accuracy of forecasting models. Common ones include:
| Metric | Formula | Interpretation |
|---|---|---|
| Sum of Absolute Errors (SAE) | \(\sum |y_i - \hat{y}_i|\) | Total absolute error between actual and forecasted values. Lower is better. |
| Mean Absolute Error (MAE) | \(\dfrac{1}{n} \sum |y_i - \hat{y}_i|\) | Average absolute error between actual and forecasted values. Lower is better. |
| Root Mean Squared Error (RMSE) | \(\sqrt{\dfrac{1}{n} \sum (y_i - \hat{y}_i)^2}\) | Square root of average squared error. More sensitive to large errors. Lower is better. |
| Mean Absolute Percentage Error (MAPE) | \(\dfrac{100\%}{n} \sum \left| \dfrac{y_i - \hat{y}_i}{y_i} \right|\) | Average absolute percentage error. Useful for comparing across different scales. Lower is better. |
| R-squared (\(R^2\)) | \(1 - \dfrac{\sum (y_i - \hat{y}_i)^2}{\sum (y_i - \bar{y})^2}\) | Proportion of variance in the dependent variable explained by the model. Higher is better (max 1). |
| Method | Reactivity | Suitable For |
|---|---|---|
| Delphi Method | Low | Expert consensus, long-term |
| Naïve Forecasting | Very Low | Stable demand, short-term |
| Linear Regression | Medium | Trend analysis, long-term |
| Multiple Regression | Medium | Multiple factors, long-term |
| Simple Moving Average | Low | Stable, low noise |
| Weighted Moving Average | Medium | Mild trend, prioritise recency |
| Exponential Smoothing | Variable | Short-term, adaptive |
Key Takeaways
