You are on page 1of 36

MGS3100 Chapter 13 Forecasting Slides 13b: Time-Series Models; Measuring Forecast Error

Forecasting Models
Forecasting Techniques
Qualitative Models Delphi Method Jury of Executive Opinion Sales Force Composite Consumer Market Survey Causal Methods Simple Regression Analysis Multiple Regression Analysis Time Series Methods Naive Moving Average Weighted Moving Average Exponential Smoothing Trend Analysis Seasonality Analysis Multiplicative Decomposition

Time Series Models


 General Form: Y = T * C * S , where T = Trend - long term movement of mean C = (Business) Cycle - an upturn or downturn not caused by seasonal variation; effect of the economy S = Seasonal Variation - repetitive pattern observed over a specific time period = Error (random variation)  Practical Forecast Form: = T * S C is important, but difficult to forecast Dont forecast an error!

Time series value

Components of a Time Series


Linear trend and seasonality time series

Future Linear trend time series A stationary time series


Time

Time Series: Stationary Models


 Stationary Model Assumptions Assumes item forecasted will stay steady over time (constant mean; random variation only) Techniques will smooth out short-term irregularities Forecast for period t+1 is equal to forecast for period t+k; the forecast is revised only when new data becomes available.  Stationary Model Types Nave Forecast Moving Average Weighted Moving Average Exponential Smoothing

Stationary Time Series Models: The Nave Model


 Whatever happened last period will happen again this time  The model is simple and flexible  Provides a baseline to measure other models  Attempts to capture seasonal factors at the expense of ignoring trend

Ft ! Yt 1
or

Ft ! Yt  4 : Quarterly data Ft ! Yt 12 : Monthly data

Measures of Forecast Error


( Forecast Error ! Yt  Ft )
Bias - The arithmetic sum of the errors MAD - Mean Absolute Deviation MAPE Mean Absolute Percentage Error Mean Square Error (MSE) - Similar to simple sample variance Standard Error - Standard deviation of the sampling distribution (the square root of the MSE) Bias, MAD, and MAPE - typically used for time series

Bias ! (forecast error) /T


t !1

! (Yt  Ft ) / T
t !1

MSE ! | forecast error |2 /T


t !1

! (Yt  Ft ) 2 / T
t !1

MAD ! | forecast error | /T ! |Yt  Ft | / T


t !1 t !1

MAPE ! 100 [|Yt  Ft | / Yt ] / T


t !1

Nave Forecast
Wallace Garden Supply
Forecasting
Storage Shed Sales

Period January February March April May June July August September October November December

Actual Nave Value Forecast 10 N/A 12 10 16 12 13 16 17 13 19 17 15 19 20 15 22 20 19 22 21 19 19 21

Error 2 4 -3 4 2 -4 5 2 -3 2 -2 0.818 BIAS

Absolute Error 2 4 3 4 2 4 5 2 3 2 2 3 MAD

Percent Error 16.67% 25.00% 23.08% 23.53% 10.53% 26.67% 25.00% 9.09% 15.79% 9.52% 10.53% 17.76% MAPE

Squared Error 4.0 16.0 9.0 16.0 4.0 16.0 25.0 4.0 9.0 4.0 4.0 10.091 MSE 3.176619

Standard Error (Square Root of MSE) =

Nave Forecast Graph


Wallace Garden - Naive Forecast 25 20

15 Sheds Actual Value Nave Forecast 10

0 February March April May June July Period August September October November December

Stationary Time Series Models: Moving Averages


The Moving Average Method
 The forecast is the average of the last n observations of the time series.

Yt  Yt 1  ...  Yt  n 1 Ft 1 ! n

Moving Averages
Wallace Garden Supply
Forecasting
Storage Shed Sales

Period January February March April May June July August September October November December

Actual Value 10 12 16 13 17 19 15 20 22 19 21 19

Three-Month Moving Averages

10 12 16 13 17 19 15 20 22

+ + + + + + + + +

12 16 13 17 19 15 20 22 19

+ + + + + + + + +

16 13 17 19 15 20 22 19 21

/ / / / / / / / /

3 3 3 3 3 3 3 3 3

= = = = = = = = =

12.67 13.67 15.33 16.33 17.00 18.00 19.00 20.33 20.67

Moving Averages Forecast


Wallace Garden Supply
Forecasting 3 period moving average
Actual Value - Forecast

Input Data Period Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Month 7 Month 8 Month 9 Month 10 Month 11 Month 12 Next period Actual Value 10 12 16 13 17 19 15 20 22 19 21 19 19.667

Forecast Error Analysis Forecast Error Absolute error Squared error Absolute % error

12.667 13.667 15.333 16.333 17.000 18.000 19.000 20.333 20.667 Average

0.333 3.333 3.667 -1.333 3.000 4.000 0.000 0.667 -1.667 1.333 BIAS

0.333 3.333 3.667 1.333 3.000 4.000 0.000 0.667 1.667 2.000 MAD

0.111 11.111 13.444 1.778 9.000 16.000 0.000 0.444 2.778 6.074 MSE

2.56% 19.61% 19.30% 8.89% 15.00% 18.18% 0.00% 3.17% 8.77% 10.61% MAPE

Moving Averages Graph


Three Period Moving Average
25

20

15 Va lu e Actual Value Forecast 10

0 1 2 3 4 5 6 Time 7 8 9 10 11 12

Stability vs. Responsiveness


Should I use a 2-period moving average or a 3-period moving average?
The larger the n the more stable the forecast. A 2-period model will be more responsive to change. We dont want to chase outliers. But we dont want to take forever to correct for a real change. We must balance stability with responsiveness.

Stationary Time Series Models: Weighted Moving Averages


The Weighted Moving Average Method
Historical values of the time series are assigned different weights when performing the forecast

Ft 1 = w1Yt + w2Yt-1 +w3Yt-2 + + wnYt-n+1


7wi = 1

Weighted Moving Average Wallace Garden Supply


Forecasting
Storage Shed Sales

Period January February March April May June July August September October November December Next period

Actual Value Weights 10 0.222 12 0.593 16 0.185 13 17 19 15 20 22 19 21 19 20.185 1.000

Three-Month Weighted Moving Averages

2.2 2.7 3.5 2.9 3.8 4.2 3.3 4.4 4.9

+ + + + + + + + +

7.1 9.5 7.7 10 11 8.9 12 13 11

+ + + + + + + + +

3 2.4 3.2 3.5 2.8 3.7 4.1 3.5 3.9

/ / / / / / / / /

1 1 1 1 1 1 1 1 1

= = = = = = = = =

12.298 14.556 14.407 16.484 17.814 16.815 19.262 21.000 20.036

Sum of weights =

Weighted Moving Average


Wallace Garden Supply
Forecasting 3 period weighted moving average Input Data Period Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Month 7 Month 8 Month 9 Month 10 Month 11 Month 12 Next period Sum of weights = Actual value 10 12 16 13 17 19 15 20 22 19 21 19 20.185 1.000 Weights 0.222 0.593 0.185 Forecast Error Analysis Forecast Error Absolute error Squared error Absolute % error

12.298 14.556 14.407 16.484 17.814 16.815 19.262 21.000 20.036 Average

0.702 2.444 4.593 -1.484 2.186 5.185 -0.262 0.000 -1.036 1.988 BIAS

0.702 2.444 4.593 1.484 2.186 5.185 0.262 0.000 1.036 6.952 MAD

0.492 5.971 21.093 2.202 4.776 26.889 0.069 0.000 1.074 6.952 MSE

5.40% 14.37% 24.17% 9.89% 10.93% 23.57% 1.38% 0.00% 5.45% 10.57% MAPE

Stationary Time Series Models: Exponential Smoothing


Exponential Smoothing
Moving average technique that requires a minimum amount of past data Uses a smoothing constant with a value between 0 and 1 (Usual range 0.1 to 0.3) Forecast for period t = Forecast for period t-1 plus times the difference between the actual value and forecast in period t-1: t = t-1 + (Yt-1 - t-1), or Can also be expressed as: t = (Yt-1) + (1- )( t-1) = (Actual value in period t-1) + (1- )(Forecast in period t-1)

Exponential Smoothing Data


Storage Shed Sales

Period January February March April May June July August September October November December

Actual Value(Yt ) 10 12 16 13 17 19 15 20 22 19 21 19 =

t-1

Y t-1 + + + + + + + + + + + 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 *( *( *( *( *( *( *( *( *( *( *( 10 12 16 13 17 19 15 20 22 19 21 -

t-1

10 10 10 10.2 10.78 11.002 11.602 12.342 12.607 13.347 14.212 14.691

10 10 10.2 10.78 11.002 11.602 12.342 12.607 13.347 14.212 14.691

)= )= )= )= )= )= )= )= )= )= )=

10.000 10.200 10.780 11.002 11.602 12.342 12.607 13.347 14.212 14.691 15.322

Class Exercise: What is the forecast for January of the following year? How about March? Find the Bias, Mad & MAPE. (Note: equals 0.1.)

Exponential Smoothing
(Alpha = .419)
Wallace Garden Supply
Forecasting Exponential smoothing Input Data Period Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Month 7 Month 8 Month 9 Month 10 Month 11 Month 12 Alpha Next period Actual value 10 12 16 13 17 19 15 20 22 19 21 19 0.419 19.573 Forecast Error Analysis Forecast 10.000 10.000 10.838 13.000 13.000 14.675 16.487 15.864 17.596 19.441 19.256 19.987 Average Error 2.000 5.162 0.000 4.000 4.325 -1.487 4.136 4.404 -0.441 1.744 -0.987 Absolute error 2.000 5.162 0.000 4.000 4.325 1.487 4.136 4.404 0.441 1.744 0.987 2.608 MAD Squared error 4.000 26.649 0.000 16.000 18.702 2.211 17.106 19.391 0.194 3.041 0.973 9.842 MSE Absolute % error 16.67% 32.26% 0.00% 23.53% 22.76% 9.91% 20.68% 20.02% 2.32% 8.30% 5.19% 14.70% MAPE

Sheds 10 15 20 25 0 5

Ja nu a ry Fe br ua ry

M ar ch

A p ri l

M ay

Ju ne

Ju ly

Exponential Smoothing

A u g us t S e p te m b er O ct ob e r N ov

em be r D ec

Exponential Smoothing

em be r

Forecast

Actual value

Evaluating the Performance of Forecasting Techniques


Several forecasting methods have been presented. Which one of these forecasting methods gives the best forecast?

Performance Measures Sample Example


Find the forecasts and the errors for each forecasting technique applied to the following stationary time series. Time Time series: 1 2 3 4
100 - 20 98 - 18

5
93.33 11.67 89 16

6
91.6 23.4 85.5 29.5

100 110 90 80 105 115

3-Period Moving average: Error for the 3-Period MA: 3-Period Weighted MA(.5, .3, .2) Error for the 3-Period WMA

Performance Measures MAD for the Sample Example


MAD for the moving average technique: MAD =

7 `(t|
n

|-20| + |11.67| + |23.4| = = 18.35 3

MAD for the weighted moving average technique: MAD =

7 `(t|
n

|-18| + |116| + |29.5| = 3

= 21.17

Performance Measures MAPE for the Sample Example


MAPE for the moving average technique:

7 `(t| MAPE=
n

|-20|/80 + |11.67|/105+ |23.4|/115 = = .188 3

MAPE for the weighted moving average technique:

7 `(t| MAPE=
n

|-18|/80 + |16|/105 + |29.5|/115 = 3

= .211

Performance Measures Selecting Model Parameters


Use the performance measures to select a good set of values for each model parameter.
For the moving average:
the number of periods (n).

For the weighted moving average:


The number of periods (n), The weights (wi).

For the exponential smoothing:


The exponential smoothing factor (E).

Excel Solver can be used to determine the values of the model parameters.

Trend & Seasonality


Trend analysis
Technique that fits a trend equation (or curve) to a series of historical data points Projects the equation into the future for medium and long term forecasts. Typically do not want to forecast into the future more than half the number of time periods used to generate the forecast

Seasonality analysis
Adjustment to time series data due to variations at certain periods. Adjust with seasonal index - ratio of average value of the item in a season to the overall annual average value. Examples: demand for coal in winter months; demand for soft drinks in the summer and over major holidays

Midwestern Manufacturing Sales


Sales(in units) vs. Time
Scatter Diagram
Actual value (or) Y 74 79 80 90 105 142 122 Period number (or) X 1995 1996 1997 1998 1999 2000 2001

Linear Trend Analysis

160 140 120 100 80 60 40 20 0 1994 1995 1996 1997 1998 1999 2000 2001 2002

Least Squares for Linear Regression


Midwestern Manufacturing
Least Squares Method

Val ues of Dependent Variables

Objective: Minimize the squared deviations!


Time

Least Squares Method


Where

Y ! a  bX
Y
^

= predicted value of the dependent variable (demand)

X = value of the independent variable (time)


a = Y-axis intercept = Y - b* X b = Slope of the regression line =
_ _

[ XY - n X Y ]
_ 2 X - n X2

Linear Trend Data & Error Analysis


Midwestern Manufacturing Company
Forecasting Linear trend analysis
Enter the actual values in cells shaded YELLOW. Enter new time period at the bottom to forecast

Input Data Period Year 1 Year 2 Year 3 Year 4 Year 5 Year 6 Year 7 Intercept Slope Next period Actual value Period number (or) Y (or) X 74 1 79 2 80 3 90 4 105 5 142 6 122 7 56.714 10.536 141.000 8

Forecast Error Analysis Forecast 67.250 77.786 88.321 98.857 109.393 119.929 130.464 Average Error 6.750 1.214 -8.321 -8.857 -4.393 22.071 -8.464 Absolute error 6.750 1.214 8.321 8.857 4.393 22.071 8.464 8.582 MAD Squared Absolute error % error 45.563 9.12% 1.474 1.54% 69.246 10.40% 78.449 9.84% 19.297 4.18% 487.148 15.54% 71.644 6.94% 110.403 8.22% MSE MAPE

Least Squares Graph


Tre nd Analysis
160 140

y = 10.536x + 56.714
120

100 V alue

80

60

40

20

0 1 2 3 4 Time Actual values Linear (Actual values ) 5 6 7

Another way to Determine Trend: Use the Excel Regression Function


Run linear regression to test F1 in the model Yt=F0+F1t+It Excel results:
Coeff. Intercept Weeks Stand. Err t-Stat P-value Lower 95%Upper 95%

369.27 27.79436 13.2857 5E-18 313.44 425.094 0.3339 0.912641 0.36586 0.71601 -1.49919 2.16699 0.71601

This large P-value indicates that there is little evidence that trend exists

Conclusion: A stationary model is appropriate.

Forecasting Seasonal Data: Quick Method


Eichler Supplies
Average Demand Demand Year Month 1 January 80 94 February 75 94 March 80 94 April 90 94 May 115 94 June 110 94 July 100 94 August 90 94 September 85 94 October 75 94 November 75 94 December 80 94 2 January 100 94 February 85 94 March 90 94 April 110 94 May 131 94 June 120 94 July 110 94 August 110 94 September 95 94 October 85 94 November 85 94 December 80 94

Ratio = Demand / Average Demand


Ratio 0.851 0.798 0.851 0.957 1.223 1.170 1.064 0.957 0.904 0.798 0.798 0.851 1.064 0.904 0.957 1.170 1.394 1.277 1.170 1.170 1.011 0.904 0.904 0.851 Seasonal Index 0.957 0.851 0.904 1.064 1.309 1.223 1.117 1.064 0.957 0.851 0.851 0.851 0.957 0.851 0.904 1.064 1.309 1.223 1.117 1.064 0.957 0.851 0.851 0.851

Seasonal Index ratio of the average value of the item in a season to the overall average annual value. Example: average of year 1 January ratio to year 2 January ratio. (0.851 + 1.064)/2 = 0.957 If Year 3 average monthly demand is expected to be 100 units.
Forecast demand Year 3 January: 100 X 0.957 = 96 units Forecast demand Year 3 May: 100 X 1.309 = 131 units

Forecasting Seasonal Data With Trend


1. Calculate the seasonal indices (as shown on the previous slide) 2. Calculate deseasonalized treand by dividing the actual value (Y) by the seasonal index for that period: Deseasonalized Trend = Y / Seasonal index (e.g., 80 units/ 0.957 = 83.595) 3. Find the trend line, and extend the trend line into the desired forecast period.

Forecasting Seasonal Data With Trend: Calculating the Seasonal Forecast


4. Now that we have the Seasonal Indices and Trend line, we can reseasonalize the data and generate the seasonalized forecast by multiplying the trend line values in the forecast period by the appropriate seasonal indices for each time period as follows:

= Trend x Seasonal Index

You might also like