Você está na página 1de 42

Forecasts project historical time-series data

into the future


A Time-series is a time-ordered sequence of

observations taken at regular time intervals


Assume that future values of the time-series

can be estimated from past values of the


time-series

1. Determine whether the time series is a

2.
3.
4.
5.

constant process, linear trend process, or


seasonal process
Apply the alternative forecasting methods
to historical data
Calculate forecast errors
Choose the forecast method with the least
forecast errors.
Apply the forecast method to predict future
values of the time series

Constant Process
A t = a + t
is a constant process. At denotes actual demand in period t and a is
a constant.
At
*

a
*

*
*

*
*

Time t

Linear Trend Process


At = a + bt + t is a linear trend process. At denotes actual demand
in period t, a is a constant, and b is the slope of the line.
At

*
a

*
*

* *

*
*

*
*

a + bt

Time t

Multiplicative Seasonal Process


At = (a + bt) St + t is a multiplicative seasonal process.
St denotes the seasonal factor for period t.
At

(a + bt) St
*

*
*

*
*

*
*

*
*

a
Time t

a + bt

Forecasting Model Selection


Constant Processes
1. Simple moving average
2. Weighted moving average
3. Simple Exponential Smoothing
Linear Trend Processes
1. Double Exponential Smoothing
2. Linear Regression
Multiplicative Seasonal Processes
1. Time Series Decomposition

At - 1 + At - 2 + At - 3 + . . . + At - n
_________________________
Ft =
n
where
Ft

= Forecast for the coming period

= Number of periods to be averaged

At - 1

= Actual demand in the last period

At - i

= Actual demand i = 1, 2, . . . , n periods ago

Observe that each historical observation At - i is given the same


weight 1/n.

Example: THREE-Period Simple Moving Average


Week

Demand

Forecast

800

1,400

1,000

1,500

1,067

1,500

1,300

1,333

Choice of n (the number of periods to average)


At
*

a
*

On average, the best forecast is Ft = a.

Time t

A small n, such as n = 2, results in a nervous forecast that responds


to random variation t.
A larger n, such as n = 5, smoothes out random variation t and
stabilizes the forecast.

Choice of n (the number of periods to average)


At
a'

*
*

*
*

*
*

Time t
A small n results in a forecast that is quick to respond to changes in
the base level a.
A large n results in a forecast that is slow to respond to changes in
the base level a.

Choice of n (the number of periods to average)


LARGE n
Advantage: Smoothes out random variation t
Disadvantage: Forecast is slow to respond to changes in a.
SMALL n
Advantage: Forecast is quick to respond to changes in a.
Disadvantage: Forecast is sensitive to random variation t
RULE: If random variation t is large, one must use a large n.

Weighted Moving Average


Ft = w1 A t - 1 + w2 At - 2 + w3 At - 3 + . . . + wn At - n
where:
Ft

= Forecast for the coming period

w1

= Weight to be given to the actual demand in period t - 1

wi

= Weight to be given to the actual demand in period t - i

= Total number of periods in the moving average


n

w = 1
i

i=1

Example: FOUR-Period Weighted Moving Average


Month

Demand

100

90

105

95

110

Use weights .4, .3, .2, and .1


F5 = 0.40(95) + 0.30(105) + 0.20(90) + 0.10(100) = 97.5
F6 = 0.40(110) + 0.30(95) + 0.20(105) + 0.10(90) = 102.5

Simple Exponential Smoothing


Exponential smoothing is the most commonly used of all
forecasting techniques for constant processes and there are several
reasons:
1. Exponential smoothing models are surprisingly accurate.
2. Exponential smoothing models are intuitive.
3. Exponential smoothing models require little computation and data
storage.

Simple Exponential Smoothing


Ft = Ft - 1 + (At - 1 Ft - 1)
where
Ft

= Exponentially-smoothed forecast for period t

Ft - 1

= Exponentially-smoothed forecast made for the prior


period

At - 1

= Actual demand in the prior period

= Smoothing constant (0 < < 1)

In words:
New
=
forecast

Old
+ a proportion of
forecast

Forecast
error

Suppose:
Ft - 1

= 1,050

= 0.05

At - 1

= 1,000

then
Ft

= Ft - 1 + ( At - 1 Ft - 1)
= 1,050 + 0.05(1,000 1,050)
= 1,047.5

Models for Linear Trend Processes


Why does simple exponential smoothing not work for linear trend
processes? ( = 0.10)
A1 A2 A3
*
*
*

*
F1

*
F2

*
F3

A4
*

*
F4

A5
*

*
F5

Time t

Linear regression
Double exponential smoothing

Linear Regression
Regression refers to the process of fitting a functional
relationship to two or more correlated variables.
It is used to predict one variable given the other.
Y

Graph of (X,Y) Bivariate Observations

*
*
*
a

*
*

*
*

a + bX

*
X

Period

Linear Regression
The linear regression line is of the form:
Y = a + bX
where
Y is the value of the dependent variable (e.g., sales or demand),
a is the Y intercept,
b is the slope, and
X is the independent variable (e.g., the time period)

The least squares estimates for a and b are:


__
xy n x y
___________
b=
_2
2
x nx
_ _
a = y - bx
where
a = Y intercept
b = slope of the line
_
y = average of all ys
_
x = average of all xs
n = number of data points
Y = value of the dependent variable computed with the regression line

xy

x2

600

600

1,550

3,100

1,500

4,500

1,500

6,000

16

2,400

12,000

25

3,100

18,600

36

2,600

18,200

49

2,900

23,200

64

3,800

34,200

81

10

4,500

45,000

100

11

4,000

44,000

121

12

4,900

58,800

144

78

33,350

268,200

650

_ 78
x = 12 = 6.5

_ 33,350
y = 12
= 2,779.17

__
xy n x y
___________
268,200 (12)(6.5)(2,779.17) = 359.6153
b=
_
=
________
________
x2 n x2
(650) (12)(6.5)2
_ _
a = y - bx = 2,779.17 359.6153(6.5) = ________
441.6666
________
Y(x) = 441.6666 + 359.6153x
Y(13) = 441.6666 + 359.6153(13) = 5,116.4
Y(14) = 441.6666 + 359.6153(14) = 5,476.0
Y(15) = 441.6666 + 359.6153(15) = 5,835.6
Y(16) = 441.6666 + 359.6153(16) = 6,195.2

Double Exponential Smoothing


Double exponential smoothing requires three formulas:
Ft

= FITt - 1 + (At - 1 FITt - 1)

Tt

= Tt - 1 + (At - 1 FITt 1)

FITt

= Ft + Tt

where 0 < < 1 and 0 < < 1 are smoothing constants


Ft

= Exponentially smoothed forecast for period t

Tt

= Exponentially smoothed trend for period t

FITt

= Forecast including trend for period t

FITt - 1 = Forecast including trend made for the prior period


A

= Actual demand for the prior period

Double Exponential Smoothing Example


Suppose:
Ft - 1 = 100, Tt - 1 = 10, = 0.20, = 0.30, and At - 1 = 115.
FITt - 1 = Ft - 1 + Tt - 1 = 100 + 10 = 110
Ft

= FITt - 1 + (At - 1 FITt - 1)


= 110 + 0.2 (115 110) = 111.0

Tt

= Tt - 1 + (At - 1 FITt - 1)
= 10 + (.2)(.3)(115 110) = 10.3

FITt

= Ft + Tt = 111.0 + 10.3 = 121.3

FITt

= Ft + Tt = 111.0 + 10.3 = 121.3

If At = 120,
then
Ft + 1

= 121.3 + .2(120 121.3) = 121.04

Tt + 1

= 10.3 + (.2)(.3)(120 121.3) = 10.22

FITt + 1 = 121.04 + 10.22 = 131.26

Models with Seasonal Factors


A seasonal factor is the amount of correction needed in a time
series to adjust for the season of the year.
A seasonal factor is the average amount sold during a season
divided by the average for all seasons:
Seasonal = Average demand for the season
Average demand for all seasons
factor

Seasonal Factor Example


Sales
2011

2012

Winter

150

Spring

200

Summer

400

Fall

300

Winter

100

Spring

300

Summer

500

Fall

300
2,250

150 + 100
Winter
2
_________________
= .444
seasonal =
2,250
factor
8

200 + 300
Spring
2
_________________
=
= .888
seasonal
2,250
factor
8

400 + 500
Summer
2
_________________
=
= 1.6
seasonal
2,250
factor
8
300 + 300
Fall
2
_________________
=
= 1.066
seasonal
2,250
factor
8

If demand for the entire year of 2013 is expected to


be 1,100 units, the SEASONALLY ADJUSTED
forecasts would be:
Deseasonalized quarterly forecast = 1,100/4 = 275
Deseasonalized
forecast

Seasonal
factor

Seasonalized
=
forecast

Winter

275

.444

122.22

Spring

275

.888

244.44

Summer

275

1.600

440.00

Fall

275

1.066

293.33

Time Series Decomposition


Decomposition of a time series means to find the series basic
trend and seasonal components. The decomposition procedure is:
1. Decompose the time series into its components
a. Find the seasonal factors
b. Deseasonalize the demand
c. Find the trend component
2. Prepare a forecast
a. Project the trend into the future to prepare a deseasonalized
forecast
b. Prepare a seasonally-adjusted forecast by multiplying the
deseasonalized forecast by the seasonal factor

Step 1(a): Find the seasonal factors


Period (x)
1
2
3
4
5
6
7
8
9
10
11
12
78

_ 78
x=
= 6.5
12

Quarter
I
II
III
IV
I
II
III
IV
I
II
III
IV

Actual Demand (y)


600
1,550
1,500
1,500
2,400
3,100
2,600
2,900
3,800
4,500
4,000
4,900
33,350

_ 33,350
y=
= 2,779.2
12

600+2,400+3,800
3
___________
Quarter I seasonal factor =
33,350
12
= .8126
1,550+3,100+4,500
3
___________
Quarter II seasonal factor =
33,350
12
= 1.0975

Quarter III seasonal factor =

1,500+2,600+4,000
3
___________
33,350
12

= .9715

1,500+2,900+4,900
3
___________
Quarter IV seasonal factor =
33,350
12
= 1.1154

Step 1(b): Deseasonalize the demand


Since we are assuming a multiplicative seasonal process,
At = (a + bt) St + t
we DIVIDE actual demand At by the seasonal indices (St)
to deseasonalize.

Period
(x)

Quarter

Actual
demand
(y)

Seasonal
factor
(St)

Deseasonalized Demand
(yd)

x2

x yd

yd = y/St

600

0.82

735.6618

735.7

II

1,550

1.10

1,412.3634

2,824.7

III

1,500

0.97

1,543.9815

4,631.9

IV

1,500

1.12

1,344.7581

16

5,379.0

2,400

0.82

2,942.6471

25

14,713.2

II

3,100

1.10

2,824.7268

36

16,948.4

III

2,600

0.97

2,676.2346

49

18,733.6

IV

2,900

1.12

2,599.8656

64

20,798.9

3,800

0.82

4,659.1912

81

41,932.7

10

II

4,500

1.10

4,100.4098

100

41,004.1

11

III

4,000

0.97

4,117.2840

121

45,290.1

12

IV

4,900

1.12

4,392.8763

144

52,714.5

33,350.000

650

265,706.986

78

33,350

Step 1(c): Fit a regression line to the DESEASONALIZED demand


data (yd) to estimate the trend component.
_ 78
x = 12 = 6.5

_
yd = 33,350
= 2,779.2
12

__

xyd n x yd
___________
265,706.9 (12)(6.5)(2,779.2) = 342.2
b=
_
=
_____
_____
x2 n x 2
(650) (12)(6.5)2
_
_
a = yd - bx = 2,779.2 342.2(6.5) = _____
554.9
_____

Yd = a + bx = 554.9 + 342.2 x

Step 2(a): Project the trend into the future to prepare deseasonalized
forecasts.
Yd = a + bx = 554.9 + 342.2 x
Yd (13) = 554.9 + 342.2(13) = 5,003.3
Yd (14) = 554.9 + 342.2(14) = 5,345.5
Yd (15) = 554.9 + 342.2(15) = 5,687.7
Yd (16) = 554.9 + 342.2(16) = 6,029.9

FINALLY,
Step 2(b): Seasonally adjust the deseasonalized forecast by
multiplying the deseasonalized forecast by the seasonal factors.
Period

Quarter

Deseasonalized Seasonal
forecast Yd
Factor

Seasonally
Adjusted
Forecast

13

5,003.3

0.82

4,080.69

14

II

5,345.5

1.10

5,866.46

15

III

5,687.7

0.97

5,525.69

16

IV

6,029.9

1.12

6,726.00

Forecast accuracy is an important forecasting

technique selection criterion


Error = Actual demand Forecast

Actual

MAD

Actual

MSE

Forecast t

MAD weights all errors


evenly

n
t

Forecast t

n 1

MAPE

Actual t Forecast t
100
Actualt
n

MSE weights errors according


to their squared values

MAPE weights errors


according to relative error

Period

Actual
(A)

Forecast
(F)

(A-F)
Error

|Error|

Error2

[|Error|/Actual]x100

107

110

-3

2.80%

125

121

16

3.20%

115

112

2.61%

118

120

-2

1.69%

108

109

0.93%

Sum

13

39

11.23%

n=5

n-1 = 4

n=5

MAD

MSE

MAPE

= 2.6

= 9.75

= 2.25%

Você também pode gostar