lO M o A R c P S D |6 2 2 4 7 9 8
CHAPTER 2 - FORECASTING
1. INTRODUCTION
The purpose of forecasting is to predict the future and affect the decisions we make. A good forecast
should be:
- Timely
- Accurate as possible
- Reliable
- Consist of meaningful units
- Present in writing
- Easy to use and understand in most cases
A forecast has certain characteristics:
- Aggregate forecasts are usually more accurate.
- Accuracy is lower as we go further into the future.
- A forecast should not be used to exclude known information.
2. FORECASTING METHODS
2.1 Subjective methods
For subjective methods, there is no use of mathematical data. Example of such methods are:
- Customer surveys
- Jury of executive opinion (group of experts)
- Sales force composites: aggregation of sales personnel estimates
- The Delphi method: Individual opinions are compiled and reconsidered, this process is
repeated until there is a solution.
2.2 Objective methods
With causal models, we want to forecast the quantity Y with the variables (X1, X2, …, Xn)
Y = f (X1, X2, …, Xn)
Time series models are a collection of past values of the variable that is being predicted. The goal is to
isolate patterns like trend, seasonality and cycles from the data.
Ft =∑ an . Dt−n
Ft is the forecast made at t-1 for t
an is the weight assigned to past data (less weight each year)
Dt−n is the past value at time t-n
3. EVALUATION OF FORECASTS
The forecast error for time t, et
= The difference between the forecast value for time t and the actual value at time t.
There are 2 conditions for forecasts:
o Forecasts should be unbiased: E(ei ) = 0
o There must be different measures of forecast accuracy.
There are some common measures of forecast accuracy:
- Mean Absolute Deviation: MAD = (1/n) ∑∣ei∣ (often preferred)
- Mean Squared Error: MSE = (1/n) ∑ (ei)^2
- Mean Absolute Percentage Error: MAPE= 100 x [(1/n) ∑∣ei /Di∣) (not dependent on
magnitude of values)
1
, lO M o A R c P S D |6 2 2 4 7 9 8
4. FORECASTING OF STATIONARY SERIES
With a stationary series, the expectation Dt goes up and down around an unknown constant μ:
Dt =μ +εt
εt: random variable with mean 0 and variance σ2
à Stationary means that there is no growth or decline, but the expectations can dependent on
certain random variables (so stationary does not mean independent).
4.1 Moving averages
The first method for forecasting of a stationary series is the method of moving averages or MA(N)
and uses the mean of the N most recent observations. The expectation stays the same for every step
forecast.
The advantages of moving averages is that the method is easily understood, easily computed and
provides stable forecast. As disadvantages, you need to save a lot of past data points, the forecast
lags behind a trend and ignores complex relationships.
You can use weighted averages to attach importance to certain data over other data. The
weightening factors must add up to 1.
4.2 Exponential smoothing
= A type of weighted moving average that applies declining weights to past data.
Ft +1 = α . Dt + (1−α ) . Ft
(New forecast) = α . (most recent observation) + (1− α) . (last forecast)
0 < α <= 1, with α: smoothing constant
This can be rewritten to: Ft +1 = Ft − α (Ft − Dt ) = Ft −α . εt
with εt the last error
à Smoothing:
- If Ft is too high and εt is positive, so the adjustment is to decrease the forecast.
- If Ft is too low and εt is negative, so the adjustment is to increase the forecast.
Effect of α value on the forecast:
- If we choose a small value for α, the forecast value will be stable but it will lag.
- If we choose a large value for α, the forecast will more closely track the series.
- For production, we need stable forecasts and an α between 0,1 - 0,2 is used.
4.3 Comparison Ma & ES
Similarities:
- Both methods lag behind a trend
- Both methods are appropriate for stationary series
- Both methods depend on a single parameter
- Both methods are unbiased
- For both methods multiple-step-ahead and one-step-ahead forecasts are identical
- One can achieve the same distribution of forecast error by equating the average age of data
for the two methods
2
, lO M o A R c P S D |6 2 2 4 7 9 8
Differences:
- ES carries all past history data (forever!)
- MA eliminates bad data after N periods
- ES only requires last forecast and observation of demand to continue. MA requires all N past
data points to compute new forecast estimate.
5. TREND-BASED METHODS
5.1 Regression for time series forecasting
With the model of regression, we try to find the line between the data with the least amount of
errors, we need to minimise the squared errors.
Model: (We only consider linear trends here)
a and b are calculated with formulas given with the formularium!
Note: With this method one-step and two-step ahead forecast are different.
5.2 Double exponential smoothing/Holt’s method
We use the double exponential method when there is a linear trend present in the data and we use
two smoothing constants α and β.
Ft ,t + τ = St + τ . Gt τ -ahead forecast
St and Gt are calculated with formulas given with the formularium!
St is current estimate of intercept, Gt is current estimate of slope
We mostly begin with an estimate for the intercept and the slope. With this method, it is easier to
calculate new forecast by redefining the smoothing equations than regression analysis.
6. METHODS FOR SEASONAL SERIES
Seasonality is a pattern in the data that repeats at regular intervals and is defined by a seasonal
factor ct. There is a quick and dirty method to estimate the seasonal factor:
- You calculate the sample mean of the data (many cycles) (sum of all data points/number of
data points) and divide each observation by this mean to calculate a seasonal factor. This
factor tells you how much the observation deviates from the average demand.
Forecasting for seasonal series:
1. Deseasonalize data: To remove seasonality, you divide the observation with the seasonal
factor, the seasonality is gone but the possible trend stays.
2. Forecast for the deseasonalized data: Once seasonality is removed, you can focus on
forecasting the trend using methods like linear regression, exponential smoothing, etc.
3. Incorporate seasonality in a forecast: To convert the deseasonalized forecast to the original
scale with seasonality: you must multiply the deseasonalized forecast with the corresponding
seasonal factor for each period.
3
, lO M o A R c P S D |6 2 2 4 7 9 8
6.1 Seasonal decomposition using CMA
A represents the time periods during which the data was collected, or the demand was observed. B
are the observed demand values for each period. MA(4) calculates the 4-period Moving Average.
Example:
MA(4) = (10 + 20 + 26 + 17)/4 = 18,25
C is a further adjustment of the MA(4) values to center them for more accurate representation. It is
typically calculates as the average of two consecutive MA(4) values.
Example:
Centered = (18,25 + 18,75)/2 = 18,50
Note: The starting or leaving averages, with too few information, are calculated with the average of
the first or last 2 averages.
(B/C) Ratio: You become the seasonal factor if you divide the actual demand (B) by the centered
average (C).
Example:
For period 4: Ratio = 17/19,125 = 0,888
Note: The sum ct won’t be equal to N because of rounding, so we need to normalize.
4
CHAPTER 2 - FORECASTING
1. INTRODUCTION
The purpose of forecasting is to predict the future and affect the decisions we make. A good forecast
should be:
- Timely
- Accurate as possible
- Reliable
- Consist of meaningful units
- Present in writing
- Easy to use and understand in most cases
A forecast has certain characteristics:
- Aggregate forecasts are usually more accurate.
- Accuracy is lower as we go further into the future.
- A forecast should not be used to exclude known information.
2. FORECASTING METHODS
2.1 Subjective methods
For subjective methods, there is no use of mathematical data. Example of such methods are:
- Customer surveys
- Jury of executive opinion (group of experts)
- Sales force composites: aggregation of sales personnel estimates
- The Delphi method: Individual opinions are compiled and reconsidered, this process is
repeated until there is a solution.
2.2 Objective methods
With causal models, we want to forecast the quantity Y with the variables (X1, X2, …, Xn)
Y = f (X1, X2, …, Xn)
Time series models are a collection of past values of the variable that is being predicted. The goal is to
isolate patterns like trend, seasonality and cycles from the data.
Ft =∑ an . Dt−n
Ft is the forecast made at t-1 for t
an is the weight assigned to past data (less weight each year)
Dt−n is the past value at time t-n
3. EVALUATION OF FORECASTS
The forecast error for time t, et
= The difference between the forecast value for time t and the actual value at time t.
There are 2 conditions for forecasts:
o Forecasts should be unbiased: E(ei ) = 0
o There must be different measures of forecast accuracy.
There are some common measures of forecast accuracy:
- Mean Absolute Deviation: MAD = (1/n) ∑∣ei∣ (often preferred)
- Mean Squared Error: MSE = (1/n) ∑ (ei)^2
- Mean Absolute Percentage Error: MAPE= 100 x [(1/n) ∑∣ei /Di∣) (not dependent on
magnitude of values)
1
, lO M o A R c P S D |6 2 2 4 7 9 8
4. FORECASTING OF STATIONARY SERIES
With a stationary series, the expectation Dt goes up and down around an unknown constant μ:
Dt =μ +εt
εt: random variable with mean 0 and variance σ2
à Stationary means that there is no growth or decline, but the expectations can dependent on
certain random variables (so stationary does not mean independent).
4.1 Moving averages
The first method for forecasting of a stationary series is the method of moving averages or MA(N)
and uses the mean of the N most recent observations. The expectation stays the same for every step
forecast.
The advantages of moving averages is that the method is easily understood, easily computed and
provides stable forecast. As disadvantages, you need to save a lot of past data points, the forecast
lags behind a trend and ignores complex relationships.
You can use weighted averages to attach importance to certain data over other data. The
weightening factors must add up to 1.
4.2 Exponential smoothing
= A type of weighted moving average that applies declining weights to past data.
Ft +1 = α . Dt + (1−α ) . Ft
(New forecast) = α . (most recent observation) + (1− α) . (last forecast)
0 < α <= 1, with α: smoothing constant
This can be rewritten to: Ft +1 = Ft − α (Ft − Dt ) = Ft −α . εt
with εt the last error
à Smoothing:
- If Ft is too high and εt is positive, so the adjustment is to decrease the forecast.
- If Ft is too low and εt is negative, so the adjustment is to increase the forecast.
Effect of α value on the forecast:
- If we choose a small value for α, the forecast value will be stable but it will lag.
- If we choose a large value for α, the forecast will more closely track the series.
- For production, we need stable forecasts and an α between 0,1 - 0,2 is used.
4.3 Comparison Ma & ES
Similarities:
- Both methods lag behind a trend
- Both methods are appropriate for stationary series
- Both methods depend on a single parameter
- Both methods are unbiased
- For both methods multiple-step-ahead and one-step-ahead forecasts are identical
- One can achieve the same distribution of forecast error by equating the average age of data
for the two methods
2
, lO M o A R c P S D |6 2 2 4 7 9 8
Differences:
- ES carries all past history data (forever!)
- MA eliminates bad data after N periods
- ES only requires last forecast and observation of demand to continue. MA requires all N past
data points to compute new forecast estimate.
5. TREND-BASED METHODS
5.1 Regression for time series forecasting
With the model of regression, we try to find the line between the data with the least amount of
errors, we need to minimise the squared errors.
Model: (We only consider linear trends here)
a and b are calculated with formulas given with the formularium!
Note: With this method one-step and two-step ahead forecast are different.
5.2 Double exponential smoothing/Holt’s method
We use the double exponential method when there is a linear trend present in the data and we use
two smoothing constants α and β.
Ft ,t + τ = St + τ . Gt τ -ahead forecast
St and Gt are calculated with formulas given with the formularium!
St is current estimate of intercept, Gt is current estimate of slope
We mostly begin with an estimate for the intercept and the slope. With this method, it is easier to
calculate new forecast by redefining the smoothing equations than regression analysis.
6. METHODS FOR SEASONAL SERIES
Seasonality is a pattern in the data that repeats at regular intervals and is defined by a seasonal
factor ct. There is a quick and dirty method to estimate the seasonal factor:
- You calculate the sample mean of the data (many cycles) (sum of all data points/number of
data points) and divide each observation by this mean to calculate a seasonal factor. This
factor tells you how much the observation deviates from the average demand.
Forecasting for seasonal series:
1. Deseasonalize data: To remove seasonality, you divide the observation with the seasonal
factor, the seasonality is gone but the possible trend stays.
2. Forecast for the deseasonalized data: Once seasonality is removed, you can focus on
forecasting the trend using methods like linear regression, exponential smoothing, etc.
3. Incorporate seasonality in a forecast: To convert the deseasonalized forecast to the original
scale with seasonality: you must multiply the deseasonalized forecast with the corresponding
seasonal factor for each period.
3
, lO M o A R c P S D |6 2 2 4 7 9 8
6.1 Seasonal decomposition using CMA
A represents the time periods during which the data was collected, or the demand was observed. B
are the observed demand values for each period. MA(4) calculates the 4-period Moving Average.
Example:
MA(4) = (10 + 20 + 26 + 17)/4 = 18,25
C is a further adjustment of the MA(4) values to center them for more accurate representation. It is
typically calculates as the average of two consecutive MA(4) values.
Example:
Centered = (18,25 + 18,75)/2 = 18,50
Note: The starting or leaving averages, with too few information, are calculated with the average of
the first or last 2 averages.
(B/C) Ratio: You become the seasonal factor if you divide the actual demand (B) by the centered
average (C).
Example:
For period 4: Ratio = 17/19,125 = 0,888
Note: The sum ct won’t be equal to N because of rounding, so we need to normalize.
4