Sei sulla pagina 1di 43

King Saud University

College of Computer & Information Sciences

IS 466 Decision Support Systems

Lecture 4
Forecasting
Dr. Mourad YKHLEF
The slides content is derived and adopted from many references

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

Definitions
Forecasting is the process of predicting the future.
Forecasting is an integrated part of almost all
business 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

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.

IS 466 - Forecasting - Dr. Mourad Ykhlef

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

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

IS 466 - Forecasting - Dr. Mourad Ykhlef

Forecasting approaches
Qualtitative forecasts

Quantitive forecasts

Used when situation is


vague & litle data exist
New products
New technology

Involve intuition,
experience
e.g., forecasting sales
on Internet

Used when situation is


stable and historical
data exist
Existing products
Current technology

Use a variety of
mathematical models
that rely on historical
data and/or causal
variables
e.g., forecasting sales
of color televisions

IS 466 - Forecasting - Dr. Mourad Ykhlef

Overview of Qualitative methods


Consumer Market Survey
Ask the customer

Sales force composite


Estimates from individual sales person are reviewed
for 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

IS 466 - Forecasting - Dr. Mourad Ykhlef

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

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

10

What is a Time Series?


Set of evenly spaced numerical data
Obtained by observing response variable at regular
time 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

11

Time series components


Trend

Cyclical

Seasonal

Random

IS 466 - Forecasting - Dr. Mourad Ykhlef

12

Trend component
Time series may be relatively
stationary or it may exhibit
trend over time
Trend is the gradual upward
or downward movement of
data over time
Trend indicates that the time
series is increasing or
decreasing
Trend is typically modeled as
a linear, quadratic or
exponential function

Response

Mo., Qtr., Yr.

1984-1994 T/Maker Co.

IS 466 - Forecasting - Dr. Mourad Ykhlef

13

Seasonal component
When a repetitive pattern
is observed over some time
horizon, the series is said to
have seasonal behavior.

Summer

Response

Mo., Qtr.

Seasonality is a data
pattern that repeats itself
after a period of days,
weeks, months or quarters.

Occurs within 1 year

Period of
Pattern

Season
Length

Number of
Seasons in
Pattern

Week

Day

Month

Week

44

Month

Day

28 31

Year

Quarter

Year

Month

12

Year

Week

52

IS 466 - Forecasting - Dr. Mourad Ykhlef

14

Cyclical component
Cycles are patterns in the data that occur every several years.
Usually tied into the business cycle and are of the major
importance 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

Cycle
Response


Mo., Qtr., Yr.
IS 466 - Forecasting - Dr. Mourad Ykhlef

15

Random component
Erratic, unsystematic fluctuations
Due to random variations or unforeseen events
Union strike
Tornado

Short duration and non repeating

IS 466 - Forecasting - Dr. Mourad Ykhlef

16

Components of a Time Series


Time
series
value

Linear trend and seasonality

Future
Linear trend
Stationary
In Stationary, the mean value of the time series is assumed to be constant
IS 466 - Forecasting - Dr. Mourad Ykhlef

Time

17

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

IS 466 - Forecasting - Dr. Mourad Ykhlef

18

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

19

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 values of et
The general form of such a model is
are assumed to be

yt = 0 + t

independent
The values of et
are assumed to
have a mean of 0.

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 cyclical


components it will be stationary.

IS 466 - Forecasting - Dr. Mourad Ykhlef

20

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 time
series in different periods.
Lag k autocorrelation measures the correlation between time series
values 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

21

Methods for a stationary time series

The Last Period Method


The Moving Average Method
The Weighted Moving Average Method
The Exponential Smoothing Method

IS 466 - Forecasting - Dr. Mourad Ykhlef

22

The Last Period Method


The forecast for the next period is the last
observed value.

Ft +1 = y t
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 more
sophisticated models that follow can be compared

IS 466 - Forecasting - Dr. Mourad Ykhlef

23

The (Weighted) Moving Average Method


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

Ft +1 =

y t + y t 1 + ... + y t n+1
n

More recent values of the time series get larger weights


than past values when performing the forecast.

Ft + 1 = w1yt + w2yt-1 +w3yt-2 + + wnyt-n+1


w1 w2 wn
wi = 1
IS 466 - Forecasting - Dr. Mourad Ykhlef

24

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 demand
pattern is expected to repeat next year.
To forecast next year demand, the past 52 weeks
demand records were collected.

IS 466 - Forecasting - Dr. Mourad Ykhlef

25

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?

IS 466 - Forecasting - Dr. Mourad Ykhlef

26

Example (3 /7)
Collection of demand records
Week
Week
11
22
33
44
55
66
77
88
99
10
10
11
11
12
12
13
13

Demand
Demand
415
415
236
236
348
348
272
272
280
280
395
395
438
438
431
431
446
446
354
354
529
529
241
241
262
262

Week
Week
14
14
15
15
16
16
17
17
18
18
19
19
20
20
21
21
22
22
23
23
24
24
25
25
26
26

Demand
Demand
365
365
471
471
402
402
429
429
376
376
363
363
513
513
197
197
438
438
557
557
625
625
266
266
551
551

Week
Week
27
27
28
28
29
29
30
30
31
31
32
32
33
33
34
34
35
35
36
36
37
37
38
38
39
39

Demand
Demand
351
351
388
388
336
336
414
414
346
346
252
252
256
256
378
378
391
391
217
217
427
427
293
293
288
288

Week
Week
40
40
41
41
42
42
43
43
44
44
45
45
46
46
47
47
48
48
49
49
50
50
51
51
52
52

Demand
Demand
282
282
399
399
309
309
435
435
299
299
522
522
376
376
483
483
416
416
245
245
393
393
482
482
484
484

IS 466 - Forecasting - Dr. Mourad Ykhlef

27

Example (4 /7)
Construct the time series plot
Neither seasonality nor cyclical effects can be
observed

600
Series1

400
200

51

46

41

36

31

26

21

16

11

0
1

Demand

800

Weeks

IS 466 - Forecasting - Dr. Mourad Ykhlef

28

Example (5 /7) (Home work)


Is the trend present?
Run linear regression to test 1 in the model
yt=0+1t+t
Excel results
C oeff.
Intercept
W ee ks

S tand. E rr

t-S tat

P -value

Lowe r 95%U ppe r 95%

369.27 27.79436 13.2857 5E -18


313.44 425.094
0.3339 0.912641 0.36586 0.71601
0.71601 -1.49919 2.16699

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

29

Example (6 /7)
Forecast for Week 53
Last period technique (Ahmeds Forecast)

y$ 53 = y52 = 484 boxes.


Four-period moving average (Karims forecast)

y$53 = (y52 + y51 + y50 + y49) /4 =


(484+482+393+245) / 4 = 401 boxes.
Four period weighted moving average (Omars forecast)

y$ 53 =0.4y52 + 0.3y51 + 0.2y 50 + 0.1y49 =


0.4(484) + 0.3(482) + 0.2(393) + 0.1(245) = 441.3 boxes.
IS 466 - Forecasting - Dr. Mourad Ykhlef

30

Example (7 /7)
Forecast for Weeks 54 and 55
Since the time series is stationary, the forecasts for
weeks 54 and 55 remain as the forecast for week
53.
These forecasts will be revised pending
observation of the actual demand in week 53.

IS 466 - Forecasting - Dr. Mourad Ykhlef

31

Drawbacks of (Weighted) Moving Average Methods


Weighted Moving Average can put greater weight on the
more recent observations, it uses only last n periods data
values and ignores the history of the time series prior to
that time.
Increasing n makes forecast less sensitive to changes
Do not forecast trend well.
Require much historical data.
Solution: Exponential Smoothing Method

IS 466 - Forecasting - Dr. Mourad Ykhlef

32

Exponential Smoothing Method


All the previous values of historical data affect the
forecast.
For each period create a smoothed value Lt of the time
series, 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

33

Exponential Smoothing Method


New forecast = last periods forecast
+(last periods actual demand last periods forecast)

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

Ft +1 = L t = y t + (1 )Ft
An initial forecast is needed to start the process.
IS 466 - Forecasting - Dr. Mourad Ykhlef

34

Exponential Smoothing Method


Generating an initial forecast
Approach 1:
F =L = y
2 1 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

Fn +1 = y n

Begin using exponential smoothing from that time period


onward and so on.

Fn + 2 = y n +1 + (1 ) Fn +1 = y n +1 + (1 ) y n
IS 466 - Forecasting - Dr. Mourad Ykhlef

35

Exponential Smoothing Method


Future Forecasts
Since this technique deals with stationary time
series, the forecasts for future periods does not
change.
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,

IS 466 - Forecasting - Dr. Mourad Ykhlef

36

Example 1 (1/3)
Period

Series

Forecast

1
2
3
45
49

415
236
348
272
280
245

#N/A

50
51
52
53
54
55

393
482
484

415
397.1
392.19
368.8296268
371.2466641
382.3219977
392.4898
392.4898
392.4898

IS 466 - Forecasting - Dr. Mourad Ykhlef

37

Example 1 (2/3)
An exponential smoothing forecast is suggested,
with = 0.1.
An Initial Forecast is created at t=2 by
F2 = 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)
IS 466 - Forecasting - Dr. Mourad Ykhlef

38

Example 1 (3/3)
700
600
500
400
300
200
100
0
0

Notice the amount of smoothing


Included
in
the smoothed
series
10
20
30
40
50

60

IS 466 - Forecasting - Dr. Mourad Ykhlef

39

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 the
same average age of information if
k =

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, to
moving average based on 1 period
IS 466 - Forecasting - Dr. Mourad Ykhlef

40

Example 2 (1/6)
If Drugs uses exponential smoothing to forecast
sales, which value for the smoothing constant , .1
or .8, gives better forecasts?
Week Sales
1
110
2
115
3
125
4
120
5
125

Week
6
7
8
9
10

Sales
120
130
115
110
130

IS 466 - Forecasting - Dr. Mourad Ykhlef

41

Example 2 (2/6)
Exponential Smoothing: To evaluate the two
smoothing constants, determine how the
forecasted values would compare with the actual
historical values in each case.
Let: Yt = actual sales in week t
Ft = forecasted sales in week t
F2 = Y1 = 110
For other weeks, Ft+1 = .1Yt + .9Ft

IS 466 - Forecasting - Dr. Mourad Ykhlef

42

Example 2 (3/6)
Exponential Smoothing ( = .1, 1 - = .9)
F2
F3 = .1Y2 + .9F2 = .1(115) + .9(110)
F4 = .1Y3 + .9F3 = .1(125) + .9(110.5)
F5 = .1Y4 + .9F4 = .1(120) + .9(111.95)
F6 = .1Y5 + .9F5 = .1(125) + .9(112.76)
F7 = .1Y6 + .9F6 = .1(120) + .9(113.98)
F8 = .1Y7 + .9F7 = .1(130) + .9(114.58)
F9 = .1Y8 + .9F8 = .1(115) + .9(116.12)
F10= .1Y9 + .9F9 = .1(110) + .9(116.01)

= 110
= 110.5
= 111.95
= 112.76
= 113.98
= 114.58
= 116.12
= 116.01
= 115.41

IS 466 - Forecasting - Dr. Mourad Ykhlef

43

Example 2 (4/6)
Exponential Smoothing ( = .8, 1 - = .2)
F2
= 110
F3 = .8(115) + .2(110) = 114
F4 = .8(125) + .2(114) = 122.80
F5 = .8(120) + .2(122.80) = 120.56
F6 = .8(125) + .2(120.56) = 124.11
F7 = .8(120) + .2(124.11) = 120.82
F8 = .8(130) + .2(120.82) = 128.16
F9 = .8(115) + .2(128.16) = 117.63
F10= .8(110) + .2(117.63) = 111.53

IS 466 - Forecasting - Dr. Mourad Ykhlef

44

Example 2 (5/6)
Mean Squared Error: In order to determine which
smoothing constant gives the better performance,
calculate, for each, the mean squared error for the
nine weeks of forecasts, weeks 2 through 10 by:
[(Y2-F2)2 + (Y3-F3)2 + (Y4-F4)2 + . . . + (Y10-F10)2]/9
Select the forecast with the smallest error value

IS 466 - Forecasting - Dr. Mourad Ykhlef

45

Example 2 (6/6)
= .1
Ft
(Yt - Ft)2

= .8
Ft
(Yt - Ft)2

Week

Yt

1
2
3
4
5
6
7
8
9
10

110
115
125
120
125
120
130
115
110
130

110.00
25.00
110.50 210.25
111.95
64.80
112.76 149.94
113.98
36.25
114.58 237.73
116.12
1.26
116.01
36.12
115.41 212.87

110.00
25.00
114.00 121.00
122.80
7.84
120.56
19.71
124.11
16.91
120.82
84.23
128.16 173.30
117.63
58.26
111.53 341.27

MSE

Sum
974.22
Sum/9 108.25

Sum
847.52
Sum/9 94.17

Mean Squared Error

IS 466 - Forecasting - Dr. Mourad Ykhlef

46

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

47

Performance of Forecasting Methods


Calculate the value of the evaluation measure
using the forecast error equation
Error = Actual Forecast
t = y t Ft

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
IS 466 - Forecasting - Dr. Mourad Ykhlef

48

Forecast Error Equations

MSE =

MAD =

( t)2
MAPE =

| t|

n|t|
n

yt

t|
LAD = max |

IS 466 - Forecasting - Dr. Mourad Ykhlef

49

Example (1/5)

Time
Time series:

100

110

90

80

105

115

100
- 20
98
- 18

93.33
11.67
89
16

91.6
23.4
85.5
29.5

3-Period Moving average:


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

IS 466 - Forecasting - Dr. Mourad Ykhlef

50

Example (2/5)

MSE for the moving average technique:

(
t)2 (-20)2+(11.67)2+(23.4)2
MSE =
=
3

= 361.24

MSE for the weighted moving average technique:

(
t)2 (-18)2 + (16)2 + (29.5)2
MSE =
=
3

= 483.4

IS 466 - Forecasting - Dr. Mourad Ykhlef

51

Example (3/5)

MAD for the moving average technique:


MAD =

| t|
n

|-20| + |11.67| + |23.4|


= 18.35
3

MAD for the weighted moving average technique:


MAD =

| t|
n

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


3

= 21.17

IS 466 - Forecasting - Dr. Mourad Ykhlef

52

Example (4/5)

MAPE for the moving average technique:

| t|

MAPE=
n

|-20|/80 + |11.67|/105+ |23.4|/115


= .188
3

MAPE for the weighted moving average technique:

| t|

MAPE=
n

= |-18|/80 + |16|/105 + |29.5|/115 = .211


3

IS 466 - Forecasting - Dr. Mourad Ykhlef

53

Example (5/5)

LAD for the moving average technique:

t| = max {|-18|, |16|, |29.5|} = 29.5


LAD= max|
LAD for the weighted moving average technique:

t| = |-20|, |11.67|, |23.4| = 23.4


LAD= max |
IS 466 - Forecasting - Dr. Mourad Ykhlef

54

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

55

Linear Trend Time Series


Two methods
Expentional Smoothing with Trend Adjustment
Trend Projections (Linear Regression)

IS 466 - Forecasting - Dr. Mourad Ykhlef

56

Expentional Smootthing with Trend Adjustment


Ft = exponentially smoothed forecast of the data
series in period t
Tt = exponentially smoothed trend in period t
yt = times series value in period t
= smoothing constant for the average
= smoothing constant for the trend

IS 466 - Forecasting - Dr. Mourad Ykhlef

57

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)


(Forecast this period - Forecast last period)
+ (1- )(Trend estimate last period)
Tt = (Ft - Ft-1) + (1- )Tt-1

Tt =

IS 466 - Forecasting - Dr. Mourad Ykhlef

58

Example (1/4)
A large Portland manufacturer uses exponential
smoothing to forecast demand for a piece of
pollution control equipment. It appears that an
increasing trend is present. Month
Demand
1
12
=.2 and =.4
2
17
F1=11 and T1=2
3
20
4
5
6
7
8
9
10

19
24
21
31
28
36
?

IS 466 - Forecasting - Dr. Mourad Ykhlef

59

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

IS 466 - Forecasting - Dr. Mourad Ykhlef

60

Example (3/4)
Actual Smoothed Smoothed
Forecast
Demand Forecast
Trend
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

61

Example (4/4)
40
35

Actual
Demand

30

D em an d

25
20
15

Smoothed
forecast

Forecast including
trend

10

Smoothed trend

5
0
1

10

Month

IS 466 - Forecasting - Dr. Mourad Ykhlef

62

Trend Projections

Values of Dependent Variable

This method files a trend line to a series of historical


points and then projects the line into the future for
medium-to-long-range forecasts (other methods are
quadratic or exponential)
Actual
observation

Deviation
Deviation

Deviation
Deviation

Point on
regression
line

Deviation
Deviation

Deviation

Y = a + bx

Time
IS 466 - Forecasting - Dr. Mourad Ykhlef

63

Trend Projections
Least Squares Equations (from statisticians)
Equation:

i = a + bx i
Y

Average of the values of x

n number of data points

Slope:

b=

xi y i nx y

i =1
n

x i2 n x 2

i =1

Y-Intercept:

a = y bx
IS 466 - Forecasting - Dr. Mourad Ykhlef

64

Example (1/4)
Year
2006
2007
2008
2009
2010
2011
2012

Demand
74
79
80
90
105
142
122

The demand for


electrical power at
N.Y.Edison over
the years 1997
2003 is given at
the left. Find the
overall trend.

IS 466 - Forecasting - Dr. Mourad Ykhlef

65

Example (2/4)
Year

Time
Power
Period Demand

x2

xy

2006

74

74

2007

79

158

2008

80

240

2009

90

16

360

2010

105

25

525

2011

142

36

852

2012

122

49

854

x=28

y=692

x2=140

IS 466 - Forecasting - Dr. Mourad Ykhlef

xy=3,063

66

Example (3/4)
y 692
=
= 98.86
7
n

x=

x 28
=
=4
n
7

b=

xy - n x y 3,063 (7)(4)(98. 86) 295


=
= 10.54
=
x 2 n x 2
140 (7)(4) 2
28

y=

a = y - b x = 98.86 - 10.54(4) = 56.70


Demand in 2013 = 56.70 + 10.54(8) = 141.02 megawatts
Demand in 2014 = 56.70 + 10.54(9) = 151.56 megawatts
IS 466 - Forecasting - Dr. Mourad Ykhlef

67

Example (4/4)
Electric Power Demand
160
150
140
130
120
110
100
90
80
70
60
1997

1998

1999

2000

2001

2002

2003

2004

2005

Year

IS 466 - Forecasting - Dr. Mourad Ykhlef

68

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

69

General Time Series Models


Components of a Time Series

Tt
St
Ct
It

= Trend of the time series at time t


= Seasonal
= Cyclical
= Irregular

Any observed value in a time series is the product (or


sum) of time series components
Multiplicative model
Yt = Tt St Ct It

Additive model
Yt = Tt + St + Ct + It
IS 466 - Forecasting - Dr. Mourad Ykhlef

70

Additive and multiplicative models


Additive model
The magnitude of seasonal component is constant over
time.
For example the electric power consumption.

Multiplicative model
The magnitude of seasonal component grows in
proportion to the trend of series.
For example the cost of electric power consumption.

IS 466 - Forecasting - Dr. Mourad Ykhlef

71

Forecasting with Trend


and Seasonal Components

Steps of Multiplicative Time Series Model:


1.
2.
3.
4.
5.
6.
7.
8.
9.

Calculate the centered moving averages (CMAs).


Center the CMAs on integer-valued periods.
Determine the seasonal and irregular factors (StIt ).
Determine the average seasonal factors.
Scale the seasonal factors (St ).
Determine the deseasonalized data (Yt/St).
Determine a trend line of the deseasonalized data.
Determine the deseasonalized predictions.
Take into account the seasonality.

IS 466 - Forecasting - Dr. Mourad Ykhlef

72

Example (1/11)
Business at Cloths Shop can be viewed as falling into three
distinct 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 three
seasons 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

73

Example (2/11)
Past Sales (SR)
Year
Season 1
2
3
4
1
1856 1995 2241 2280
2
2012 2168 2306 2408
3
985 1072 1105 1120

IS 466 - Forecasting - Dr. Mourad Ykhlef

74

Example (3/11)

Remove trend
and cyclical components

Moving
Scaled
Year Season Sales (Yt) Average StIt
St
1
1
1856
1.178
2012 / 1617.67= 1.244 1.236
2
3
985
1664.00 .592 .586
2
1
1995
1716.00 1.163 1.178
2
2168
1745.00 1.242 1.236
3
1072
1827.00 .587 .586
3
1
2241
1873.00 1.196 1.178
2
2306
1884.00 1.224 1.236
3
1105
1897.00 .582 .586
4
1
2280
1931.00 1.181 1.178
2
2408
1936.00 1.244 1.236
3
1120
.586

Yt/St
1576
1628
1681
1694
1754
1829
1902
1866
1886
1935
1948
1911

IS 466 - Forecasting - Dr. Mourad Ykhlef

75

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 eliminate
seasonal 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.
IS 466 - Forecasting - Dr. Mourad Ykhlef

76

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 center
themselves on integer-valued periods because n=3
is an odd number.
Step 1 = (1+3)/2 = 2
IS 466 - Forecasting - Dr. Mourad Ykhlef

77

Example (6/11)
3. Determine the seasonal & irregular factors (St It )

Isolate (or remove) the trend and cyclical


components, for each period t, this is given by:
St It = Yt / (Moving Average for period t )
Moving Average keeps Trend and Cycles
Yt = Tt St Ct It
and eliminates Season and Irregular factor
St It = Yt / TtCt
St It = Yt / (Moving Average for period t )

IS 466 - Forecasting - Dr. Mourad Ykhlef

78

Example (7/11)
4. Determine the average seasonal factors
Averaging all (St It) values corresponding to
that 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

79

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
IS 466 - Forecasting - Dr. Mourad Ykhlef

80

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

81

Example (10/11)
8. Determine the deseasonalized predictions
Substitute t = 13, 14, and 15 into the least squares
equation:
T13 = 1580.11 + (33.96)(13) = 2022
T14 = 1580.11 + (33.96)(14) = 2056
T15 = 1580.11 + (33.96)(15) = 2090

IS 466 - Forecasting - Dr. Mourad Ykhlef

82

Example (11/11)
9. Take into account the seasonality.
Multiply each deseasonalized prediction by its
seasonal factor to give the following forecasts for
year 5:
Season 1: (1.178)(2022) = 2382
Season 2: (1.236)(2056) = 2541
Season 3: ( .586)(2090) = 1225

IS 466 - Forecasting - Dr. Mourad Ykhlef

83

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

84

Associative Forecasting
Regression analysis (Trend projection)
Multiple regression analysis
Logistic regression

IS 466 - Forecasting - Dr. Mourad Ykhlef

85

Final Thought
The best way to
predict the future
is to create it!

IS 466 - Forecasting - Dr. Mourad Ykhlef

86

Potrebbero piacerti anche