Professional Documents
Culture Documents
Forecasting
MGS3100
1
Forecasting
Forecasting
Quantitative Qualitative
Stationary
Trend
Trend + Seasonality 2
Quantitative Forecasting
--Forecasting based on data and models
• Casual Models:
Price
Population
Causal Year 2000
Advertising Model Sales
……
3
Causal forecasting
• Regression
Find a straight line that fits the data best.
12
Best line!
10
0
Intercept 10 11 12 13 14 15 16 17 18 19 20
X Y ( X ) 2
i i i
b X Y / X 2
i i i
n n
a
Yi
b
Xi
n n
Regression formula is an optional learning objective 5
• Curve Fitting: Simple Linear Regression
– Find the regression line with Excel
• Use Function:
a = INTERCEPT(Y range; X range)
b = SLOPE(Y range; X range)
• Use Solver
• Use Excel’s Tools | Data Analysis | Regression
• Curve Fitting: Multiple Regression
– Two or more independent variables are used to
predict the dependent variable:
Y = b0 + b1X1 + b2X2 + … + bpXp
– Use Excel’s Tools | Data Analysis | Regression
6
Time Series Forecasting Process
8
Evaluation of Forecasting Model
• Mean Square Error - MSE
MSE
(Actual - Forecast) (Error)
2 2
n n
– Excel: =SUMSQ(error range)/COUNT(error range)
– Standard error is square root of MSE
• Mean Absolute Percentage Error - MAPE
| Actual - Forecast |
Actual
*100%
MAPE
n
• R2 - only for curve fitting model such as regression
• In general, the lower the error measure (BIAS, MAD,
MSE) or the higher the R2, the better the forecasting
model
9
Stationary data forecasting
• Naïve
I sold 10 units yesterday, so I think I will sell 10 units
today.
• Exponential smoothing
I predicted to sell 10 units at the beginning of yesterday;
At the end of yesterday, I found out I sold in fact 8 units.
So, I will adjust the forecast of 10 (yesterday’s forecast)
by adding adjusted error (α * error). This will compensate
over (under) forecast of yesterday.
10
Naïve Model
• The simplest time series forecasting model
• Idea: “what happened last time (last year,
last month, yesterday) will happen again
this time”
• Naïve Model:
– Algebraic: Ft = Yt-1
• Yt-1 : actual value in period t-1
• Ft : forecast for period t
– Spreadsheet: B3: = A2; Copy down
11
Moving Average Model
• Simple n-Period Moving Average
Sum of actual values in previous n periods
F
t n
Y Y Y
= t 1 t 2 tn
n
• Issues of MA Model
– Naïve model is a special case of MA with n = 1
– Idea is to reduce random variation or smooth data
– All previous n observations are treated equally (equal
weights)
– Suitable for relatively stable time series with no trend or
seasonal pattern
12
Smoothing Effect of MA Model
14
Weighted MA: An Illustration
15
Exponential Smoothing
• Concept is simple!
– Make a forecast, any forecast
– Compare it to the actual
– Next forecast is
• Previous forecast plus an adjustment
• Adjustment is fraction of previous forecast error
– Essentially
• Not really forecast as a function of time
• Instead, forecast as a function of previous actual and
forecasted value
16
Simple Exponential Smoothing
• A special type of weighted moving average
– Include all past observations
– Use a unique set of weights that weight recent observations
much more heavily than very old observations:
weight 0 1
Decreasing weights
given
to older observations (1 )
(1 ) 2
(1 ) 3
Today 17
Simple ES: The Model
Ft Yt 1 (1 )Yt 2 (1 ) 2 Yt 3
Ft Yt 1 (1 )Yt 2 (1 a)Yt 3
Ft Yt 1 (1 ) Ft 1
New forecast = weighted sum of last period
actual value and last period forecast
– : Smoothing constant
– Ft : Forecast for period t
– Ft-1: Last period forecast
– Yt-1: Last period actual value
18
Simple Exponential Smoothing
• Properties of Simple Exponential Smoothing
– Widely used and successful model
19
Time Series Components
• Trend
– persistent upward or downward pattern in a time series
• Seasonal
– Variation dependent on the time of year
– Each year shows same pattern
• Cyclical
– up & down movement repeating over long time frame
– Each year does not show same pattern
• Noise or random fluctuations
– follow no specific pattern
– short duration and non-repeating
20
Time Series Components
Cycle
Trend
Random
movement
Time Time
Demand
pattern seasonal pattern
21
Time Time
Trend Model
• Curve fitting method used for time series data
(also called time series regression model)
• Useful when the time series has a clear trend
• Can not capture seasonal patterns
• Linear Trend Model: Yt = a + bt
– t is time index for each period, t = 1, 2, 3,…
7
6
5
4
3
2
1
0
1 2 3 4 5 6 7 8 9 10
22
Pattern-based forecasting - Trend
0
Intercept 10 11 12 13 14 15 16 17 18 19 20
23
Pattern-based forecasting – Seasonal
24
Pattern-based forecasting – Seasonal
Example (SI + Regression)
Deseasonalize
Forecast
Reseasonalize
25
Pattern-based forecasting – Seasonal
• Deseasonalization
Deseasonalized data = Actual / SI
• Reseasonalization
Reseasonalized forecast
= deseasonalized forecast * SI
26
Seasonal Index
• What’s an index?
– Ratio
– SI = ratio between actual and average demand
• Suppose
– SI for quarter demand is 1.20
• What’s that mean?
• Use it to forecast demand for next fall
– So, where did the 1.20 come from?!
27
Calculating Seasonal Indices
28
Classical decomposition
29
Causal or Time series?
30
Can you…
31