Date post: | 07-Aug-2018 |
Category: |
Documents |
Upload: | prateek-khanna |
View: | 214 times |
Download: | 0 times |
of 19
8/20/2019 04 Forecasting
1/43
King Saud UniversityCollege of Computer & Information Sciences
IS 466 Decision Support Systems
Lecture 4
Forecasting
Dr. Mourad YKHLEFThe slides content is derived and adopted from many references
IS 466 - Forecasting - Dr. Mourad Ykhlef 2
Outline• Definitions
• Forecasting types
• Time series
• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
8/20/2019 04 Forecasting
2/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 3
Definitions
• Forecasting is the process of predicting the future.
• Forecasting is an integrated part of almost allbusiness enterprises.
• Examples:– Manufacturing firms forecast demand for their product, to schedule
manpower and raw material allocation.
– Service organizations forecast customer arrival patterns to maintain
adequate customer service.
– Firms consider economic forecasts of indicators (housing starts, changes
in gross national profit) before deciding on capital investments.
IS 466 - Forecasting - Dr. Mourad Ykhlef 4
Definitions• Good forecasts can lead to
– Reduced inventory costs.
– Lower overall personnel costs.
– Increased customer satisfaction.
• The forecasting process can be based on:
– Educated guess.– Expert opinions.
– Past history of data values, known as a time series.
8/20/2019 04 Forecasting
3/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 5
Outline
• Definitions
• Forecasting types
• Time series• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
IS 466 - Forecasting - Dr. Mourad Ykhlef 6
Type of Forecasts by Time Horizon• Short-range forecast
– Up to 1 year; gnerally less than 3 months
– Job scheduling, worker assignements
• Medium-range forecast
– 3 months to 3 years
– Sales and production planning, budgeting• Long-range forecast
– 3+ years
– New product planning, facility location or expansion
8/20/2019 04 Forecasting
4/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 7
Forecasting approaches
• Quantitive forecasts– Used when situation is
stable and historical
data exist• Existing products
• Current technology
– Use a variety ofmathematical modelsthat rely on historicaldata and/or causalvariables
• e.g., forecasting salesof color televisions
• Qualtitative forecasts
– Used when situation isvague & litle data exist
• New products
• New technology
– Involve intuition,experience
– e.g., forecasting saleson Internet
IS 466 - Forecasting - Dr. Mourad Ykhlef 8
Overview of Qualitative methods• Consumer Market Survey
– Ask the customer
• Sales force composite
– Estimates from individual sales person are reviewedfor checking realistic, then aggregated
• Jury of executive opinion– Pool opinions of high-level executives, sometines
augment by statistical models
• Delphi method
– Panel of experts, queried iteratively
8/20/2019 04 Forecasting
5/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 9
Overview of Quantitive methods
• Time-series models
– (Weighted) Moving average
– Exponential Smoothing
– Exponential Smoothing with Trend Adjustment
– Seasonal and Cyclical
• Associative models
– Liner regression
– Multiple regression
– Logistic regression
IS 466 - Forecasting - Dr. Mourad Ykhlef 10
Outline• Definitions
• Forecasting types
• Time series
• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
8/20/2019 04 Forecasting
6/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 11
What is a Time Series?
• Set of evenly spaced numerical data
– Obtained by observing response variable at regulartime periods
• Forecasting technique
– That uses a series of past data points to make a forecast
• Example
Year 2006 2007 2008 2009 2010
Sales 78.7 63. 5 89.7 93.2 92. 1
IS 466 - Forecasting - Dr. Mourad Ykhlef 12
Time series components
TrendTrend
SeasonalSeasonal
CyclicalCyclical
RandomRandom
8/20/2019 04 Forecasting
7/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 13
Trend component
• Time series may be relativelystationary or it may exhibittrend over time
• Trend is the gradual upwardor downward movement ofdata over time
• Trend indicates that the timeseries is increasing ordecreasing
• Trend is typically modeled asa linear, quadratic or
exponential function
Mo., Qtr., Yr.
Response
© 1984-1994 T/Maker Co.
IS 466 - Forecasting - Dr. Mourad Ykhlef 14
Seasonal component• When a repetitive pattern
is observed over some timehorizon, the series is said tohave seasonal behavior.
• Seasonality is a data
pattern that repeats itselfafter a period of days,weeks, months or quarters.
• Occurs within 1 year
Response
Mo., Qtr.
Summer
Period of
Pattern
“Season”
Length
Number of
“Seasons” inPattern
Week Day 7
Month Week 4 – 4 ½
Month Day 28 – 31
Year Quarter 4
Year Month 12
Year Week 52
8/20/2019 04 Forecasting
8/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 15
Cyclical component
• Cycles are patterns in the data that occur every several years.
– Usually tied into the business cycle and are of the majorimportance in short-term business analysis and planning.
• Cycles are upturn or downturn not tied to seasonal variation.
– Usually result from changes in economic conditions.
– Usually 2-10 years duration
Mo., Qtr., Yr.Mo., Qtr., Yr.
ResponseResponse
Cycle
IS 466 - Forecasting - Dr. Mourad Ykhlef 16
Random component• Erratic, unsystematic fluctuations
• Due to random variations or unforeseen events
– Union strike
– Tornado
• Short duration and non repeating
8/20/2019 04 Forecasting
9/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 17
Stationary
Linear trend
Linear trend and seasonality
Time
Time
series
value
Future
Components of a Time Series
In Stationary, the mean value of the time series is assumed to be constant
IS 466 - Forecasting - Dr. Mourad Ykhlef 18
Steps in the Time Series Forecasting • The goal of a time series forecast is to identify factors that can be
predicted.
• This is a systematic approach involving the following steps.– Step 1: Data collection and Hypothesization.
• Collect historical data.
• Graph the data vs. time.
• Hypothesize a form for the time series model.• Verify this hypothesis statistically.
– Step 2: Select a forecasting technique.
• Determination of input parameter values
• Performance evaluation on past data of each technique– Step 3: Prepare a forecast using the selected techniques
8/20/2019 04 Forecasting
10/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 19
Outline
• Definitions
• Forecasting types
• Time series• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
IS 466 - Forecasting - Dr. Mourad Ykhlef 20
Stationary Forecasting Models• In a stationary model the mean value of the time series is
assumed to be constant.
• No trend, seasonal, or cyclical components
• The general form of such a model is
Where:yt = the value of the time series at time period t.
β0 = the unchanged mean value of the time series.
εt = a random error term at time period t
• If a time series does not have a trend, seasonlity or cyclicalcomponents it will be stationary.
yt = ββββ0 + εεεεt
•The values of etare assumed to beindependent
• The values of etare assumed to
have a mean of 0.
8/20/2019 04 Forecasting
11/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 21
Checking the Stationary assumption(Homework)
• Checking for trend– Use Linear Regression if et is normally distributed.
– Use a nonparametric test if et is not normally distributed.
• Checking for seasonality component
– Autocorrelation measures the relationship between the values of the timeseries in different periods.
– Lag k autocorrelation measures the correlation between time seriesvalues which are k periods apart.
• Autocorrelation between successive periods indicates a possible trend.
• Lag 7 autocorrelation indicates one week seasonality (daily data).
• Lag 12 autocorrelation indicates 12-month seasonality (monthly data).
• Checking for Cyclical Components
• If a time series does not have a trend, seasonlity or cyclical
components it will be stationary.
IS 466 - Forecasting - Dr. Mourad Ykhlef 22
Methods for a stationary time series
• The Last Period Method
• The Moving Average Method
• The Weighted Moving Average Method
• The Exponential Smoothing Method
8/20/2019 04 Forecasting
12/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 23
The Last Period Method
• The forecast for the next period is the lastobserved value.
• e.g., if May sales were 50 then June sales will be 50
• Sometimes cost effective & efficient
– At least it provides a starting point which moresophisticated models that follow can be compared
t1t yF =+
IS 466 - Forecasting - Dr. Mourad Ykhlef 24
The (Weighted) Moving Average Method• The forecast is the average of the last n observations of the
time series.
• More recent values of the time series get larger weightsthan past values when performing the forecast.
n
y...yyF 1nt1tt1t
+−−+
+++=
1tF + = w1yt + w2yt-1 +w3yt-2 + …+ wnyt-n+1w1 ≥ w2 ≥ … ≥ wn
Σwi = 1
8/20/2019 04 Forecasting
13/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 25
Example (1/7)
• Galaxy Industries is interested in forecasting
weekly demand for its YoHo brand yo-yos.
• The yo-yo is a mature product. This year demandpattern is expected to repeat next year.
• To forecast next year demand, the past 52 weeksdemand records were collected.
IS 466 - Forecasting - Dr. Mourad Ykhlef 26
Example (2 /7)
• Three forecasting methods were suggested:
– Last period technique - suggested by Ahmed.
– Four-period moving average - suggested by Karim.
– Four-period weighted moving average - suggested by
Omar.• Management wants to determine:
– If a stationary model can be used.
– What forecast will be obtained using each method?
8/20/2019 04 Forecasting
14/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 27
Example (3 /7)
• Collection of demand records
Week Demand Week Demand Week Demand Week Demand1 415 14 365 27 351 40 282
2 236 15 471 28 388 41 399
3 348 16 402 29 336 42 309
4 272 17 429 30 414 43 435
5 280 18 376 31 346 44 299
6 395 19 363 32 252 45 522
7 438 20 513 33 256 46 376
8 431 21 197 34 378 47 483
9 446 22 438 35 391 48 416
10 354 23 557 36 217 49 245
11 529 24 625 37 427 50 393
12 241 25 266 38 293 51 482
13 262 26 551 39 288 52 484
Week Demand Week Demand Week Demand Week Demand
1 415 14 365 27 351 40 2822 236 15 471 28 388 41 399
3 348 16 402 29 336 42 309
4 272 17 429 30 414 43 435
5 280 18 376 31 346 44 299
6 395 19 363 32 252 45 522
7 438 20 513 33 256 46 376
8 431 21 197 34 378 47 483
9 446 22 438 35 391 48 416
10 354 23 557 36 217 49 245
11 529 24 625 37 427 50 393
12 241 25 266 38 293 51 482
13 262 26 551 39 288 52 484
IS 466 - Forecasting - Dr. Mourad Ykhlef 28
Example (4 /7)• Construct the time series plot
• Neither seasonality nor cyclical effects can beobserved
0
200
400
600
800
1 6 1 1 1 6 2 1 2 6 3 1 3 6 4 1 4 6 5 1
Weeks
D e m a n
d
Series1
8/20/2019 04 Forecasting
15/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 29
Example (5 /7) (Home work)
• Is the trend present?
• Run linear regression to test β1 in the model
yt=β0+β1t+εt• Excel results
Coeff. S tand. E rr t-S tat P -value Lower 95 U pper 95
Intercept 369.27 27.79436 13.2857 5E-18 313.44 425.094
Weeks 0.3339 0.912641 0.36586 0.71601 -1.49919 2.166990.71601
This large P-value indicates
that there is little evidence that trend exists
• Conclusion: A stationary model is appropriate.
IS 466 - Forecasting - Dr. Mourad Ykhlef 30
Example (6 /7)• Forecast for Week 53
• Last period technique (Ahmed’s Forecast)
• Four-period moving average (Karim’s forecast)
• Four period weighted moving average (Omar’s forecast)
= 484 boxes.53 = y52$y
53 = (y52 + y51 + y50 + y49) / 4 =(484+482+393+245) / 4 = 401 boxes.
$y
$y53 =0.4y52 + 0.3y51 + 0.2y 50 + 0.1y49 =
0.4(484) + 0.3(482) + 0.2(393) + 0.1(245) = 441.3 boxes.
8/20/2019 04 Forecasting
16/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 31
Example (7 /7)
• Forecast for Weeks 54 and 55
• Since the time series is stationary, the forecasts forweeks 54 and 55 remain as the forecast for week53.
• These forecasts will be revised pendingobservation of the actual demand in week 53.
IS 466 - Forecasting - Dr. Mourad Ykhlef 32
Drawbacks of (Weighted) Moving Average Methods
• Weighted Moving Average can put greater weight on themore recent observations, it uses only last n periods datavalues and ignores the history of the time series prior tothat time.
• Increasing n makes forecast less sensitive to changes
• Do not forecast trend well.
• Require much historical data.
• Solution: Exponential Smoothing Method
8/20/2019 04 Forecasting
17/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 33
Exponential Smoothing Method
• All the previous values of historical data affect theforecast.
• For each period create a smoothed value Lt of the timeseries, that represents all the information known by t.
• The smoothed value Lt is the weighted average of– The actual value for the current period (with weight of α).
– The forecast value for the current period (with weight of 1-α).
• The smoothed value Lt becomes the forecast for period t+1.
IS 466 - Forecasting - Dr. Mourad Ykhlef 34
Exponential Smoothing Method• New forecast = last period’s forecast
+α(last period’s actual demand – last period’s forecast)
• An initial “forecast” is needed to start the process.
ttt1t F)1(yLF α−+α==+
Define:
Lt = smoothed value for time t
Ft+1 = the forecast value for time t+1
yt = the value of the time series at time tαααα = smoothing constant (weight) between 0 and 1
8/20/2019 04 Forecasting
18/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 35
Exponential Smoothing Method
Generating an initial forecast
– Approach 1:
Continue from t=3 with the recursive formula.
– Approach 2: (when large number of historical values exist)
• Average the initial “ n ” values of the time series.
• Use this average as the forecast for period n + 1
• Begin using exponential smoothing from that time period
onward and so on.
nn yF =+1
nnnnn y yF yF )1()1( 1112 α α α α −+=−+= ++++
112 y LF ==
IS 466 - Forecasting - Dr. Mourad Ykhlef 36
Exponential Smoothing Method
Future Forecasts
• Since this technique deals with stationary timeseries, the forecasts for future periods does notchange.
• Assume N is the number of periods for which
data are available. Then
FN+1 = ααααyN + (1 – αααα)FN,FN+k = FN+1, for k = 2, 3, …
8/20/2019 04 Forecasting
19/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 37
Example 1 (1/3)
Period Series Forecast
1 415 #N/A
2 236 4153 348 397.1
4 272 392.19
50 393 368.8296268
51 482 371.2466641
52 484 382.3219977
53 392.4898
54 392.4898
55 392.4898
IS 466 - Forecasting - Dr. Mourad Ykhlef 38
Example 1 (2/3)• An exponential smoothing forecast is suggested,
with α = 0.1.
• An Initial Forecast is created at t=2 byF2 = y1 = 415.
• The recursive formula is used from period 3
onward:F3 = .1y2 + .9F2 = .1(236) + .9(415) = 397.10
F4 = .1y3 + .9F3 = .1(348) + .9(397.10) = 392.19
and so on, until period 53 is reached (N+1 = 52+1 = 53).
F53 = .1y52 + .9F52 = .1(484) + .9(382.32) = 392.49
F54 = F55 = 392.49 ( = F53)
8/20/2019 04 Forecasting
20/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 39
Example 1 (3/3)
0
100
200
300
400
500
600
700
0 10 20 30 40 50 60
Notice the amount of smoothing
Included in the smoothed series
IS 466 - Forecasting - Dr. Mourad Ykhlef 40
Exponential Smoothing Method
Relationship with simple moving average• Simple moving average of length k
(1+2+3+…+k)/k = (k+1)/2
• Exponential smoothing(1) α +(2) α (1- α)+(3)α(1- α)2+(4)α(1- α)3…. = 1/α
• The two techniques will generate forecasts having thesame average age of information if
– Exponential smoothing with α=.10 is equivalent, in some sense,to moving average based on 19 periods
– Exponential smoothing with α=1 is equivalent, in some sense, tomoving average based on 1 period
α
α−=
2k
8/20/2019 04 Forecasting
21/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 41
Example 2 (1/6)
• If Drugs uses exponential smoothing to forecastsales, which value for the smoothing constant α, .1or .8, gives better forecasts?
WeekWeek SalesSales WeekWeek SalesSales
1 110 6 1201 110 6 120
2 115 7 1302 115 7 130
3 125 8 1153 125 8 115
4 120 9 1104 120 9 110
5 1255 125 1010 130130
IS 466 - Forecasting - Dr. Mourad Ykhlef 42
Example 2 (2/6)• Exponential Smoothing: To evaluate the two
smoothing constants, determine how theforecasted values would compare with the actualhistorical values in each case.
Let: Y t= actual sales in week t
F t = forecasted sales in week tF 2 = Y 1 = 110
For other weeks, F t+1 = .1Y t + .9F t
8/20/2019 04 Forecasting
22/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 43
Example 2 (3/6)
• Exponential Smoothing (α = .1, 1 - α = .9)
F 2 = 110
F 3
= .1Y 2
+ .9F 2
= .1(115) + .9(110) = 110.5
F 4 = .1Y 3 + .9F 3 = .1(125) + .9(110.5) = 111.95
F 5 = .1Y 4 + .9F 4 = .1(120) + .9(111.95) = 112.76
F 6 = .1Y 5 + .9F 5 = .1(125) + .9(112.76) = 113.98
F 7 = .1Y 6 + .9F 6 = .1(120) + .9(113.98) = 114.58
F 8 = .1Y 7 + .9F 7 = .1(130) + .9(114.58) = 116.12
F 9 = .1Y 8 + .9F 8 = .1(115) + .9(116.12) = 116.01
F 10= .1Y 9 + .9F 9 = .1(110) + .9(116.01) = 115.41
IS 466 - Forecasting - Dr. Mourad Ykhlef 44
Example 2 (4/6)• Exponential Smoothing (α = .8, 1 - α = .2)
F 2 = 110
F 3 = .8(115) + .2(110) = 114
F 4 = .8(125) + .2(114) = 122.80
F 5 = .8(120) + .2(122.80) = 120.56
F 6 = .8(125) + .2(120.56) = 124.11F 7 = .8(120) + .2(124.11) = 120.82
F 8 = .8(130) + .2(120.82) = 128.16
F 9 = .8(115) + .2(128.16) = 117.63
F 10= .8(110) + .2(117.63) = 111.53
8/20/2019 04 Forecasting
23/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 45
Example 2 (5/6)
• Mean Squared Error: In order to determine whichsmoothing constant gives the better performance,calculate, for each, the mean squared error for thenine weeks of forecasts, weeks 2 through 10 by:
[(Y 2-F 2)2 + (Y 3-F 3)
2 + (Y 4-F 4)2 + . . . + (Y 10-F 10)
2]/9
• Select the forecast with the smallest error value
IS 466 - Forecasting - Dr. Mourad Ykhlef 46
Example 2 (6/6)α = .1 α = .8
Week Y t F t (Y t - F t)2 F t (Y t - F t)
2
1 1102 115 110.00 25.00 110.00 25.003 125 110.50 210.25 114.00 121.004 120 111.95 64.80 122.80 7.845 125 112.76 149.94 120.56 19.71
6 120 113.98 36.25 124.11 16.917 130 114.58 237.73 120.82 84.238 115 116.12 1.26 128.16 173.309 110 116.01 36.12 117.63 58.26
10 130 115.41 212.87 111.53 341.27
Sum 974.22 Sum 847.52MSE Sum/9 Sum/9108.25108.25 94.1794.17
Mean Squared Error
8/20/2019 04 Forecasting
24/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 47
Outline
• Definitions
• Forecasting types
• Time series• Stationary forecasting models
• Performance of forecasting methods (for reading)
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
IS 466 - Forecasting - Dr. Mourad Ykhlef 48
Performance of Forecasting Methods• Calculate the value of the evaluation measure
using the forecast error equation
Error = Actual – Forecast
• Select the forecast with the smallest error value• Types of forecast error equations:
– Mean Squared Error MSE
– Mean Absolute Deviation MAD
– Mean Absolute Percent Error MAPE
– Largest Absolute Deviation LAD
ttt Fy −=∆
8/20/2019 04 Forecasting
25/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 49
Forecast Error Equations
ΣΣΣΣ(∆∆∆∆ t)2n
MSE =
MAD =|∆|∆|∆|∆ t|
nΣΣΣΣ
MAPE =nΣΣΣΣ |∆|∆|∆|∆t|n
yt
LAD = max |∆∆∆∆ t|
IS 466 - Forecasting - Dr. Mourad Ykhlef 50
Example (1/5)
Time 1 2 3 4 5 6Time series: 100 110 90 80 105 115
3-Period Moving average: 100 93.33 91.6
Error for the 3-Period MA: - 20 11.67 23.4
3-Period Weighted MA(.5, .3, .2) 98 89 85.5Error for the 3-Period WMA - 18 16 29.5
8/20/2019 04 Forecasting
26/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 51
= 361.24(-20)2+(11.67)2+(23.4)2
3MSE = =
ΣΣΣΣ(∆∆∆∆t)2222
n
Example (2/5)
MSE for the moving average technique:
MSE for the weighted moving average technique:
(-18)2 + (16)2 + (29.5)23
MSE = =ΣΣΣΣ(∆∆∆∆t)2222
n= 483.4
IS 466 - Forecasting - Dr. Mourad Ykhlef 52
MAD for the moving average technique:
MAD for the weighted moving average technique:
= 21.17
=18.35
|-20| + |11.67| + |23.4|
3MAD = =
ΣΣΣΣ |∆|∆|∆|∆ t|
n
|-18| + |116| + |29.5|
3MAD = =
ΣΣΣΣ |∆|∆|∆|∆ t|n
Example (3/5)
8/20/2019 04 Forecasting
27/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 53
MAPE for the moving average technique:
MAPE for the weighted moving average technique:
= .211
= .188|-20|/80 + |11.67|/105+ |23.4|/115
3MAPE= =
ΣΣΣΣ |∆|∆|∆|∆ t|n
|-18|/80 + |16|/105 + |29.5|/1153
MAPE= =ΣΣΣΣ |∆|∆|∆|∆ t|n
Example (4/5)
IS 466 - Forecasting - Dr. Mourad Ykhlef 54
LAD for the moving average technique:
LAD for the weighted moving average technique:
= 23.4
= 29.5
Example (5/5)
|-20|, |11.67|, |23.4|
LAD= max =|∆∆∆∆t
| max {|-18|, |16|, |29.5|}
LAD= max =|∆∆∆∆ t|
8/20/2019 04 Forecasting
28/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 55
Outline
• Definitions
• Forecasting types
• Time series• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
IS 466 - Forecasting - Dr. Mourad Ykhlef 56
Linear Trend Time Series• Two methods
– Expentional Smoothing with Trend Adjustment
– Trend Projections (Linear Regression)
8/20/2019 04 Forecasting
29/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 57
Expentional Smootthing with Trend Adjustment
• Ft = exponentially smoothed forecast of the dataseries in period t
• Tt = exponentially smoothed trend in periodt
• yt = times series value in period t
• α = smoothing constant for the average
• β = smoothing constant for the trend
IS 466 - Forecasting - Dr. Mourad Ykhlef 58
Expentional Smootthing with Trend Adjustment
• Forecast including trend (FITt) =
exponentially smoothed forecast (Ft)
+ exponentially smoothed trend (Tt)
• Ft = α(value last period)
+ (1-α)(Forecast last period +Trend estimate Last period)
Ft = α yt-1 + (1– α) (Ft-1 + Tt-1)
• Tt = β(Forecast this period - Forecast last period)
+ (1- β)(Trend estimate last period)
Tt = β(Ft - Ft-1) + (1- β)Tt-1
8/20/2019 04 Forecasting
30/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 59
Example (1/4)
• A large Portland manufacturer uses exponentialsmoothing to forecast demand for a piece ofpollution control equipment. It appears that anincreasing trend is present.
• α =.2 and β =.4
• F1=11 and T1=2
Month Demand
1 12
2 17
3 20
4 19
5 24
6 217 31
8 28
9 3610 ?
IS 466 - Forecasting - Dr. Mourad Ykhlef 60
Example (2/4)• Forecast for month 2
F2 = α y1 + (1– α) (F1 + T1)=.2(12)+.8(11+2)=12.8
T2 = β(F2 - F1) + (1- β)T1=.4(12.8-11)+0.6(2)=1.92
FIT2 = F2 +T2 = 14.72 units
• Forecast for month 3
F3 = α y2 + (1– α) (F2 + T2)=.2(17)+.8(12.8+1.92)=15.18
T3 = β(F3 – F2) + (1- β)T2=.4(15.18-12.8)+0.6(1.92)=2.10
FIT3 = F3 +T3 = 17.28 units
8/20/2019 04 Forecasting
31/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 61
Example (3/4)
Actual
Demand
Smoothed
Forecast
Smoothed
Trend
Forecast
including trend
12 11.00 2.00 13.00
17 12.80 1.92 14.72
20 15.18 2.10 17.28
19 17.82 2.32 20.14
24 19.91 2.23 22.14
21 22.51 2.38 24.89
31 24.11 2.07 26.18
28 27.14 1.45 28.59
36 29.28 2.32 31.60
32.48 2.68 35.16
IS 466 - Forecasting - Dr. Mourad Ykhlef 62
Example (4/4)
0
5
10
15
20
25
30
35
40
1 2 3 4 5 6 7 8 9 10
Month
D
e m
a n d
Actual
Demand
Smoothedforecast
Smoothed trend
Forecast including
trend
8/20/2019 04 Forecasting
32/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 63
Trend Projections
• This method files a trend line to a series of historicalpoints and then projects the line into the future formedium-to-long-range forecasts (other methods are
quadratic or exponential)
Deviation
Deviation
Deviation
Deviation
Deviation
Deviation
Deviation
Time
V a l u e s o f D e p e n d e n t V a r i a b l e
bxaY +=ˆ
Actual
observation
Point on
regression
line
IS 466 - Forecasting - Dr. Mourad Ykhlef 64
Trend Projections• Least Squares Equations (from statisticians)
Equation:ii bxaŶ +=
Slope: 221
1
xn x
y xn y x
bi
n
i
ii
n
i
−∑
−∑
=
=
=
Y-Intercept: xbya −=
x Average of the values of x
n number of data points
8/20/2019 04 Forecasting
33/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 65
Example (1/4)
Year Demand
2006 74
2007 79
2008 80
2009 90
2010 105
2011 142
2012 122
The demand forelectrical power at
N.Y.Edison overthe years 1997 –2003 is given atthe left. Find theoverall trend.
IS 466 - Forecasting - Dr. Mourad Ykhlef 66
Example (2/4)
Year TimePeriod
PowerDemand
x2 xy
2006 1 74 1 74
2007 2 79 4 158
2008 3 80 9 240
2009 4 90 16 3602010 5 105 25 525
2011 6 142 36 852
2012 7 122 49 854
Σx=28 Σy=692 Σx2=140 Σxy=3,063
8/20/2019 04 Forecasting
34/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 67
Example (3/4)
megawatts151.5610.54(9)56.702014inDemand
megawatts141.0210.54(8)56.702013inDemand
56.7010.54(4)-98.86xb-ya
10.5428
295
(7)(4)140
86)(7)(4)(98.3,063
xnΣx
yxn-Σxyb
98.867
692
n
Σyy 4
7
28
n
Σxx
222
=+=
=+=
===
==−
−=
−=
======
IS 466 - Forecasting - Dr. Mourad Ykhlef 68
Example (4/4)Electric Power Demand
60
70
80
90
100
110
120
130
140
150
160
1997 1998 1999 2000 2001 2002 2003 2004 2005
Year
8/20/2019 04 Forecasting
35/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 69
Outline
• Definitions
• Forecasting types
• Time series• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
IS 466 - Forecasting - Dr. Mourad Ykhlef 70
General Time Series Models• Components of a Time Series
– Tt = Trend of the time series at time t
– St = Seasonal
– Ct = Cyclical
– It = Irregular
• Any observed value in a time series is the product (or
sum) of time series components
• Multiplicative modelYt = Tt · St · Ct · It
• Additive modelYt = Tt + St + Ct + It
8/20/2019 04 Forecasting
36/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 71
Additive and multiplicative models
• Additive model
– The magnitude of seasonal component is constant overtime.
– For example the electric power consumption.
• Multiplicative model
– The magnitude of seasonal component grows inproportion to the trend of series.
– For example the cost of electric power consumption.
IS 466 - Forecasting - Dr. Mourad Ykhlef 72
Forecasting with Trendand Seasonal Components
• Steps of Multiplicative Time Series Model:
1. Calculate the centered moving averages (CMAs).
2. Center the CMAs on integer-valued periods.
3. Determine the seasonal and irregular factors (StI t ).
4. Determine the average seasonal factors.5. Scale the seasonal factors (St ).
6. Determine the deseasonalized data (Y t/St).
7. Determine a trend line of the deseasonalized data.
8. Determine the deseasonalized predictions.
9. Take into account the seasonality.
8/20/2019 04 Forecasting
37/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 73
Example (1/11)
• Business at Cloths Shop can be viewed as falling into threedistinct seasons:
(1) season 1 (November-December);
(2) season 2 (late May - mid-June); and(3) all other times.
Average weekly sales (SR) during each of the threeseasons during the past four years are shown on
the next slide.
• Determine a forecast for the average weekly sales
in year 5 for each of the three seasons.
IS 466 - Forecasting - Dr. Mourad Ykhlef 74
Example (2/11)• Past Sales (SR)
Year
Season 1 2 3 41 1856 1995 2241 2280
2 2012 2168 2306 24083 985 1072 1105 1120
8/20/2019 04 Forecasting
38/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 75
Example (3/11)
Moving ScaledYear Season Sales (Y t) Average StI t St Y t/St
1 1 1856 1.178 1576
2 2012 / 1617.67= 1.244 1.236 16283 985 1664.00 .592 .586 1681
2 1 1995 1716.00 1.163 1.178 16942 2168 1745.00 1.242 1.236 17543 1072 1827.00 .587 .586 1829
3 1 2241 1873.00 1.196 1.178 19022 2306 1884.00 1.224 1.236 18663 1105 1897.00 .582 .586 1886
4 1 2280 1931.00 1.181 1.178 1935
2 2408 1936.00 1.244 1.236 19483 1120 .586 1911
Remove trendand cyclical components
IS 466 - Forecasting - Dr. Mourad Ykhlef 76
Example (4/11)• 1. Calculate the centered moving averages
– There are three distinct seasons in each year.
– Hence, take a three-season moving average to eliminateseasonal and irregular factors (smoothing).
– Moving Average keeps trend and cyclical factors
For example:
1st MA = (1856 + 2012 + 985)/3 = 1617.67
2nd MA = (2012 + 985 + 1995)/3 = 1664.00
etc.
8/20/2019 04 Forecasting
39/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 77
Example (5/11)
• 2. Center the CMAs on integer-valued periods
The first moving average computed in step 1(1617.67) will be centered on season 2 of year 1.
Note that the moving averages from step 1 centerthemselves on integer-valued periods because n=3is an odd number.
Step 1 = (1+3)/2 = 2
IS 466 - Forecasting - Dr. Mourad Ykhlef 78
Example (6/11)• 3. Determine the seasonal & irregular factors (St It )
Isolate (or remove) the trend and cyclicalcomponents, for each period t, this is given by:
St It = Yt / (Moving Average for period t )
Yt = Tt· St· Ct· ItSt It = Yt / TtCtSt It = Yt / (Moving Average for period t )
Moving Average keeps Trend and Cycles
and eliminates Season and Irregular factor
8/20/2019 04 Forecasting
40/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 79
Example (7/11)
• 4. Determine the average seasonal factors
Averaging all (St It) values corresponding tothat season:
Season 1: ( 1.163 + 1.196 + 1.181) /3 = 1.180
Season 2: (1.244 + 1.242 + 1.224 + 1.244) /4 = 1.238
Season 3: ( .592 + .587 + .582 ) /3 = .587
IS 466 - Forecasting - Dr. Mourad Ykhlef 80
Example (8/11)• 5. Scale the seasonal factors (St)
Average the seasonal factors =
(1.180 + 1.238 + .587)/3 = 1.002
Then, divide each seasonal factor by the average of the
seasonal factors.
Season 1: 1.180/1.002 = 1.178
Season 2: 1.238/1.002 = 1.236
Season 3: .587/1.002 = .586
Total = 3.000
8/20/2019 04 Forecasting
41/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 81
Example (9/11)
• 6. Determine the deseasonalized data (Yt /St )
Divide the data point values, Yt , by St .
• 7. Determine a trend line of the deseasonalized data
Using the least squares method (trend projection) for t = 1,2, ..., 12, gives:
Tt = 1580.11 + 33.96t
IS 466 - Forecasting - Dr. Mourad Ykhlef 82
Example (10/11)• 8. Determine the deseasonalized predictions
Substitute t = 13, 14, and 15 into the least squaresequation:
T13 = 1580.11 + (33.96)(13) = 2022
T14 = 1580.11 + (33.96)(14) = 2056
T15 = 1580.11 + (33.96)(15) = 2090
8/20/2019 04 Forecasting
42/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 83
Example (11/11)
• 9. Take into account the seasonality.
Multiply each deseasonalized prediction by its
seasonal factor to give the following forecasts foryear 5:
Season 1: (1.178)(2022) = 2382
Season 2: (1.236)(2056) = 2541
Season 3: ( .586)(2090) = 1225
IS 466 - Forecasting - Dr. Mourad Ykhlef 84
Outline• Definitions
• Forecasting types
• Time series
• Stationary forecasting models
• Performance of forecasting methods
• Linear trend time series
• Trend, Seasonal and Cyclical time series
• Associative forecasting
8/20/2019 04 Forecasting
43/43
IS 466 - Forecasting - Dr. Mourad Ykhlef 85
Associative Forecasting
• Regression analysis (Trend projection)
• Multiple regression analysis
• Logistic regression
Final ThoughtThe best way toThe best way to
predict the futurepredict the futureis to create it!is to create it!