統計學 spring 2004
DESCRIPTION
統計學 Spring 2004. 授課教師:統計系余清祥 日期:2004年6月 1 日 第十五週:預測. Chapter 18 Forecasting. Time Series and Time Series Methods Components of a Time Series Smoothing Methods Trend Projection Trend and Seasonal Components Regression Analysis - PowerPoint PPT PresentationTRANSCRIPT
1 1 Slide Slide
統計學 Spring 2004
授課教師:統計系余清祥 日期: 2004 年 6 月 1 日 第十五週:預測
2 2 Slide Slide
Chapter 18Chapter 18ForecastingForecasting
Time Series and Time Series MethodsTime Series and Time Series Methods Components of a Time SeriesComponents of a Time Series Smoothing MethodsSmoothing Methods Trend ProjectionTrend Projection Trend and Seasonal ComponentsTrend and Seasonal Components Regression AnalysisRegression Analysis Qualitative Approaches to ForecastingQualitative Approaches to Forecasting
3 3 Slide Slide
Time Series and Time Series MethodsTime Series and Time Series Methods
By reviewing historical data over time, we can By reviewing historical data over time, we can better understand the pattern of past behavior better understand the pattern of past behavior of a variable and better predict the future of a variable and better predict the future behavior.behavior.
A A time seriestime series is a set of observations on a is a set of observations on a variable measured over successive points in variable measured over successive points in time or over successive periods of time.time or over successive periods of time.
The objective of time series methods is to The objective of time series methods is to discover a pattern in the historical data and then discover a pattern in the historical data and then extrapolate the pattern into the future.extrapolate the pattern into the future.
The forecast is based solely on past values of The forecast is based solely on past values of the variable and/or past forecast errors.the variable and/or past forecast errors.
4 4 Slide Slide
The Components of a Time SeriesThe Components of a Time Series
Trend ComponentTrend Component
• It represents a gradual shifting of a time It represents a gradual shifting of a time series to relatively higher or lower values over series to relatively higher or lower values over time.time.
• Trend is usually the result of changes in the Trend is usually the result of changes in the population, demographics, technology, and/or population, demographics, technology, and/or consumer preferences.consumer preferences.
Cyclical ComponentCyclical Component
• It represents any recurring sequence of points It represents any recurring sequence of points above and below the trend line lasting more above and below the trend line lasting more than one year.than one year.
• We assume that this component represents We assume that this component represents multiyear cyclical movements in the economy.multiyear cyclical movements in the economy.
5 5 Slide Slide
Seasonal ComponentSeasonal Component
• It represents any repeating pattern, less than It represents any repeating pattern, less than one year in duration, in the time series.one year in duration, in the time series.
• The pattern duration can be as short as an hour, The pattern duration can be as short as an hour, or even less. or even less.
Irregular ComponentIrregular Component
• It is the “catch-all” factor that accounts for the It is the “catch-all” factor that accounts for the deviation of the actual time series value from deviation of the actual time series value from what we would expect based on the other what we would expect based on the other components.components.
• It is caused by the short-term, unanticipated, It is caused by the short-term, unanticipated, and nonrecurring factors that affect the time and nonrecurring factors that affect the time series.series.
The Components of a Time SeriesThe Components of a Time Series
6 6 Slide Slide
Forecast AccuracyForecast Accuracy
Mean Squared Error (MSE)Mean Squared Error (MSE)
• It is the average of the sum of all the squared It is the average of the sum of all the squared forecast errors.forecast errors.
Mean Absolute Deviation (MAD)Mean Absolute Deviation (MAD)
• It is the average of the absolute values of all It is the average of the absolute values of all the forecast errors.the forecast errors.
One major difference between MSE and MAD is One major difference between MSE and MAD is thatthat
the MSE measure is influenced much more by largethe MSE measure is influenced much more by large
forecast errors than by small errors.forecast errors than by small errors.
7 7 Slide Slide
Moving AveragesMoving Averages
• We use the average of the most recentWe use the average of the most recent n n data values in the time series as the data values in the time series as the forecast for the next period.forecast for the next period.
• The average changes, or moves, as new The average changes, or moves, as new observations become available.observations become available.
• The moving average calculation isThe moving average calculation is
Moving Average = Moving Average = (most recent (most recent nn data data values)/values)/nn
Using Smoothing Methods in ForecastingUsing Smoothing Methods in Forecasting
8 8 Slide Slide
Weighted Moving AveragesWeighted Moving Averages
• This method involves selecting weights for This method involves selecting weights for each of the data values and then computing each of the data values and then computing a weighted mean as the forecast.a weighted mean as the forecast.
• For example, a 3-period weighted moving For example, a 3-period weighted moving average would be computed as follows.average would be computed as follows.
FFtt + 1 + 1 = = ww11((YYtt - 2 - 2) + ) + ww22((YYtt - 1 - 1) + ) + ww33((YYtt) )
where the sum of the weights (where the sum of the weights (w w values) values) is 1.is 1.
Using Smoothing Methods in ForecastingUsing Smoothing Methods in Forecasting
9 9 Slide Slide
Using Smoothing Methods in ForecastingUsing Smoothing Methods in Forecasting
Exponential SmoothingExponential Smoothing
• It is a special case of the weighted moving It is a special case of the weighted moving averages method in which we select only averages method in which we select only the weight for the most recent observation.the weight for the most recent observation.
• The weight placed on the most recent The weight placed on the most recent observation is the value of the observation is the value of the smoothing smoothing constantconstant, , ..
• The weights for the other data values are The weights for the other data values are computed automatically and become computed automatically and become smaller at an exponential rate as the smaller at an exponential rate as the observations become older. observations become older.
10 10 Slide Slide
Using Smoothing Methods in ForecastingUsing Smoothing Methods in Forecasting
Exponential SmoothingExponential Smoothing
FFtt + 1 + 1 = = YYt t + (1 - + (1 - ))FFtt
where where FFtt + 1 + 1 = forecast value for period = forecast value for period tt + 1 + 1
YYtt = actual value for period = actual value for period tt + + 11
FFtt = forecast value for period = forecast value for period tt
= smoothing constant (0 = smoothing constant (0 << << 1) 1)
11 11 Slide Slide
Example: Executive Seminars, Inc.Example: Executive Seminars, Inc.
Executive Seminars specializes in conductingExecutive Seminars specializes in conducting
management development seminars. In order to management development seminars. In order to betterbetter
plan future revenues and costs, management plan future revenues and costs, management would likewould like
to develop a forecasting model for their “Timeto develop a forecasting model for their “Time
Management” seminar.Management” seminar.
Enrollments for the past ten “TM” seminars are:Enrollments for the past ten “TM” seminars are:
(oldest)(oldest) (newest) (newest)
SeminarSeminar 11 22 33 44 55 66 77 88 99 1010
Enroll. Enroll. 3434 4040 3535 3939 4141 3636 3333 3838 4343 4040
12 12 Slide Slide
Example: Executive Seminars, Inc.Example: Executive Seminars, Inc.
Exponential SmoothingExponential Smoothing
Let Let = .2, = .2, FF1 1 = = YY1 1 = 34= 34
FF2 2 = = YY11 + (1 - + (1 - ))FF11
= .2(34) + .8(34)= .2(34) + .8(34) = 34= 34
FF3 3 = = YY22 + (1 - + (1 - ))FF22
= .2(40) + .8(34)= .2(40) + .8(34) = 35.20= 35.20
FF4 4 = = YY33 + (1 - + (1 - ))FF33
= .2(35) + .8(35.20)= .2(35) + .8(35.20) = 35.16 = 35.16
. . . and so on. . . and so on
13 13 Slide Slide
Example: Executive Seminars, Inc.Example: Executive Seminars, Inc.
SeminarSeminar Actual EnrollmentActual Enrollment Exp. Sm. Exp. Sm. ForecastForecast
11 3434 34.0034.0022 4040 34.0034.0033 3535 35.2035.2044 3939 35.1635.1655 4141 35.9335.9366 3636 36.9436.9477 3333 36.7636.7688 3838 36.0036.0099 4343 36.4036.401010 4040 37.7237.721111 Forecast for the next seminarForecast for the next seminar = =
38.1838.18
14 14 Slide Slide
Equation for Linear TrendEquation for Linear Trend
TTtt = = bb00 + + bb11tt
wherewhere
TTtt = trend value in period = trend value in period tt
bb00 = intercept of the trend line = intercept of the trend line
bb1 1 = slope of the trend line= slope of the trend line
tt = time= time
Note: Note: tt is the independent variable. is the independent variable.
Using Trend Projection in ForecastingUsing Trend Projection in Forecasting
15 15 Slide Slide
Computing the Slope (Computing the Slope (bb11) and Intercept () and Intercept (bb00))
bb11 = = tYtYtt - ( - (t t YYtt)/)/nn
t t 22 - ( - (t t ))22//nn
bb00 = (= (YYtt//nn) - ) - bb11tt//n n = = YY - - bb11tt
wherewhere
YYtt = actual value in period= actual value in period t t
n = n = number of periods in time number of periods in time seriesseries
Using Trend Projection in ForecastingUsing Trend Projection in Forecasting
16 16 Slide Slide
Example: Sailboat Sales, Inc.Example: Sailboat Sales, Inc.
Sailboat Sales is a major marine dealer in Sailboat Sales is a major marine dealer in Chicago. The firm has experienced Chicago. The firm has experienced tremendous sales growth in the past several tremendous sales growth in the past several years. Management would like to develop a years. Management would like to develop a forecasting method that would enable them to forecasting method that would enable them to better control inventories.better control inventories.
The annual sales, in number of boats, for The annual sales, in number of boats, for one particular sailboat model for the past five one particular sailboat model for the past five years are:years are:
YearYear 11 22 33 44 55
SalesSales 1111 1414 2020 2626 3434
17 17 Slide Slide
Linear Trend EquationLinear Trend Equation
tt YYtt tYtYtt t t 22
11 1111 1111 1 1
22 1414 2828 4 4
33 2020 6060 9 9
44 2626 104104 1616
55 3434 170170 2525
TotalTotal 1515 105105 373373 5555
Example: Sailboat Sales, Inc.Example: Sailboat Sales, Inc.
18 18 Slide Slide
Trend ProjectionTrend Projection
bb1 1 = 373 - (15)(105)/5 = 5.8 = 373 - (15)(105)/5 = 5.8
55 - (15)55 - (15)22/5/5
bb00 = 105/5 - 5.8(15/5) = 3.6 = 105/5 - 5.8(15/5) = 3.6
TTtt = 3.6 + 5.8 = 3.6 + 5.8tt
TT66 = 3.6 + 5.8(6) = 38.4 = 3.6 + 5.8(6) = 38.4
Example: Sailboat Sales, Inc.Example: Sailboat Sales, Inc.
19 19 Slide Slide
Trend and Seasonal ComponentsTrend and Seasonal Componentsin Forecastingin Forecasting
Multiplicative ModelMultiplicative Model Calculating the Seasonal IndexesCalculating the Seasonal Indexes Deseasonalizing the Time SeriesDeseasonalizing the Time Series Using the Deseasonalizing Time SeriesUsing the Deseasonalizing Time Series
to Identify Trendto Identify Trend Seasonal AdjustmentsSeasonal Adjustments Cyclical ComponentCyclical Component
20 20 Slide Slide
Multiplicative ModelMultiplicative Model
Using Using TTt t , , SSt t , and , and IItt to identify the trend, seasonal, to identify the trend, seasonal, and irregular components at time and irregular components at time tt, we describe , we describe the time series value the time series value YYt t by the following by the following multiplicative time series modelmultiplicative time series model::
YYtt = = TTtt xx SStt xx IItt
TTtt is measured in units of the item being forecast.is measured in units of the item being forecast.
SStt and and IItt are measured in relative terms, with are measured in relative terms, with values above 1.00 indicating effects above the values above 1.00 indicating effects above the trend and values below 1.00 indicating effects trend and values below 1.00 indicating effects below the trend.below the trend.
21 21 Slide Slide
Calculating the Seasonal IndexesCalculating the Seasonal Indexes
1. 1. Compute a series of Compute a series of n n -period centered -period centered moving averages, where moving averages, where n n is the number of is the number of seasons in the time series.seasons in the time series.
2. If 2. If nn is an even number, compute a series of is an even number, compute a series of 2-period centered moving averages.2-period centered moving averages.
3. Divide each time series observation by the 3. Divide each time series observation by the corresponding centered moving average to corresponding centered moving average to identify the seasonal-irregular effect in the identify the seasonal-irregular effect in the time series.time series.
4. For each of the 4. For each of the nn seasons, average all the seasons, average all the computed seasonal-irregular values for that computed seasonal-irregular values for that season to eliminate the irregular influence and season to eliminate the irregular influence and obtain an estimate of the seasonal influence, obtain an estimate of the seasonal influence, called the called the seasonal indexseasonal index, for that season., for that season.
22 22 Slide Slide
Deseasonalizing the Time SeriesDeseasonalizing the Time Series
The purpose of finding seasonal indexes is to The purpose of finding seasonal indexes is to remove the seasonal effects from the time remove the seasonal effects from the time series.series.
This process is called This process is called deseasonalizingdeseasonalizing the time the time series.series.
By dividing each time series observation by By dividing each time series observation by the corresponding seasonal index, the result is the corresponding seasonal index, the result is a deseasonalized time series.a deseasonalized time series.
With deseasonalized data, relevant With deseasonalized data, relevant comparisons can be made between comparisons can be made between observations in successive periods.observations in successive periods.
23 23 Slide Slide
Using the Deseasonalizing Time SeriesUsing the Deseasonalizing Time Seriesto Identify Trendto Identify Trend
To identify the linear trend, we use the linear To identify the linear trend, we use the linear regression procedure covered earlier; in this regression procedure covered earlier; in this case, the data are the deseasonalized time case, the data are the deseasonalized time series values.series values.
In other words, In other words, YYtt now refers to the now refers to the deseasonalized time series value at time deseasonalized time series value at time tt and and not to the actual value of the time series.not to the actual value of the time series.
The resulting line equation is used to make The resulting line equation is used to make trend projections, as it was earlier.trend projections, as it was earlier.
24 24 Slide Slide
Seasonal AdjustmentsSeasonal Adjustments
The final step in developing the forecast is to The final step in developing the forecast is to use the seasonal index to adjust the trend use the seasonal index to adjust the trend projection.projection.
The forecast for period The forecast for period tt, season , season ss, is obtained , is obtained by multiplying the trend projection for periodby multiplying the trend projection for period t t by the seasonal index for season by the seasonal index for season ss..
YYt,st,s = = IIss[[bb00 + + bb11((t t )])]
25 25 Slide Slide
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
Management of EAS would like to develop aManagement of EAS would like to develop a
quarterly sales forecast for one of their tennis quarterly sales forecast for one of their tennis rackets. rackets.
Sales of tennis rackets is highly seasonal and Sales of tennis rackets is highly seasonal and hence anhence an
accurate quarterly forecast could aid accurate quarterly forecast could aid substantially insubstantially in
ordering raw material used in manufacturing.ordering raw material used in manufacturing.
The quarterly sales data (000 units) for the The quarterly sales data (000 units) for the previousprevious
three years is shown on the next slide.three years is shown on the next slide.
26 26 Slide Slide
Year QuarterYear Quarter SalesSales 11 1 1 33
22 99 33 66 44 22
22 1 1 44 22 1111 33 88 44 33
33 1 1 55 22 1515 33 1111 44 33
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
27 27 Slide Slide
YearYearQuarterQuarterSalesSales 4-CMA4-CMA 2-CMA 2-CMA11 11 33
22 995.005.00
33 665.255.25
5.135.13
44 225.755.75
5.505.50
22 11 446.256.25
6.006.00
22 11116.506.50
6.386.38
33 886.756.75
6.636.63
44 337.757.75
7.257.25
33 11 558.508.50
8.138.13
22 15158.508.50
8.508.50
33 111144 33
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
28 28 Slide Slide
YearYear QuarterQuarter Sales 2-CMASales 2-CMA Seas- Seas-IrregIrreg
11 11 3322 9933 66 5.135.13 1.171.1744 22 5.505.50 0.360.36
22 11 44 6.006.00 0.670.6722 1111 6.386.38 1.721.7233 88 6.636.63 1.211.2144 33 7.257.25 0.410.41
33 11 55 8.138.13 0.620.6222 1515 8.508.50 1.761.7633 111144 33
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
29 29 Slide Slide
QuarterQuarterSeas-Irreg ValuesSeas-Irreg ValuesSeas. IndexSeas. Index11 0.67, 0.620.67, 0.62 0.650.6522 1.72, 1.761.72, 1.76 1.741.7433 1.17, 1.211.17, 1.21 1.191.1944 0.36, 0.410.36, 0.41 0.390.39 Total =Total =
3.973.97
Seas.IndexSeas.Index Adj. Factor Adj. FactorAdj.Seas.IndexAdj.Seas.Index0.650.65 4/3.97 4/3.97 .655 .655 1.741.74 4/3.97 4/3.97 1.7531.753
1.191.19 4/3.97 4/3.97 1.1991.1990.390.39 4/3.97 4/3.97 .393.393
Total = 4.000 Total = 4.000
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
30 30 Slide Slide
YearYearQuarterQuarterSalesSalesSeas.IndexSeas.Index Deseas.SalesDeseas.Sales
11 11 33 .655.655 4.58 4.5822 99 1.7531.753 5.13 5.1333 66 1.1991.199 5.00 5.0044 22 .393.393 5.09 5.09
22 11 44 .655.655 6.11 6.1122 1111 1.7531.753 6.27 6.2733 88 1.1991.199 6.67 6.6744 33 .393.393 7.63 7.63
33 11 55 .655.655 7.63 7.6322 1515 1.7531.753 8.56 8.5633 1111 1.1991.199 9.17 9.1744 33 .393.393 7.63 7.63
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
31 31 Slide Slide
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
Trend ProjectionTrend Projection
TTtt = 4.066 + .3933 = 4.066 + .3933tt
TT1313 = 4.066 + .3993(13) = 9.1789 = 4.066 + .3993(13) = 9.1789
Using the trend component only, Using the trend component only, we would we would forecast sales of 9,179 tennis rackets forecast sales of 9,179 tennis rackets for for period 13 (year 4, quarter 1).period 13 (year 4, quarter 1).
32 32 Slide Slide
Example: Eastern Athletic SuppliesExample: Eastern Athletic Supplies
Seasonal AdjustmentsSeasonal Adjustments
PeriodPeriod TrendTrend SeasonalSeasonal QuarterlyQuarterly
tt Forec. Forec. IndexIndex Forecast Forecast
13 9,17913 9,179 .655 .655 6,012 6,012
14 9,57214 9,572 1.753 1.753 16,78016,780
15 9,96615 9,966 1.199 1.199 11,94911,949
1616 10,35910,359 .393 .393 4,071 4,071
33 33 Slide Slide
Models Based on Monthly DataModels Based on Monthly Data
Many businesses use monthly rather than Many businesses use monthly rather than quarterly forecasts.quarterly forecasts.
The preceding procedures can be applied with The preceding procedures can be applied with minor modifications:minor modifications:
• A 12-month moving average replaces the 4-A 12-month moving average replaces the 4-quarter moving average.quarter moving average.
• 12 monthly, rather than 4 quarterly, 12 monthly, rather than 4 quarterly, seasonal indexes must be computed.seasonal indexes must be computed.
• Otherwise, the procedures are identical.Otherwise, the procedures are identical.
34 34 Slide Slide
The multiplicative model can be expanded to The multiplicative model can be expanded to include a cyclical component that is expressed include a cyclical component that is expressed as a percentage of trend.as a percentage of trend.
However, there are difficulties in including a However, there are difficulties in including a cyclical component:cyclical component:
• A cycle can span several (many) years and A cycle can span several (many) years and enough data must be obtained to estimate enough data must be obtained to estimate the cyclical component.the cyclical component.
• Cycles usually vary in length.Cycles usually vary in length.
Cyclical ComponentCyclical Component
t t t t tY T C S I t t t t tY T C S I
35 35 Slide Slide
Regression AnalysisRegression Analysis
One or more independent variables can be One or more independent variables can be used to predict the value of a single used to predict the value of a single dependent variable.dependent variable.
The time series value that we want to forecast The time series value that we want to forecast is the dependent variable.is the dependent variable.
The independent variable(s) might include any The independent variable(s) might include any combination of the following:combination of the following:
• Previous values of the time series variable Previous values of the time series variable itselfitself
• Economic/demographic variablesEconomic/demographic variables
• Time variablesTime variables
36 36 Slide Slide
Regression AnalysisRegression Analysis
An An autoregressive modelautoregressive model is a regression model is a regression model in which the independent variables are in which the independent variables are previous values of the time series being previous values of the time series being forecast.forecast.
A A causal forecasting modelcausal forecasting model uses other time uses other time series related to the one being forecast in an series related to the one being forecast in an effort to explain the cause of a time series’ effort to explain the cause of a time series’ behavior.behavior.
37 37 Slide Slide
Regression AnalysisRegression Analysis
For a function involving For a function involving kk independent variables, independent variables, we use the following notation:we use the following notation:
YYtt = value of the time series in period = value of the time series in period tt
xx11tt = value of independent variable 1 in period = value of independent variable 1 in period tt
xx22tt = value of independent variable 2 in period = value of independent variable 2 in period tt
xxktkt = value of independent variable = value of independent variable kk in period in period tt
38 38 Slide Slide
Regression AnalysisRegression Analysis
In forecasting sales of refrigerators, we might In forecasting sales of refrigerators, we might select the following five independent variables:select the following five independent variables:
xx11tt = price of refrigerator in period = price of refrigerator in period tt
xx22tt = total industry sales in period = total industry sales in period tt - 1 - 1
xx33tt = number of new-house building = number of new-house building permits permits in period in period tt - 1 - 1
xx44tt = population forecast for period = population forecast for period tt
xx55tt = advertising budget for period = advertising budget for period tt
39 39 Slide Slide
Regression AnalysisRegression Analysis
The The nn periods of data necessary to develop the estimated periods of data necessary to develop the estimated regression equation would appear as:regression equation would appear as:
PeriodPeriod Time Series Value of Independent Variables Time Series Value of Independent Variables
((tt)) ((YYtt)) ( (xx11tt) () (xx22tt) () (xx33tt) . . () . . (xxktkt))
11 YY11 xx1111 xx2121 xx3131 . . . . xxkk11
22 YY22 xx1212 xx2222 xx3232 . . . . xxkk22
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
nn Y Ynn x x11nn xx22nn xx33nn . . . . xxknkn
40 40 Slide Slide
Qualitative Approaches to ForecastingQualitative Approaches to Forecasting
Delphi MethodDelphi Method
• It is an attempt to develop forecasts It is an attempt to develop forecasts through “group consensus.”through “group consensus.”
• The goal is to produce a relatively narrow The goal is to produce a relatively narrow spread of opinions within which the majority spread of opinions within which the majority of the panel of experts concur.of the panel of experts concur.
Expert JudgmentExpert Judgment
• Experts individually consider information Experts individually consider information that they believe will influence the variable; that they believe will influence the variable; then they combine their conclusions into a then they combine their conclusions into a forecast.forecast.
• No two experts are likely to consider the No two experts are likely to consider the same information in the same way.same information in the same way.
41 41 Slide Slide
Qualitative Approaches to ForecastingQualitative Approaches to Forecasting
Scenario WritingScenario Writing• This procedure involves developing several This procedure involves developing several
conceptual scenarios, each based on a well-conceptual scenarios, each based on a well-defined set of assumptions.defined set of assumptions.
• The decision maker must decide how likely The decision maker must decide how likely each scenario is and then make decisions each scenario is and then make decisions accordingly.accordingly.
Intuitive ApproachesIntuitive Approaches• A committee or panel seeks to develop new A committee or panel seeks to develop new
ideas or solve complex problems through a ideas or solve complex problems through a series of “brainstorming sessions.”series of “brainstorming sessions.”
• Individuals are free to present any idea Individuals are free to present any idea without being concerned about criticism or without being concerned about criticism or relevancy.relevancy.
42 42 Slide Slide
End of Chapter 18End of Chapter 18