You are on page 1of 26

Lunch and Learn: Forecasting

Walmart Services – Knowledge Transfer


Do The Math
Chicago, IL
Bangalore, India
www.mu-sigma.com
April 2014

Proprietary Information

"This document and its attachments are confidential. Any unauthorized copying, disclosure or distribution of the material is strictly forbidden"

Mu Sigma Confidential 1
Mu Sigma Confidential 2
Agenda
 What is forecasting?
 What are the different forecasting techniques out there?
 A deeper look at Quantitative techniques
 How to choose the right forecasting technique?
 How to measure and validate the accuracy of forecasting models?

Expectation
 To be able to identify the right forecasting technique for a given problem
 To be able to use the exponential smoothening forecasting technique in excel

Mu Sigma Confidential 3
Forecasting

Mu Sigma Confidential 4
Purpose of Forecasting

The purpose of forecasting is to explain as much of the variability as possible and describe or quantify the
variability to support a decision

Describe Explain

How much variability do we see? There is a trend in the time series!

Historical Sales Data Historical Sales Data


$250 $250

$200 $200

$150 $150

$100 $100

$50 $50

$- $-
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Jan Feb Mar Apr May Jun Jul Aug Sep Oct

Mu Sigma Confidential 5
Mu Sigma Confidential 6
Different Forecasting Techniques

Mu Sigma Confidential 7
Types of Forecasts Techniques

• Used when situation is vague and little data


exists
Qualitative Methods • Usually based on experts opinion ,gut feeling
and market surveys
• e.g. new products/new technology

• Used when historical data exists and they are


informative of future data
Quantitative Methods • Usually based on past data, numerical facts
and mathematical estimation

Focus for todays session

Mu Sigma Confidential 8
There are two approaches to forecasting using quantitative
methods
Self Projecting Approach (Non-Causal) Cause Effect Approach(Causal)

 Non-causal methods work best for businesses that are


 Estimating techniques based on the assumption that
characterized by typical behaviors or patterns (levels,
trends and seasonality) in variables and that are not the variable to be forecast (dependent variable) has
influenced or minimally influenced by causal factors cause-and-effect relationship with one or more other
(independent) variables
 Time series forecasting methods are based on analysis
of historical data (time series: a set of observations
measured at successive times or over successive
periods). They make the assumption that past patterns in
data can be used to forecast future data points.

 A simple time series graph would look like the following

• Example • Example
• Exponential smoothing, moving average etc. • Regression analysis, mixed model, ARIMAX etc.

Mu Sigma Confidential 9
Time Series

Mu Sigma Confidential 10
What is time series?
• A sequence of observations made at various points of time
• Observations are a dependent sequence
• The time points are equally spaces

Mu Sigma Confidential 11
A deeper look at quantitative techniques

Time Series : Components

Trend Cyclic

• Persistent, overall upward /downward pattern • Repeating up & down movements due to
• Due to population, technology etc. interactions of factors influencing economy over
• Several years duration a multi year period
Cycle
rd
Upwa
Sales t r en d Sales

Time Time

Seasonal Irregular

• Regular pattern of up & down fluctuations • Erratic, unsystematic, ‘residual’ fluctuations


• Due to weather, customs etc. • Due to random variation or unforeseen events
• Union strike
• Occurs within one year
• War
• Short duration & non repeating
Winter
Sales

Time (Monthly or Quarterly)

Mu Sigma Confidential Mu Sigma-Walmart Confidential 12


How to choose the right forecasting techniques
(Non Causal)

Mu Sigma Confidential 13
1. Time series with no trend or seasonality

Model Type Most Suited Data Types Forecast Horizon Shelf Life of Model
Exponential Smoothing No Trend, No Seasonality Short Short

* Note on time granularity: Short - a day to a quarter, 14


Mu Sigma Confidential
Medium - a quarter to a year, Long - a year to 5 years,
2. Time series with trend

Model Type Most Suited Data Types Forecast Horizon Shelf Life of Model
Exponential Smoothing + Trend
Varying Trends, No Seasonality Short Short
component

* Note on time granularity: Short - a day to a quarter, 15


Mu Sigma Confidential
Medium - a quarter to a year, Long - a year to 5 years,
3. Time series with seasonality but no trend

Model Type Most Suited Data Types Forecast Horizon Shelf Life of Model
Exponential Smoothing + Seasonal
No Trends, Varying Seasonality Short Short
component

* Note on time granularity: Short - a day to a quarter, 16


Mu Sigma Confidential
Medium - a quarter to a year, Long - a year to 5 years,
4. Time series with seasonality and trend

Model Type Most Suited Data Types Forecast Horizon Shelf Life of Model
Exponential Smoothing + Seasonal
Varying Trends, Varying Seasonality Short to Medium Medium
component + Trend component

* Note on time granularity: Short - a day to a quarter, 17


Mu Sigma Confidential
Medium - a quarter to a year, Long - a year to 5 years,
Exponential Smoothing

Mu Sigma Confidential 18
Some notations
 Dt  Sales for a particular product in period t

 F t,t+k  Sales forecast made in period t for period t+k

 N  Number of observations
Illustration

Jan- Feb- Mar- Apr- May- Jun- Jul- Aug- Sep- Oct- Nov- Dec- Jan- Feb- Mar- Apr- May- Jun- Jul- Aug-
11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12

Dt 2010 2063 2047 2070 2023 2060 2010 2025 2023 2070 2050 2005 2017 2045 2039 2042 2022 2067 2013 2050

Ft,t+k We have actual data till Aug’12. When Dt denotes sales for Aug’12, Ft,t+1 denotes
forecast for Sep’12

N N= 20, In the example above 20 months sales data is available

Mu Sigma Confidential 19
Moving Average
 Calculating a moving average of the past N observations is one reasonable forecasting
method.

 Lt= level in period t

Illustration

Jan- Feb- Mar- Apr- May- Jun- Jul- Aug- Sep- Oct- Nov- Dec- Jan- Feb- Mar- Apr- May- Jun- Jul- Aug- Sep-
11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12

Dt 2010 2063 2047 2070 2023 2060 2010 2025 2023 2070 2050 2005 2017 2045 2039 2042 2022 2067 2013 2050

Ft,t+k 2040 2060 2047 2051 2031 2032 2020 2039 2048 2042 2024 2022 2034 2042 2034 2044 2034 2043

The moving average is calculated by taking previous 3 observation (N=3)

Mu Sigma Confidential 20
Exponential Smoothing Method
 Places more weight on the past observations

Illustration

Jan- Feb- Mar- Apr- May Jun- Jul- Aug Sep- Oct- Nov- Dec- Jan- Feb- Mar- Apr- May Jun- Jul- Aug Sep-
11 11 11 11 -11 11 11 -11 11 11 11 11 12 12 12 12 -12 12 12 -12 12

Dt 2010 2063 2047 2070 2023 2060 2010 2025 2023 2070 2050 2005 2017 2045 2039 2042 2022 2067 2013 2050

Ft,t+k 2010 2021 2026 2035 2032 2038 2032 2031 2029 2038 2040 2033 2030 2033 2034 2036 2033 2040 2034 2038

Ft,t+k =(w*Dt) + ((1-w)*Lt-1)

=(.2*2063) + (.8 *2010)


Weight(w) given to previous month observation is .2
Mu Sigma Confidential 21
How to Measure and Validate Accuracy of a Model?

Mu Sigma Confidential 22
Measure of Accuracy ( Difference between actual and forecast )

• Mean Absolute Percentage Error (MAPE): it is the average of the absolute percentage
errors over a particular time period
• The forecast accuracy is often defined as 1-MAPE
• MAPE is a relative measure of the forecast accuracy

Actual  forecast
MAPE  Average Actual

Illustration

Jan- Feb- Mar- Apr- May- Jun- Jul- Aug- Sep- Oct- Nov- Dec- Jan- Feb- Mar- Apr- May- Jun- Jul- Aug-
11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12

Dt 2010 2063 2047 2070 2023 2060 2010 2025 2023 2070 2050 2005 2017 2045 2039 2042 2022 2067 2013 2050

Ft,t+k 2010 2021 2026 2035 2032 2038 2032 2031 2029 2038 2040 2033 2030 2033 2034 2036 2033 2040 2034

Absolute %
3% 1% 2% 1% 1% 1% 0% 0% 2% 1% 2% 1% 1% 0% 0% 1% 2% 1% 1%
errors
Average

MAPE 1%

Mu Sigma Confidential 23
Lets Summarize

Mu Sigma Confidential 24
Moving Average

 Calculating a moving average of the past N observations is one reasonable forecasting


method.

 Lt= level in period t

Exponential Smoothing

 Places more weight on the past observations

Exponential Smoothing

 Mean Absolute Percentage Error (MAPE): it is the average of the absolute percentage errors
over a particular time period. MAPE is a relative measure of the forecast accuracy
Actual  forecast
MAPE  Average Actual

Mu Sigma Confidential 25
Questions

Mu Sigma Confidential 26

You might also like