ch. 19 time series and forecasting

45
1 Ch. 19 Time Series and Forecasting 時間數列分析與預測

Upload: others

Post on 06-Oct-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

PowerPoint Presentation
2
Outline
• What is a time series data? • What kinds of variation are in a time series data?
– Long term trend, circular variation, seasonal variation, irregular variation
• How to analyze a time series data? – Seasonal effects : seasonal indices – Long term trend : fit a linear/nonlinear model for trend
3
• A time series is a collection of time-dependent data. • There are 4 components to a time series :
– The long-term trend; – The cyclical variation; – The seasonal variation; – The irregular variation.
4
Secular trend : the smooth long-term direction
• Example. P652 • The number of employees at Home Depot, Inc. • The number has increased rapidly over the last 10 years.
5
Secular trend : the smooth long-term direction • Example. P652 The number of emergency medical service (EMS) calls in
Horry County, South Carolina, since 1989. • The number increased from 1989 to 1995. • From 1995 to 2000 the number of calls stayed about the same • In 2000 it began another increase.
6
Secular trend : the smooth long-term direction • Example. P652 The number of manufactured homes
shipped in USA showed a steady increase from 1990 to 1996, then remained about the same until 1999, when the number began to decline.
7
Cyclical variation : the rise and fall over periods longer than one year
• Example. P653 The number of batteries sold by National Battery Sales, Inc. from 1984 through 2003.
• Cyclical variation : recovery, prosperity, recession, depression.
8
Seasonal variation : patterns of change within a year • Example. Chart 19-2 The quarterly sales of Hercher Sporting Goods,
Inc. • Most of sales are in the 1st and 2nd quarters of the year. • Some business are during the holidays, the 4th quarter. • The late summer, the 3rd quarter, is slow season.
9
10
Data Analysis : a multiplicative model
• A multiplicative model : The time series data = T×C×S×I = (trend)×(cycle)×(season)×(residual)
• Data analysis : S Find the seasonal indexes
1. Roughly estimate T×C – by the moving-average method; 2. Estimate (S×I) = (Data)/(T×C); 3. Estimate the seasonal index S -- by simple average;
D De-seasonalize data = (Data)/S; T Fit long-term trend – The least squares method
• Linear trends • Nonlinear trends
11
1. Determine T×C • Goal :
– Estimate T×C = long-term variations, – Remove short-term variations, (S×I)
• Strategy : Moving-average method – Calculate 4-quarter moving averages : remove (S)/

– Center the moving averages : average of successive no.’s, remove (I)
12
Moving average method
• The moving average method : P655 – “Moving” the mean values through the time series. – If odd period:
Find the moving average and positioned in mid of the period. – If even period:
1. Find the moving average and positioned in mid of the period. 2. Center the moving averages and position on a particular date.
• Goals : – Smooth out the short-term fluctuations. – Identify the long-term trend. – If the duration is constant, and if the amplitudes() are equal,
the short-term fluctuations can be removed entirely.
13
What is a moving average method?
• Example. P655 Data = T×C×I, no seasonal effect • The cycle period = 7 years, the amplitude of each cycle is 4. • See Table 19-3 & Chart 19-5 P700 • 7-year moving average :
– Show the increasing long-term trend – The cyclical pattern vanished.
14
15
16
• Example. P657 Table 19-4 & Chart 19-6 • 3-year moving average; 5-year moving average.
17
18
19
Example. P669
Table 19-6 shows the quarterly sales for Toys International for 1996 through 2001. Determine a quarterly seasonal index using the ratio-to-moving average method.
The seasonal nature of the sales : the 4th quarter are the largest and the 2nd quarters are the smallest.
The long-term trend is moderately increased.
6
20
21
Example. P706
Step 1.1 Find the 4-quarter moving average and positioned between the quarters. See column (3) in Table 19-7
Step 1.2 Center the moving averages and position on a particular quarter. See column (4) in Table 19-7
→ (4) = (T×C) = long term effect
22
23
S step :
Step 2 Calculate the specific seasonal for each quarter (S×I) – (S×I)=(Data)/(the centered moving average)=(TCSI)/(TC)
• Example. P706, (1)/(4) =(5) = (S×I)
Step 3. S=? – Organize the specific seasonal indices – Take simple average to remove (I) over same season
25
Example. –Organize the specific seasonals in Table 19-8 –The mean is used for the seasonal index for each quarter.
S1 = 0.767, S2 = 0.576, S3 = 1.144, S4 = 1.522
-8
26
Step 4 Adjust the indexes to have sum 4. • Method :
– Calculate the correction factor = 4/(S1+S2+S3+S4) – The adjusted index = index × correction factor
• Example P672 – Since S1+S2+S3+S = 0.767+0.576+1.144+1.522 = 4.009 > 4.000 – The seasonal indices should be adjusted. – Correction factor = 4/(S1+S2+S3+S4)= 4/4.009=0.997755 – The adjusted quarterly indices are,
• S1 = 0.767×0.997755=0.765=76.5% • S2 = 0.576×0.997755=0.575=57.5% • S3 = 1.144×0.997755=1.141=114.1% • S4 = 1.522×0.997755=1.519=151.9%
27
• De-seasonalized data = seasonally adjusted data – The seasonal effect is removed. – The long-term fluctuations, the trend and cycle effects, are studied.
• Method : – De-seasonalized data = original data / seasonal index
28
D step : De-seasonalized data
• Example. Table on page 672 gives the de-seasonalized quarterly sales of Toys International in Table 19-7. – (1) = original data = (TSCI); – (2) = seasonal index = (S); – (3) = de-seasonalized sales = (TSCI)/(S) = (1)/(2). – See P 675 MINITAB output
29
30
31
• Establish a trend model with de-seasonalized data.
• Trend model – Linear trend models – Nonlinear trend models
• Trend model -- Linear trends : – Linear equation : Y’ = a + b× t – Y’ = predicted value, t = coded values of time – Recall the least square estimations for (a, b) – Then b = increment per unit time.
32
Example. P675 Establish a trend model
• Trend model : Linear trend equation : Y’ = a + b t • The time is coded as t=1 from the winter quarter of 1996. • Then the LSE : a = 8.1096, b = 0.0899 • The trend equation : Y’ = 8.1096 + 0.0899 t • Over the 24 quarters the de-seasonalized sales increased at
a rate of 0.0899 per quarter.
33
34
35
F step : Forecast
• Forecast : – Forecast the trend effect in the future with the trend model – Adjust the trend values to account for the seasonal factors.
• Method : – A predicted equation is Y’ = g(t), then at time t0, calculate
Y’ = g(t0) = trend effect – Seasonally adjusted as Y’ ×S
36
F step : Forecast • Example. P677 • If we assume that the past 24 periods are a good indicator of future
sales, the trend equation can be used in forecast. • For the winter quarter of 2002, t=25, the estimated sales total is
Y’ = 8.1096+0.0899(25)=10.3571 • The forecast is then seasonally adjusted by Y’×S • See Table 19-12 : forecast for the 4 quarters of 2002.
Y’×SY’ = 8.1096+0.0899t
• Log trend equation : – – Then
– Increase/decrease by equal percents over a period. –
tabY =
×+= =
• Log trend equation :
– Fit a linear model with data (t, y*=log(y)) – Then
tlog(b) log(a) )Ylog( ×+=
Example. P665 Charter 19-7
• Data : sales for the Gulf Shores importers from 1988 to 2002 Year Imports log(Y)=log(imports) Code(t)
1988 124.2 2.0941 1 1989 175.6 2.2445 2
1990 306.9 2.4870 3
1991 524.2 2.7195 4
1992 714.0 2.8537 5
1993 1052.0 3.0220 6
1994 1638.3 3.2144 7
1995 2463.2 3.3915 8
1996 3358.2 3.5261 9
1997 4181.3 3.6213 10
1998 5388.5 3.7315 11
1999 8027.4 3.9046 12
2000 10587.2 4.0248 13
2001 13537.4 4.1315 14
2002 17515.6 4.2434 15
0.0
5000.0
10000.0
15000.0
20000.0
Y’
41
Log(Y’)
0.0000
2.0000
4.0000
6.0000
Y*=log(Y’)
42
Example. P666 Charter 19-7
• Step 1. Find the log base 10 of each year’s imports • Step 2. Find the LSE with data (t, log(y))=(t, y*).
– a*=Log(a)=2.0538, b*=Log(b)=0.1534. – Log(Y’) = 2.0538 + 0.1534t.
• The antilog of 0.1534 is b=100.1534 = 1.4235 • Then 1.4235-1=0.4235 is the geometric mean rate of
increase from 1988 to 2002. • The annually increased rate is 42.35% during the period.
43

1 6.5852 6.5852 1065.228 7.36E-14
13 0.0804 0.0062
2.0538 0.0427 48.0741 4.98E-16 1.9615 2.1461
Code(t) 0.1534 0.0047 32.6378 7.36E-14 0.1432 0.1635
44
Example. P667 Charter 19-7
• Forecast the imports in the year 2006, t=15+4=19?
000,809,9210Y
97.4191534.00538.2Y
19415t
97.4
45
Exercise
• Seasonal indices : 25, 27 • Seasonal indices, long-term trend, prediction : 27, 31
Ch. 19 Time Series and Forecasting
Outline
Secular trend : the smooth long-term direction
Secular trend : the smooth long-term direction
Cyclical variation : the rise and fall over periods longer than one year
Seasonal variation : patterns of change within a year
Irregular variation : residual
S step : The Typical Seasonal Index : ratio-to-moving-average method
Moving average method
What about 4-year moving average? Even period, centered again!
Example. P669
Example. P706
S step :
S step :
F step : Forecast
F step : Forecast
How to fit a log trend model?
Example. P665 Charter 19-7
Example. P666 Charter 19-7
Example. P667 Charter 19-7