Upload
fordon
View
50
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Statistical Demand Forecasting Methods and tools Alex Rivlin Joe Branham. Bay Area Operations Management. Statistical Demand Forecasting - Agenda. Goal: To achieve. Improved sales out Shorter lead times Reduced inventory Reduced E&O. Statistical Demand Forecasting - Assumptions. - PowerPoint PPT Presentation
Citation preview
Statistical Demand ForecastingMethods and tools
Alex RivlinJoe Branham
Bay Area Operations Management
Statistical Demand Forecasting - Agenda
Assumptions
Methods
Tools Improved sales out
Shorter lead times
Reduced inventory
Reduced E&O
Goal: To achieve
• How customers use your product• Ordering practices• Effects of lead time, price, competition
Business model
• Selection what to forecast• Expectations of accuracy
Expectations
Statistical Demand Forecasting - Assumptions
Prior to engaging in forecasting :
Effects of lead timeSelection of what to NOT forecast
Statistical Demand Forecasting - Process
Select important parametersTest forecast by comparing to actualsLook for outliers to improve model
How customer use the productsOrdering practices
Statistical Demand Forecasting – R project
Excel• Available• Easy to change• High quality graphs
Open Source• Free• Variety of models
Commercial Products• Offer support• Variety of models•Maybe less
flexible• Integrated to
other systems
Statistical Demand Forecasting – R project
• Provides a wide variety of statistical functions
• linear and nonlinear modelling,• classical statistical tests,• time-series analysis, • classification, • clustering, ...
• Easy to implement and integrate with Excel• Good fit for prototyping before investing in
commercial packages
Statistical Demand Forecasting - Markets
Type IHigh Bookings $Low Variability
Type IIIMed Bookings $Low Variability
Type IIHigh Variability
Type IV Low Bookings $Low Variability
Type VLow Bookings $High Variability
Coefficient of Variation (std dev/Mean Monthly Demand)
$ A
nnua
l Boo
king
s
Lower Higher0.75
80% of units~80% of bookings $
Demand Segmentation Model
Statistical Demand Forecasting – Time Series
Overview of Time-Series AnalysisModel to Test:x MA: Moving Average Product # Technology Model MA Alpha Beta Gamma Mthsx MAF: Moving Average Family Level 37A01 N/A HW 0.05 0.15 0.10x HW: Holt-Winters 37A02 N/A HW 0.15 0.25x HWF: Holt-Winters Family Level 58U26 N/A HWF 0.05 6x CRO: Croston's Method 354A0 35.4 HWF 0.20 0.20 6
354A1 35.4 HWF 0.05 6354A2 35.4 HWF 0.05 0.05 6354T0 35.4 HW 0.10
Min Max Step 354T1 35.4 CRO 0.20MA Length 6 6 1 354T2 35.4 MA 6Alpha 0.050 0.200 0.050 354T3 35.4 HWF 0.20 0.20 0.30 6Beta 0.000 0.200 0.050 354T4 35.4 HW 0.10 0.10Gamma 0.000 0.300 0.050 354T5 35.4 HW 0.05# Months Mix 6 6 3 354T6 35.4 HW 0.20 0.20Croston Alpha 0.200 0.400 0.200 354T7 35.4 HWF 0.05 0.10 0.05 6Seas. Length 12 354T8 35.4 HWF 0.10 0.20 0.05 6Rep. Months 3 354T9 35.4 HWF 0.10 0.20 0.05 6Seas. Fact 0.3 3 354TA 35.4 HW 0.05Init. S. Damp. 1 354TB 35.4 MAF 6 6
354V0 35.4 HWF 0.20 0.20 0.30 6Date Ranges: 354V1 35.4 CRO 0.40
Pd No. Pd. Name 354V2 35.4 HWF 0.20 0.20 0.30 6Fit Start 27 Mar-10 354V3 35.4 HWF 0.20 0.20 6
End 45 Sep-11 354V4 35.4 HWF 0.05 0.20 0.05 6Holdout Start 44 Aug-11 354V5 35.4 HWF 0.05 0.20 0.05 6
End 46 Oct-11 354V8 35.4 HW 0.20 0.20
ParameterParameters to Test:
2. Measured performance over the recent 18 months
3. Reported the best fit, and the corresponding error
4. Generated Future Forecast
• Model:• Consider sales as time trend with random
noise component• Lets run regression and review result.
Statistical Demand Forecasting – R example
#-------------------------------------------------# Read Toyota Sales data from csv file#-------------------------------------------------ToyotaDataFrame <- read.table("D:/ToyotaSalesReports/ToyotaSales.csv",header=TRUE, sep = ",");#-------------------------------------------------------------# take first 20 months to use as basis for forecast#-------------------------------------------------------------HistoryDF <- ToyotaDataFrame[1:20,]
#------------------------------------------------# Build linear regression function vs MonthNumber – trend only#------------------------------------------------myLinearModel <- lm( Toyota.Total~MonthNumber, data=HistoryDF);
Next lets inspect results
Statistical Demand Forecasting – R example
> summary(myLinearModel)
Call:lm(formula = Toyota.Total ~ MonthNumber, data = HistoryDF)
Residuals: Min 1Q Median 3Q Max -27813 -10867 -854 8543 54685
Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 82461.9 8617.6 9.569 1.75e-08 ***MonthNumber -508.8 719.4 -0.707 0.488 ---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 18550 on 18 degrees of freedomMultiple R-squared: 0.02704, Adjusted R-squared: -0.02702 F-statistic: 0.5002 on 1 and 18 DF, p-value: 0.4885
> confint(myLinearModel) 2.5 % 97.5 %(Intercept) 64356.976 100566.834MonthNumber -2020.147 1002.594>
Statistical Demand Forecasting – R example
Aweful
> #---------------------------------------> # Add parameters to improve accuracy> #----------------------------------------> myLinearModel <- lm( Lexus.Total~MonthNumber+Oil.Price+S.P500+unemployment,
data=HistoryDF);> > summary(myLinearModel);
Call:lm(formula = Lexus.Total ~ MonthNumber + Oil.Price + S.P500 + unemployment, data = HistoryDF)
Residuals: Min 1Q Median 3Q Max -3761.6 -785.6 -354.6 502.1 5231.6
Coefficients: Estimate Std. Error t value Pr(>|t|)(Intercept) -9194.474 25065.038 -0.367 0.719MonthNumber -161.627 213.259 -0.758 0.460Oil.Price 52.725 185.820 0.284 0.780S.P500 8.512 13.819 0.616 0.547unemployment 808.175 3862.237 0.209 0.837
Residual standard error: 2077 on 15 degrees of freedomMultiple R-squared: 0.2484, Adjusted R-squared: 0.048 F-statistic: 1.239 on 4 and 15 DF, p-value: 0.3363
Statistical Demand Forecasting – R example
Bad
> #---------------------------------------> # Add dummy variables to improve accuracy> #----------------------------------------> myLinearModel <- lm( Lexus.Total~MonthNumber+Oil.Price+S.P500+unemployment,
data=HistoryDF);>
Statistical Demand Forecasting – R example
Remember “Cash for clunkers” and Recall?
> #---------------------------------------> # Add more dummy variables to account for Cash for clunkers and recalls> #---------------------------------------- myLinearModel <- lm( Lexus.Total~MonthNumber+Oil.Price+
S.P500+unemployment+Insentive + Recall, data=HistoryDF);
summary(myLinearModel); Call:lm(formula = Lexus.Total ~ MonthNumber + Oil.Price + S.P500 + unemployment + Insentive + Recall, data = HistoryDF)
Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -18598.482 21722.763 -0.856 0.4074 MonthNumber -81.877 195.785 -0.418 0.6826 Oil.Price 9.099 164.447 0.055 0.9567 S.P500 7.423 11.705 0.634 0.5370 unemployment 2161.880 3369.402 0.642 0.5323 Insentive 2357.164 1825.319 1.291 0.2191 Recall -3121.510 1345.568 -2.320 0.0373 *---Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1756 on 13 degrees of freedomMultiple R-squared: 0.5348, Adjusted R-squared: 0.3201 F-statistic: 2.491 on 6 and 13 DF, p-value: 0.07916
Statistical Demand Forecasting – R example
Better
Statistical Demand Forecasting – Simple moving average
•Moving Average– Forecast = Average of last X periods– High X to screen out noise, low X to respond rapidly
to true shifts in the business– Rather arbitrarily gives last X periods equal weight and previous period no
weight at all•When to use
– Can be a good technique for stable items with no clear trend or seasonality– Will consistently under-forecast items with upward trend– Will consistently over-forecast items with downward trend– Performs particularly badly on seasonal items
(forecasts high when demand is low and low when demand is high; see example overleaf)
Forecast Analysis Tool
0
5,000
10,000
15,000
20,000
25,000
Jan-
05
Apr
-05
Jul-0
5
Oct
-05
Jan-
06
Apr
-06
Jul-0
6
Oct
-06
Jan-
07
Apr
-07
Jul-0
7
Oct
-07
Jan-
08
Apr
-08
Jul-0
8
Oct
-08
Uni
ts
Periods for Avg.Moving Average
Exponential SmoothngAlpha
Exponential Smoothngw/ Trend (Holt's Method)
Alpha
Beta
Exponential Smoothng w/ Trend (Winters' Method)
Alpha
Beta
Gamma
Croston's Method
Material
Plant
From...
To...
Horizon
Trend Damping
Actuals Forecast Historical Actual-ForecastBase
6.8% 39.3%Moving Avg.
Exp. Smoothing 13.2% 32.1%
Holt's Method -3.0% 33.2%
Bias MAPE
Winters' Method -3.3% 21.9%
Initial trend = 0
Moving Average performs very badlyon seasonal items
Statistical Demand Forecasting – Exponential smoothing
•Formulas– Level(t) = Alpha * Actual(t) + (1-Alpha) * Level(t-1)– Level(1) = Actual(1)– Forecast(t+n) = Level(t)
•Parameters– “Alpha” is the weight put on the most recent data point– High “alpha” rapidly responds to demand changes but is
susceptible to noise•When to use
– Stable items with no clear trend or seasonality– Will consistently under- / over-forecast items with upward /
downward trend
Statistical Demand Forecasting – Exponential smoothing
Forecast Evolution
0
10,000
20,000
30,000
40,000
50,000
60,000
70,000
80,000
90,000
Jan-
05
Apr
-05
Jul-0
5
Oct
-05
Jan-
06
Apr
-06
Jul-0
6
Oct
-06
Jan-
07
Apr
-07
Jul-0
7
Oct
-07
Jan-
08
Apr
-08
Jul-0
8
Oct
-08
Uni
ts
Periods for Avg.Moving Average
Exponential SmoothngAlpha
Exponential Smoothngw/ Trend (Holt's Method)
Alpha
Beta
Exponential Smoothng w/ Trend (Winters' Method)
Alpha
Beta
Gamma
Croston's Method
Material
Plant
Trend Damping
Actuals Forecast
Performs poorly in case of trend
Statistical Demand Forecasting – Holt’s method
•Formulas– Level(t) = Alpha*Actual(t) + (1-Alpha)*[Level(t-1) + Trend(t-
1)]– Trend(t) = Beta*[Level(t)-Level(t-1)] + (1-Beta)*Trend(t-1)– Forecast(t+n) = Level(t) + n*Trend(t)
•Parameters– “Alpha” and “beta” are the weights put on the most recent
data point for purposes of calculating level and trend– High alpha and beta respond rapidly to demand changes
but are susceptible to noise– If data fairly noisy: recommend alpha = 0.2 and beta=0.1
•When to use– Items with clear trend
Statistical Demand Forecasting – Exponential smoothing
Holt’s Method gives big improvementson growing and declining items…
Statistical Demand Forecasting – Holt’s Winter’s
•Formulas– Similar to Holt’s Method, but with a seasonal multiplier for
each month•Parameters
– “Alpha” and “beta” are the weights put on the most recent data point for purposes of calculating level and trend
– “Gamma” is the weight put on the most recent year for purpose of calculating seasonal profile
•When to use– Items with clear seasonality or seasonality and trend
Function HoltWinters() generates the modelhttp://svn.r-project.org/R/trunk/src/library/stats/R/HoltWinters.R
Statistical Demand Forecasting – Holt’s Winters
Forecast Analysis Tool
0
5,000
10,000
15,000
20,000
25,000
Jan-
05
Apr
-05
Jul-0
5
Oct
-05
Jan-
06
Apr
-06
Jul-0
6
Oct
-06
Jan-
07
Apr
-07
Jul-0
7
Oct
-07
Jan-
08
Apr
-08
Jul-0
8
Oct
-08
Uni
ts
Periods for Avg.Moving Average
Exponential SmoothngAlpha
Exponential Smoothngw/ Trend (Holt's Method)
Alpha
Beta
Exponential Smoothng w/ Trend (Winters' Method)
Alpha
Beta
Gamma
Croston's Method
Material
Plant
From...
To...
Horizon
Trend Damping
Actuals Forecast Historical Actual-ForecastBase
6.8% 39.3%Moving Avg.
Exp. Smoothing 13.2% 32.1%
Holt's Method -3.0% 33.2%
Bias MAPE
Winters' Method -3.3% 21.9%
Initial trend = 0
Winters’ model gives big improvementson seasonal items…
Statistical Demand Forecasting – Seasonal decomposition
Statistical Demand Forecasting – Seasonal Decomposition
Step 1 – Sales ratioSales Ratio is ratio of demand in current week to average demand for the 13 weeks period centered around current week
Detailed explanations at http://www.exceluser.com/solutions/seasonality-sales.htm
Statistical Demand Forecasting – Seasonal Decomposition
Step 2 –Seasonal indexSeasonal Index is average of Sales Ratios for the given week. Formula := AVERAGE(IF(WW_in_quarter=A7,SalesRatio))
Detailed explanations at http://www.exceluser.com/solutions/seasonality-sales.htm
Statistical Demand Forecasting – Seasonal Decomposition
Step 3 – underlying trendTo calculate underlying trend divide actual value by seasonal indexFormula: =J9/INDEX(SeasonalIndex,'4.Actuals, sales ratio'!F9)
Detailed explanations at http://www.exceluser.com/solutions/seasonality-sales.htm
Statistical Demand Forecasting – Seasonal Decomposition
Step 4 – generate forecast
Detailed explanations at http://www.exceluser.com/solutions/seasonality-sales.htm
Extend the line and apply seasonal factor yi= k * xi + b – where k and b come from linear regression of de-seasonalized dataForecast = yi * SFi where y comes from the straight line and SF is seasonal factor.
You can download the file from Bay Area Operations Management