Lesson 4 - Part B Forecasting
description
Transcript of Lesson 4 - Part B Forecasting
Lesson 4 - Part BForecasting
• Trend Projection
• Trend and Seasonal Components
• Regression Analysis
Forecasting Methods
ForecastingForecastingMethodsMethods
ForecastingForecastingMethodsMethods
QuantitativeQuantitativeQuantitativeQuantitative QualitativeQualitativeQualitativeQualitative
CausalCausalCausalCausal Time SeriesTime SeriesTime SeriesTime Series
SmoothingSmoothingSmoothingSmoothing TrendTrendProjectionProjection
TrendTrendProjectionProjection
Trend ProjectionTrend ProjectionAdjusted forAdjusted for
Seasonal InfluenceSeasonal Influence
Trend ProjectionTrend ProjectionAdjusted forAdjusted for
Seasonal InfluenceSeasonal Influence
Trend Projection• If a time series exhibits a linear trend, the method
of least squares may be used to determine a trend line (projection) for future forecasts.
• Least squares, also used in regression analysis, determines the unique trend line forecast which minimizes the mean square error between the trend line forecasts and the actual observed values for the time series.
• The independent variable is the time period and the dependent variable is the actual observed value in the time series.
Trend Projection
• Using the method of least squares, the formula for the trend projection is:
where: Tt = trend forecast for time period t
b1 = slope of the trend line
b0 = trend line projection for time 0
TTtt = = bb00 + + bb11tt
Trend Projection
• For the trend projection equation Tt = b0 + b1t
0 1b Y b t 0 1b Y b t
tt= average time period for the = average time period for the nn observations observations
YY= average of the observed values for = average of the observed values for YYtt
1 2 2
( )/
( ) /t ttY t Y n
bt t n
1 2 2
( )/
( ) /t ttY t Y n
bt t n
where: where: YYtt = observed value of the time series at time = observed value of the time series at time period period tt
The number of plumbing repair jobs performedby Auger's Plumbing Service in each of thelast nine months is listed on the nextslide. Forecast the number of repairjobs Auger's will perform in Decemberusing the least squares method.
Trend Projection• Example: Auger’s Plumbing Service
Trend Projection
• Example: Auger’s Plumbing Service
MonthMonth JobsJobs
March 353March 353
May 342May 342April 387April 387
July 396July 396June 374June 374
August 409August 409
September 399September 399
October 412October 412
November 408November 408
MonthMonth JobsJobs
Months
Jobs
NovOctSepAugJulJunMayAprMar
420
410
400
390
380
370
360
350
340
Time Series Plot of Jobs
Although this graph shows some up and down movement over the past 9 months, the time series seems to have an overall increasingor upward trend.
Trend Projection
Sum 45 3480 17844 285Sum 45 3480 17844 285
(Nov.) 9 408 3672 81(Nov.) 9 408 3672 81(Oct.) 8 412 3296 64(Oct.) 8 412 3296 64(Sep.) 7 399 2793 49(Sep.) 7 399 2793 49(Aug.) 6 409 2454 36(Aug.) 6 409 2454 36(July) 5 396 1980 25(July) 5 396 1980 25(June) 4 374 1496 16(June) 4 374 1496 16(May) 3 342 1026 9(May) 3 342 1026 9(Apr.) 2 387 774 4(Apr.) 2 387 774 4(Mar.) 1 353 353 1(Mar.) 1 353 353 1
(month) (month) tt YYtt tYtYtt t t 22
T10 = 349.667 + (7.4)(10) = 423.667
3480/ 9 386.667Y 3480/ 9 386.667Y 45/ 9 5t 45/ 9 5t
Trend Projection
1 2 2 2
( )/ (9)(17844) (45)(3480)7.4
( ) / (9)(285) (45)t ttY t Y n
bt t n
1 2 2 2
( )/ (9)(17844) (45)(3480)7.4
( ) / (9)(285) (45)t ttY t Y n
bt t n
0 1 386.667 7.4(5) 349.667b Y b t 0 1 386.667 7.4(5) 349.667b Y b t
Forecast for December (Month 10) using a
three-period (n = 3) weighted moving
average with weights of .6, .3, and .1
for the newest to oldest data, respec-
tively. Then, compare this Month 10
weighted moving average forecast with
the Month 10 trend projection forecast.
• Example: Auger’s Plumbing Service
Trend Projection
• Three-Month Weighted Moving Average
Trend Projection
FF1010 = 423.7 (from earlier slide) = 423.7 (from earlier slide)• Trend Projection
FF1010 = .1 = .1YYSep.Sep. + .3 + .3YYOct.Oct. + .6 + .6YYNov.Nov.
= .1(399) + .3(412) + .6(408) = .1(399) + .3(412) + .6(408)
= 408.3= 408.3
The forecast for December will be the weightedThe forecast for December will be the weightedaverage of the preceding three months: September,average of the preceding three months: September,October, and November.October, and November.
Due to the positive trend component in the time series, the trend projection produced a forecast that is more in tune with the trend that exists. The weighted moving average, even with heavy (.6) weight placed on the current period, produced a forecast that is lagging behind the changing data.
• Conclusion
Trend Projection
Using MINITAB for trend projections
# of future forecasts needed # of data points
Dependentvariable
Can use different types of trend models
Months
Jobs
DecNovOctSepAugJulJunMayAprMar
430
420
410
400
390
380
370
360
350
340
Accuracy MeasuresMAPE 2.948MAD 11.096MSD 204.267
Variable
Forecasts
ActualFits
Trend Analysis Plot for JobsLinear Trend Model
Yt = 349.667 + 7.4*t
Interpretation of slope coefficient:In every month, # of repair jobs undertaken increased by 7.4, on average.
Obtaining detailed MINITAB output
Trend Analysis for Jobs
Fitted Trend Equation
Yt = 349.667 + 7.4*t
Time Jobs Trend Detrend(Jobs – Trend)
1 353 357.067 -4.0667
2 387 364.467 22.5333
3 342 371.867 -29.8667
4 374 379.267 -5.2667
5 396 386.667 9.3333
6 409 394.067 14.9333
7 399 401.467 -2.4667
8 412 408.867 3.1333
9 408 416.267 -8.2667
Forecasts
Period Forecast
10 423.667
Removing trend effect from a time series
Forecasting with Trend and Seasonal Components
Steps of Multiplicative Time Series Model
1. Calculate the centered moving averages (CMAs).
2. Center the CMAs on integer-valued periods.
3. Determine the seasonal and irregular factors (St It ).
4. Determine the average seasonal factors.
5. Scale the seasonal factors (St ).
6. Determine the deseasonalized data.
7. Determine a trend line of the deseasonalized data.
8. Determine the deseasonalized predictions.
9. Take into account the seasonality.
Business at Terry's Tie Shop can beviewed as falling into three distinctseasons: (1) Christmas (November andDecember); (2) Father's Day (late May tomid June); and (3) all other times. Average weekly sales ($) during each of the threeseasons during the past four years are shown onthe next slide.
Forecasting with Trend and Seasonal Components
• Example: Terry’s Tie Shop
• Example: Terry’s Tie Shop
Forecasting with Trend and Seasonal Components
Determine a forecast for the average weeklyDetermine a forecast for the average weekly
sales in year 5 for each of the three seasons.sales in year 5 for each of the three seasons.
YearYearSeasonSeason
11 22 33 1856 2012 9851856 2012 9851995 2168 10721995 2168 10722241 2306 11052241 2306 11052280 2408 11202280 2408 1120
11223344
Year/ Season
Sale
s
321321321321
2400
2200
2000
1800
1600
1400
1200
1000
Time Series Plot of Sales
•In every year sales are lowest in season 3 and sales are increased inseasons 1 and 2. Thus, a seasonal pattern exits for these sales.
•Also, it seems overall sales are increasing (on average) over theseyears. Thus, a trend exits for these sales.
Forecasting with Trend and Seasonal Components
22ndnd CMA = (2012 + 985 + 1995)/3 = 1664.00 CMA = (2012 + 985 + 1995)/3 = 1664.00
11stst CMA = (1856 + 2012 + 985)/3 = 1617.67 CMA = (1856 + 2012 + 985)/3 = 1617.67
Step 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. For example:
Etc.Etc.
Forecasting with Trend and Seasonal Components
Step 2. Center the CMAs on integer-valued periods.
The first centered 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 is an odd number.
If n is even, we have to compute the average of consecutive moving averages to get centered moving averages.
Forecasting with Trend and Seasonal Components
YearYear SeasonSeasonDollarDollar
Sales (Sales (YYtt))MovingMovingAverageAverage
11
22
33
44
112233112233112233112233
(1856 + 2012 + (1856 + 2012 + 985)/3985)/3
1664.001664.001716.001716.001745.001745.001827.001827.001873.001873.001884.001884.001897.001897.001931.001931.001936.001936.00
1617.671617.67
199199552162168810710722
1851856620120122 985985224224112302306611011055
228228002402408811211200
Using MINITAB to get centered moving averages
You can specify this i.e. 4, 6, 12, … & its depend on the problem
Centered Moving Average for Sales
Moving Average: Length 3
Time Sales CMA Predict Error
1 1856 * * *
2 2012 1617.67 * *
3 985 1664.00 * *
4 1995 1716.00 1617.67 377.333
5 2168 1745.00 1664.00 504.000
6 1072 1827.00 1716.00 -644.000
7 2241 1873.00 1745.00 496.000
8 2306 1884.00 1827.00 479.000
9 1105 1897.00 1873.00 -768.000
10 2280 1931.00 1884.00 396.000
11 2408 1936.00 1897.00 511.000
12 1120 * 1931.00 -811.000
Year/ Season
Sale
s
321321321321
2400
2200
2000
1800
1600
1400
1200
1000
Moving AverageLength 3
Accuracy MeasuresMAPE 36MAD 554MSD 328008
VariableActualSmoothed
Centered Moving Average Plot for Sales
CMA values smooth out both the seasonal and irregular fluctuations in the time series.
Forecasting with Trend and Seasonal Components
SSt t IIt t = = YYt t /(Moving Average for period /(Moving Average for period t t ))
Step 3. Determine the seasonal & irregular factors (St It ).
Isolate the trend and cyclical components. For each period t, this is given by:
Forecasting with Trend and Seasonal Components
YearYear SeasonSeasonDollarDollar
Sales (Sales (YYtt))MovingMovingAverageAverage
11
22
33
44
112233112233112233112233
1851856620120122 985985199199552162168810710722224224112302306611011055228228002402408811211200
1617.671617.671664.001664.001716.001716.001745.001745.001827.001827.001873.001873.001884.001884.001897.001897.001931.001931.001936.001936.00
SSttIItt
1.2441.2442012/1617.2012/1617.
6767.592.592
1.1631.1631.2421.242.587.587
1.1961.1961.2241.224.582.582
1.1811.1811.2441.244
Forecasting with Trend and Seasonal Components
Season 3: (.592 + .587 + .582) /3 = .587Season 3: (.592 + .587 + .582) /3 = .587Season 2: (1.244 + 1.242 + 1.224 + 1.244) /4 = 1.238Season 2: (1.244 + 1.242 + 1.224 + 1.244) /4 = 1.238Season 1: (1.163 + 1.196 + 1.181) /3 = 1.180Season 1: (1.163 + 1.196 + 1.181) /3 = 1.180
Step 4. Determine the average seasonal factors. Averaging all St It values corresponding to that season:
3.0053.005
Forecasting with Trend and Seasonal Components
Season 3: .587/1.002 = .586Season 3: .587/1.002 = .586Season 2: 1.238/1.002 = 1.236Season 2: 1.238/1.002 = 1.236Season 1: 1.180/1.002 = 1.178Season 1: 1.180/1.002 = 1.178
Step 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.
3.0003.000
Season 2 sales (on average) 23.6% above the average annual sales.Season 1 sales (on average) 17.8% above the average annual sales. Season 3 sales (on average) 42.4% below the average annual sales.
Forecasting with Trend and Seasonal Components
YearYear SeasonSeasonDollarDollar
Sales (Sales (YYtt))MovingMovingAverageAverage
11
22
33
44
112233112233112233112233
1851856620120122 985985199199552162168810710722224224112302306611011055228228002402408811211200
1617.671617.671664.001664.001716.001716.001745.001745.001827.001827.001873.001873.001884.001884.001897.001897.001931.001931.001936.001936.00
SSttIItt
1.2441.244.592.592
1.1631.1631.2421.242.587.587
1.1961.1961.2241.224.582.582
1.1811.1811.2441.244
ScaledScaledSStt
1.1781.1781.2361.236
.586.5861.1781.1781.2361.236
.586.5861.1781.1781.2361.236
.586.5861.1781.1781.2361.236
.586.586
Step 6. Determine the deseasonalized data.
Forecasting with Trend and Seasonal Components
Divide the data point values, Yt , by St
.
Forecasting with Trend and Seasonal Components
YearYear SeasonSeasonDollarDollar
Sales (Sales (YYtt))MovingMovingAverageAverage
11
22
33
44
112233112233112233112233
1851856620120122 985985199199552162168810710722224224112302306611011055228228002402408811211200
1617.671617.671664.001664.001716.001716.001745.001745.001827.001827.001873.001873.001884.001884.001897.001897.001931.001931.001936.001936.00
SSttIItt
1.2441.244.592.592
1.1631.1631.2421.242.587.587
1.1961.1961.2241.224.582.582
1.1811.1811.2441.244
ScaledScaledSStt
1.1781.1781.2361.236
.586.5861.1781.1781.2361.236
.586.5861.1781.1781.2361.236
.586.5861.1781.1781.2361.236
.586.586
YYtt//SStt
15761576
1856/1.11856/1.17878
1628162816811681169416941754175418291829190219021866186618861886193519351948194819111911
Year/ Season
Dese
aso
naliz
ed S
ale
s
321321321321
2000
1900
1800
1700
1600
Deseasonalized Sales Time Series
Although this shows some up and down movement over the past 12 seasons, the time series seems to have an upward linear trend.
Forecasting with Trend and Seasonal Components
TTtt = 1580.11 + 33.96 = 1580.11 + 33.96tt
Step 7. Determine a trend line of the deseasonalized data (similar to trend projections described before).
Using the least squares method for t = 1, 2, ..., 12, gives:
Forecasting with Trend and Seasonal Components
TT1313 = 1580.11 + (33.96)(13) = 2022 = 1580.11 + (33.96)(13) = 2022
TT1414 = 1580.11 + (33.96)(14) = 1580.11 + (33.96)(14) = 2056= 2056
TT1515 = 1580.11 + (33.96)(15) = 2090 = 1580.11 + (33.96)(15) = 2090
Step 8. Determine the deseasonalized predictions.
Substitute t = 13, 14, and 15 into the least squares equation:
Forecasting with Trend and Seasonal Components
Season 3: ( .586)(2090) = 1225Season 3: ( .586)(2090) = 1225
Season 2: (1.236)(2056) = 2541Season 2: (1.236)(2056) = 2541
Season 1: (1.178)(2022) = 2382Season 1: (1.178)(2022) = 2382
Step 9. Take into account the seasonality.
Multiply each deseasonalized prediction by its seasonal factor to give the following forecasts for year 5:
If you have detailed information (i.e. in Terry’s Tie Shop example,monthly sales over the 4 year period) we can use MINITAB to carryout all these 9 steps.
Depends on the problem:• # of months for a year• # of days for a week• # of hours of a working day, etc.
If both trend & seasonaleffects present in the time series (based on time series plot) select this.
Forecasting sales for 12 months in next year
# of data points in the time series