Time Series and Forecasting

Time Series and
Forecasting
Chapter 16
McGraw-Hill/Irwin
Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Learning Objectives
LO1 Define the components of a time series
LO2 Compute Moving average, weighted moving average
and exponential smoothing
LO3 Determine a linear trend equation
LO4 Use a trend equation to compute forecasts
LO5 Determine and interpret a set of seasonal indexes
LO6 Deseasonalize data using a seasonal index
LO7 Calculate seasonally adjusted forecasts
LO8 Use a trend equation for a nonlinear trend
16-2
Time Series and its Components
TIME SERIES is a collection of data recorded over a period of time (weekly,
monthly, quarterly), an analysis of history, that can be used by management
to make current decisions and plans based on long-term forecasting. It
usually assumes past pattern to continue into the future
Components of a Time Series
1. Secular Trend – the smooth long term direction of a time series
2. Cyclical Variation – the rise and fall of a time series over periods longer
than one year
3. Seasonal Variation – Patterns of change in a time series within a year
which tends to repeat each year
4. Irregular Variation – classified into:
Episodic – unpredictable but identifiable
Residual – also called chance fluctuation and unidentifiable
16-3
Secular Trend – Examples
16-4
Cyclical Variation – Sample Chart
1991
1996
2001
2006
2011
16-5
Seasonal Variation – Sample Chart
16-6
Irregular variation
Caused by irregular and unpredictable
changes in a times series that are not
caused by other components
 Exists in almost all time series
 Needs to reduce irregular variation to
make accurate predictions

16-7
The Moving Average Method
Useful in smoothing time series to see its
trend
 Basic method used in measuring seasonal
fluctuation
 Applicable when time series follows fairly
linear trend that have definite rhythmic
pattern

16-8
Moving Average Method - Constant
duration of cycles
16-9
3-year and 5-Year Moving Averages
Gas Sales
39
37
61
58
18
56
82
27
41
69
49
66
54
42
90
66
100
Data-> Data
Analysis ->
Moving
Average
90
80
70
60
Gas Sales
50
3-period
5-period
40
30
20
10
0
1
2
3
4
5
6
7
8
9
10 11 12 13 14 15 16
16-10
Exponential Smoothing

Overcome some
drawbacks of moving
average:
 No
moving averages
for the first and last
time periods.
 “Forgets” most of the
previous values.
St = wyt + (1 – w)St-1 (for t ≥ 2)
where:
St = Exponentially smoothed time
series at time t
yt = Time series at time period t
St-1 = Exponentially smoothed time
series at time t–1
w = Smoothing constant, 0 ≤ w ≤ 1
Exponential smoothing
Data-> Data Analysis ->
Exponential smoothing,
damping factor = 1-w
Gas Sales
39
100
37
61
58
18
56
82
27
41
69
49
66
54
42
90
66
90
80
70
60
Gas Sales
50
damping=.8
damping=.3
40
30
20
10
0
1
2
3
4
5
6
7
8
9
10 11 12 13 14 15 16
16-12
Weighted Moving Average




A simple moving average assigns the same
weight to each observation in averaging
Weighted moving average assigns different
weights to each observation
Most recent observation receives the most
weight, and the weight decreases for older data
values
In either case, the sum of the weights = 1
16-13
Weighted Moving Average - Example
Cedar Fair operates seven amusement parks and
five separately gated water parks. Its combined
attendance (in thousands) for the last 17 years is
given in the following table. A partner asks you to
study the trend in attendance. Compute a threeyear moving average and a three-year weighted
moving average with weights of 0.2, 0.3, and 0.5 for
successive years.
16-14
Weighted Moving Average - Example
16-15
Weighed Moving Average – An Example
16-16
Linear Trend

The long term trend of many business series often
approximates a straight line

Linear Trend Equation : Y  a  bt
where :

Y  read "Y hat" , is the projected value of the Y
variable for a selected value of t
a  the Y - intercept
b  the slope of the line
t  any value of time (coded) that is selected
16-17
Linear Trend Plot
16-18
Linear Trend – Using the Least Squares
Method



Use the least squares method in Simple Linear
Regression (Chapter 13) to find the best linear
relationship between 2 variables
Code time (t) and use it as the independent
variable
E.g. let t be 1 for the first year, 2 for the second,
and so on (if data are annual)
16-19
Linear Trend –An Example
A hotel in Bermuda has
recorded the occupancy
rate for each quarter for
the past 5 years. The
data are shown here.
Year
2006
2007
2008
2009
1010
Rate
0.561
0.702
0.800
0.568
0.575
0.738
0.868
0.605
0.594
0.738
0.729
0.600
0.622
0.708
0.806
0.632
0.665
0.835
0.873
0.670
Quarter
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
16-20
Linear Trend –An Example Using Excel
Rate
1
0.9
y = 0.0052x + 0.6394
0.8
0.7
0.6
0.5
Rate
0.4
Linear (Rate)
0.3
0.2
0.1
0
0
5
10
15
20
25
Insert->Scatter->first option->Right-click on
any marker->Add trendline->At the bottom:
Display Equation on chart
16-21
Seasonal Variation



Fluctuations that coincide with certain seasons;
repeated year after year
Understanding seasonal fluctuations help plan for
sufficient goods and materials on hand to meet varying
seasonal demand
Analysis of seasonal fluctuations over a period of years
help in evaluating current sales
16-22
Seasonal Index


A number, usually expressed in percent, that
expresses the relative value of a season with
respect to the average for the year (100%)
Ratio-to-moving-average method


The method most commonly used to compute the
typical seasonal pattern
It eliminates the trend (T), cyclical (C), and irregular (I)
components from the time series
16-23
Bermuda Hotel example
Quarter
Step (1) – Organize time
series data in column form
Step (2) Compute the 4quarter moving totals
Step (3) Compute the 4quarter moving averages
Step (4) Compute the
centered moving averages
by getting the average of
two 4-quarter moving
averages
Step (5) Compute ratio by
dividing actual rate by the
centered moving averages
Period t
Rate
4-quarter
moving
averages
Centered
moving
averaged
Ratio of
sales to
centered
moving
averages
1
1
0.561
2
2
0.702
0.65775
3
3
0.800
0.66125
0.6595
1.21304
4
4
0.568
0.67025
0.66575
0.853173
1
5
0.575
0.68725
0.67875
0.847145
2
6
0.738
0.6965
0.691875
1.066667
3
7
0.868
0.70125
0.698875
1.241996
4
8
0.605
0.70125
0.70125
0.862745
1
9
0.594
0.6665
0.683875
0.86858
2
10
0.738
0.66525
0.665875
1.108316
3
11
0.729
0.67225
0.66875
1.090093
4
12
0.600
0.66475
0.6685
0.897532
1
13
0.622
0.684
0.674375
0.922335
2
14
0.708
0.692
0.688
1.02907
3
15
0.806
0.70275
0.697375
1.155763
4
16
0.632
0.7345
0.718625
0.879457
1
17
0.665
0.75125
0.742875
0.895171
2
18
0.835
0.76075
0.756
1.104497
3
19
0.873
4
20
0.670
16-24
Seasonal Index – An Example
Year
1
2
2006
3
4
1.21304
0.853173
2007
0.847145 1.066667 1.241996 0.862745
2008
0.86858
1.108316 1.090093 0.897532
2009
0.922335
1.02907
2010
0.895171 1.104497
1.155763 0.879457
Average
0.883308 1.077137 1.175223 0.873227
Index
0.883308 1.077137 1.175223 0.873227
16-25
Actual versus Deseasonalized Sales for Toys International
Deseasonalized Series = Actual series / Seasonal Index
Quarter
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
Period t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Rate
0.561
0.702
0.800
0.568
0.575
0.738
0.868
0.605
0.594
0.738
0.729
0.600
0.622
0.708
0.806
0.632
0.665
0.835
0.873
0.670
4-quarter Centered
moving
moving
average average
0.66
0.66
0.67
0.69
0.70
0.70
0.70
0.67
0.67
0.67
0.66
0.68
0.69
0.70
0.73
0.75
0.76
0.66
0.67
0.68
0.69
0.70
0.70
0.68
0.67
0.67
0.67
0.67
0.69
0.70
0.72
0.74
0.76
Ratio
1.21
0.85
0.85
1.07
1.24
0.86
0.87
1.11
1.09
0.90
0.92
1.03
1.16
0.88
0.90
1.10
Seasonal
Seasonal adjusted
Index
rate
0.88
0.64
1.08
0.65
1.18
0.68
0.87
0.65
0.88
0.65
1.08
0.69
1.18
0.74
0.87
0.69
0.88
0.67
1.08
0.69
1.18
0.62
0.87
0.69
0.88
0.70
1.08
0.66
1.18
0.69
0.87
0.72
0.88
0.75
1.08
0.78
1.18
0.74
0.87
0.77
16-26
Actual versus Deseasonalized Series
1
0.9
0.8
0.7
0.6
Rate
0.5
Seasonal adjusted rate
0.4
0.3
0.2
0.1
0
1
2
3
4
5
6
7
8
9 10 11 12 13 14 15 16 17 18 19 20
16-27
Seasonally Adjusted Forecast
(1) Obtain the linear equation using the deseasonalized data:
Ŷ= .6371+.0053t
(2) Use the linear equation to predict the dependent variable, rate.
(3) Use the predicted rate times the corresponding seasonal index to obtain
the seasonally adjusted forecast.
Quarterly Forecast for 2011
Estimated Seasonal
rat
Index
Quarterly
Forecast
Quarter
Period
1
21
0.75
0.88
0.66
2
22
0.75
1.08
0.81
3
23
0.76
1.18
0.89
4
24
0.76
0.87
0.67
Ŷ X SI = .76 X .87
Ŷ = .6371+ 0.0053(24)
16-28
Nonlinear Trends



A linear trend equation is used when the data
are increasing (or decreasing) by equal amounts
A nonlinear trend equation is used when the
data are increasing (or decreasing) by
increasing amounts over time
When data increase (or decrease) by equal
percents or proportions plot will show curvilinear
pattern
16-29
Log Trend Equation – Gulf Shores Importers
Example



Graph on right is
the log base 10 of
the original data
which now is linear
(Excel function:
=log(x) or log(x,10)
Using Data Analysis
in Excel, generate
the linear equation
Regression output
shown in next slide
16-30
Log Trend Equation – Gulf Shores Importers
Example
The Linear Equation is :

y  2.053805 0.153357t
16-31
Log Trend Equation – Gulf Shores Importers
Example
Estimate the Import f or the year 2014 using the linear trend

y  2.053805 0.153357t
Substitute into the linear equation above the code (19) f or 2014

y  2.053805 0.153357(19)

y  4.967588

Then f ind the antilog of y  10
^
Y
 104.967588
 92,809
16-32