Upload
jacks-oc
View
10
Download
0
Embed Size (px)
DESCRIPTION
1st partial itesm gda Forecasting info
Citation preview
FORECASTING STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa Olascoaga
DEFINITION OF FORECASTINGIs predicting what will happen in the future.Is an estimate of the future level of some variable
Why do we forecast?
DEFINITION OF FORECASTINGMost companies forecast in order to help the firm in strategic planning activities such as: inventory purchasing, capacity planning, labor planning, etc.
NAIVE FORECASTING TECHNIQUES
Naive forecasts: a folk forecasting techniqueIn every day life situations we forecast using very simple techniqueThis technique is close to linear trend model
NAIVE FORECASTS
The value tomorow will be the same as today. Example: Number of visitors today was 120. Forecast NF1 for tomorow: 120.The value tomorow will be less (greater) by 10%. Example: Average temperature this month is 20 degrees. Forecast for the next month: Temperature will be 25 degrees (increase of 25%).
CURRENT SITUATION IN FORECASTINGThere exist a well defined set of forecasting methods There exists computer software that may be quite simply applied in forecastingExcel program allows to solve simple forecasting tasks
LAWS OF FORECASTINGForecasts are Always Wrong: No forecasting approach or model can predict the exact level of the future variable. deal with the risksForecasts for the near-term tend to be more accurate: Predicting tomorrows gas price will likely be more accurate than predicting gas price 6 weeks from now.Forecasts for groups of products or services tend to be more accurateForecasts are no substitute for calculated values
BASIC STEPS OF A FORECASTING TASKDefining the problemChoosing time-series dataAnalysing visually data paterns Choosing a modelCalculating a forecastEvaluating the forecasting accuracy, caculating errors
FORECASTING METHODS STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa Olascoaga
QualitativeRequires advice from experts. It is used when there is no available or applicable information. Used for intermediate or long term decisions.Used for immediate or short term decisions and:Past information from forecasted variable is availableInformation can be quantifiedIs reasonable to believe that past behaviour will continueQuantitativeFORECASTING
FORECASTING
FORECASTINGPast SalesPast Sales + Marketing Budget
Past GradesPast Grades + Practice TimeFuture SalesFuture Grades
PATTERNS IN A TIME SERIESA time series is a sequence of observations of a variable that are measured during a regular period of time (every hour, day, month or year)
They must be mesasured with equal intervals.
EXAMPLE OF TIME-SERIES DATANumber of visitors
Year199819992000200120022003Number420450440460470465
EXAMPLE OF TIME-SERIES DATA
PATTERNS IN A TIME SERIESThe pattern of the data helps us to understand the behaviour (trend) of the information.
A graph shows the relation between time and the value of the variable$time
PATTERNS IN A TIME SERIESThe pattern of the data helps us to undersdtand the behaviour of the information.
A graph shows the relation between time and the value of the variable
PATTERNS IN A TIME SERIESWhen trying to analyze a time series (be it sales, promotions etc) it's good to remember that there are four basic patterns:Horizontal (random, irregular variation)Trend (linear)Periodical (cyclical, seasonal)Complex (a combination of part or all listed above
HORIZONTAL PATTERNWhen the values of the time series fluctuate around a constant mean. Stationery time series are very easy to forecast.Retail or Stock market?
Chart1
40
61
43
35
58
52
37
50
60
Horizontal pattern
Patterns of the time-series data
1. Horizontal (random, irregular variation)
Example: Number of visitors in a small librarry
DayNumber of visitors
140
261
343
435
558
652
737
850
960
1067
3. Periodinis atsitiktinis pavidalas (savaitinis, nuo pirmadienio iki sekmadienio, pavaizduotos 3 savaits)
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
4 Sudtingas atsitiktinis, kryptinis, periodinis
DienaLankytoj skaiius
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Horizontal pattern
Horizontal (irregular variations)
Trend
Periodinis atsitiktinis pavidalas
Periodical seasonal
Sudtingas atsitiktinis, kryptinis, periodinis pavidalas
Complex
Patterns of the time-series data
2. Trend (close to the linear growth)
Example: Number of library visitors during the 1-6 week of the Winter semester
WeekNumber of library visitors
11063
22369
33159
43964
55001
Complex
Trend (close to the linear growth)
Linear
Patterns of the time-series data
Patterns of the time-series data
3. Periodical random (seasonal variations)
Example: Number of visitors in a small librarry
DayNumber of visitors
539
645
746
822
934
1016
118
1241
1344
1441
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
Linear
39
45
46
22
34
16
8
41.4
44.3
41.1
25
35
9
13
34
41
43
29
36
8
6
Periodical seasonal
Logarithmic
Patterns of the time-series data
4. Complex data pattern including random, trend and periodical variations
DayNumber of visitors
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Logarithmic
2
1
2
16
6
18
31
26
1
29
6
5
28
21
19
14
24
6
5
26
27
36
39
24
7
5
39
45
46
22
34
16
8
69
35
33
25
35
9
13
34
41
43
29
36
8
6
60
51
62
56
49
22
23
43
28
26
122
28
18
23
30
37
34
36
27
7
3
20
4
Trend (poly)
Complex data pattern including random, trend and periodical variations
Power
Trend (linear)
Linear
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
10.22
10.85
Power
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
Linear trend
Exponential
Trend (logarithmic)
Logarithmic
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
11.45
11.75
Exponential
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
Logarithmic trend
Polynomial
Trend (power)
0.55
1.2
2.21
3.79
5.6
7.72
9.52
5.66
9
10.11
Polynomial
0.55
1.2
2.21
3.79
5.6
7.72
9.52
Trend (power)
Smoothing illustration
Trend (exponential)
0.09
0.64
1.2
2.33
7.4
24.3
51.7
14.5
21.3
10
Smoothing illustration
0.09
0.64
1.2
2.33
7.4
24.3
51.7
Trend (exponential)
Trend (polynomial)
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
Trend (polynomial)
Smoothing the data variation
Number of visitors in a smal library
WeekNumber of visitors
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Data
Smoothed data
Moore smoothed data
Smoothing the data variation: a graphical presentation
TREND PATTERNConsists of a long-term increase or decrease of the values of the time series (close to the linear growth). Trend patterns are easy to forecast and are very profitable when found by stock traders!
Chart1
1063
2369
3159
3964
5001
Horizontal pattern
Patterns of the time-series data
1. Horizontal (random, irregular variation)
Example: Number of visitors in a small librarry
DayNumber of visitors
140
261
343
435
558
652
737
850
960
1067
3. Periodinis atsitiktinis pavidalas (savaitinis, nuo pirmadienio iki sekmadienio, pavaizduotos 3 savaits)
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
4 Sudtingas atsitiktinis, kryptinis, periodinis
DienaLankytoj skaiius
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Horizontal pattern
Irregular variation of the number of visitors
Sheet1
Periodinis atsitiktinis pavidalas
D. ilyg
Sudtingas atsitiktinis, kryptinis, periodinis pavidalas
Patterns of the time-series data
2. Trend (close to the linear growth)
Example: Number of library visitors during the 1-6 week of the Winter semester
WeekNumber of library visitors
11063
22369
33159
43964
55001
Trend (close to the linear growth)
Duomen svyravim ilyginimas
Klient skaiiaus kitimas firmoje 1-24 savait
SavaitKlient skaiius
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Duomenys
Ilyginti
Labiau ilyginti
Duomen svyravimo ilyginimo grafin iliustracija
PERIODICAL PATTERNThe values of these time series are influenced by seasonal factors. A time series with seasonal patterns are more difficult to forecast but not too difficult.
Chart1
39
45
46
22
34
16
8
41.4
44.3
41.1
25
35
9
13
34
41
43
29
36
8
6
Horizontal pattern
Patterns of the time-series data
1. Horizontal (random, irregular variation)
Example: Number of visitors in a small librarry
DayNumber of visitors
140
261
343
435
558
652
737
850
960
1067
3. Periodinis atsitiktinis pavidalas (savaitinis, nuo pirmadienio iki sekmadienio, pavaizduotos 3 savaits)
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
4 Sudtingas atsitiktinis, kryptinis, periodinis
DienaLankytoj skaiius
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Horizontal pattern
Irregular variation of the number of visitors
Periodical seasonal
Periodinis atsitiktinis pavidalas
Trend
Sudtingas atsitiktinis, kryptinis, periodinis pavidalas
D. ilyg
Patterns of the time-series data
3 Periodical random (seasonal variations)
Example: Number of visitors in a small librarry
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
D. ilyg
39
45
46
22
34
16
8
41.4
44.3
41.1
25
35
9
13
34
41
43
29
36
8
6
Periodical seasonal
Patterns of the time-series data
2. Trend (close to the linear growth)
Example: Number of library visitors during the 1-6 week of the Winter semester
WeekNumber of library visitors
11063
22369
33159
43964
55001
Trend (close to the linear growth)
Duomen svyravim ilyginimas
Klient skaiiaus kitimas firmoje 1-24 savait
SavaitKlient skaiius
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Duomenys
Ilyginti
Labiau ilyginti
Duomen svyravimo ilyginimo grafin iliustracija
COMPLEX PATTERNAre a mixture of the others. Which patterns can you find?.
Chart1
2
1
2
16
6
18
31
26
1
29
6
5
28
21
19
14
24
6
5
26
27
36
39
24
7
5
39
45
46
22
34
16
8
69
35
33
25
35
9
13
34
41
43
29
36
8
6
60
51
62
56
49
22
23
43
28
26
122
28
18
23
30
37
34
36
27
7
3
20
4
Trend (poly)
Horizontal pattern
Patterns of the time-series data
1. Horizontal (random, irregular variation)
Example: Number of visitors in a small librarry
DayNumber of visitors
140
261
343
435
558
652
737
850
960
1067
3. Periodinis atsitiktinis pavidalas (savaitinis, nuo pirmadienio iki sekmadienio, pavaizduotos 3 savaits)
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
4 Sudtingas atsitiktinis, kryptinis, periodinis
DienaLankytoj skaiius
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Horizontal pattern
Irregular variation of the number of visitors
Trend
Periodinis atsitiktinis pavidalas
Sheet1
Sudtingas atsitiktinis, kryptinis, periodinis pavidalas
Periodical seasonal
Patterns of the time-series data
2. Trend (close to the linear growth)
Example: Number of library visitors during the 1-6 week of the Winter semester
WeekNumber of library visitors
11063
22369
33159
43964
55001
Periodical seasonal
Trend (close to the linear growth)
Smoothing illustration
Patterns of the time-series data
4. Complex data pattern including random, trend and periodical variations
DayNumber of visitors
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Smoothing illustration
2
1
2
16
6
18
31
26
1
29
6
5
28
21
19
14
24
6
5
26
27
36
39
24
7
5
39
45
46
22
34
16
8
69
35
33
25
35
9
13
34
41
43
29
36
8
6
60
51
62
56
49
22
23
43
28
26
122
28
18
23
30
37
34
36
27
7
3
20
4
Trend (poly)
Complex data pattern including random, trend and periodical variations
Patterns of the time-series data
3. Periodical random (seasonal variations)
Example: Number of visitors in a small librarry
DayNumber of visitors
539
645
746
822
934
1016
118
1241
1344
1441
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
39
45
46
22
34
16
8
41.4
44.3
41.1
25
35
9
13
34
41
43
29
36
8
6
Periodical seasonal
Smoothing the data variation
Number of visitors in a smaal library
WeekNumber of visitors
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Data
Smoothed data
Moore smoothed data
Smoothing the data variation: a graphical presentation
FORECASTING METHODSmoothing MethodHorizontal PatternTrend PatternSeasonal PatternMoving AveragesExponential SmoothingExponential Smoothing with Adaptive ResponseCenteredNon-centeredLinear Moving AveragesLinear Exponential SmoothingExponential Smoothing squared (Brown Method)1 Param: Brown M.2 Param: Holt M.Winters MethodMultiplicative Seasonality
What is the accuracy of a particular forecast?
How to measure the suitability of a particular forecasting method for a given data set?FORECASTING ACCURACY
MEASURES TO ESTIMATE ERRORSKey concepts:
Error (e)Mean (average) error (ME)Mean absolute error (MAE)Mean squared error (MSE)Percentage error (PE)Mean absolute percentage error (MAPE)
To preliminary evaluate a forecast and suitability of a method, various statistical measures may be used.
Error (e) of a forecast is measured as a difference between the actual (A) and forecasted values (F), that is, e = A F (+) undervalued: forecast under real (-) overvalued: forecast over real
The error can be determined only when actual (future) data are available.FORECAST ERROR
Mean (average) error (ME)
Not a very useful value as it tends to compensate. (+) : low forecasts (-) : high forecastsMEASURES TO ESTIMATE ERRORS
Mean absolute error (MAE)
Avoids the issue of negatives and positives.Also known as mean absolute deviationMEASURES TO ESTIMATE ERRORS
Mean squared error (MSE)
Also avoids the issue of negatives and positives.However this two measures are affected by the scale of measurementMEASURES TO ESTIMATE ERRORS
Percentage error (PE)
Is calculated for each period of timeMEASURES TO ESTIMATE ERRORS
Mean absolute percentage error (MAPE)
Is a relative or percentual measure of the error that allows to make comparisons when scales are differentMEASURES TO ESTIMATE ERRORS
MEASURES TO ESTIMATE ERRORS
MEASURES TO ESTIMATE ERRORS
STATISTICAL MEASURES OF GOODNESS OF FITThe Correlation Coefficient (R):Measures the strength and direction of linear relationships between two variables. It has a value between 1 and +1. A correlation near zero indicates little linear relationship, and a correlation near one indicates a strong linear relationship between the two variables
The Determination Coefficient(R2) measures the percentage of variation in the dependent variable that is explained by the regression or trend line. It has a value between zero and one, with a high value indicating a good fit.
In trend analysis the following measures will be used:
MOVING AVERAGE FORECASTING METHOD STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa Olascoaga
MAIN IDEA OF THE METHOD
The moving average uses the average of a given number of the most recent periods' value to forecast the value for the next period.
Moving average smoothes down the fluctuations in the data
SMOOTHING
Chart5
40
61
43
35
58
52
37
50
60
67
41
33
50
61
44
46
60
35
57
38
63
47
37
50
Data
Smoothed data
Moore smoothed data
Smoothing the data variation: a graphical presentation
Linear
Trend (linear)
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
10.22
10.85
Linear
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
Linear trend
Logarithmic
Trend (logarithmic)
Logarithmic
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
11.45
11.75
Logarithmic
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
Logarithmic trend
Power
Trend (power)
0.55
1.2
2.21
3.79
5.6
7.72
9.52
5.66
9
10.11
Power
0.55
1.2
2.21
3.79
5.6
7.72
9.52
Trend (power)
Exponential
Trend (exponential)
0.09
0.64
1.2
2.33
7.4
24.3
51.7
14.5
21.3
10
Exponential
0.09
0.64
1.2
2.33
7.4
24.3
51.7
Trend (exponential)
Polynomial
Trend (polynomial)
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
Polynomial
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
Trend (polynomial)
Smoothing illustration
Smoothing the data variation
Number of visitors in a smal library
WeekNumber of visitors
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Smoothing illustration
Data
Smoothed data
Moore smoothed data
Smoothing the data variation: a graphical presentation
PREREQUISITE DATA PATTERN
Moving average method is commonly used when: the pattern in the data does not have periodical (seasonal or cyclic) characteristics is neither growing nor declining rapidly.
Chart1
40
61
43
35
58
52
37
50
60
Horizontal pattern
Patterns of the time-series data
1. Horizontal (random, irregular variation)
Example: Number of visitors in a small librarry
DayNumber of visitors
140
261
343
435
558
652
737
850
960
1067
3. Periodinis atsitiktinis pavidalas (savaitinis, nuo pirmadienio iki sekmadienio, pavaizduotos 3 savaits)
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
4 Sudtingas atsitiktinis, kryptinis, periodinis
DienaLankytoj skaiius
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Horizontal pattern
Horizontal (irregular variations)
Trend
Periodinis atsitiktinis pavidalas
Periodical seasonal
Sudtingas atsitiktinis, kryptinis, periodinis pavidalas
Complex
Patterns of the time-series data
2. Trend (close to the linear growth)
Example: Number of library visitors during the 1-6 week of the Winter semester
WeekNumber of library visitors
11063
22369
33159
43964
55001
Complex
Trend (close to the linear growth)
Linear
Patterns of the time-series data
Patterns of the time-series data
3. Periodical random (seasonal variations)
Example: Number of visitors in a small librarry
DayNumber of visitors
539
645
746
822
934
1016
118
1241
1344
1441
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
Linear
39
45
46
22
34
16
8
41.4
44.3
41.1
25
35
9
13
34
41
43
29
36
8
6
Periodical seasonal
Logarithmic
Patterns of the time-series data
4. Complex data pattern including random, trend and periodical variations
DayNumber of visitors
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Logarithmic
2
1
2
16
6
18
31
26
1
29
6
5
28
21
19
14
24
6
5
26
27
36
39
24
7
5
39
45
46
22
34
16
8
69
35
33
25
35
9
13
34
41
43
29
36
8
6
60
51
62
56
49
22
23
43
28
26
122
28
18
23
30
37
34
36
27
7
3
20
4
Trend (poly)
Complex data pattern including random, trend and periodical variations
Power
Trend (linear)
Linear
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
10.22
10.85
Power
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
Linear trend
Exponential
Trend (logarithmic)
Logarithmic
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
11.45
11.75
Exponential
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
Logarithmic trend
Polynomial
Trend (power)
0.55
1.2
2.21
3.79
5.6
7.72
9.52
5.66
9
10.11
Polynomial
0.55
1.2
2.21
3.79
5.6
7.72
9.52
Trend (power)
Smoothing illustration
Trend (exponential)
0.09
0.64
1.2
2.33
7.4
24.3
51.7
14.5
21.3
10
Smoothing illustration
0.09
0.64
1.2
2.33
7.4
24.3
51.7
Trend (exponential)
Trend (polynomial)
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
Trend (polynomial)
Smoothing the data variation
Number of visitors in a smal library
WeekNumber of visitors
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Data
Smoothed data
Moore smoothed data
Smoothing the data variation: a graphical presentation
FORMULAIf forecast for t period is denoted by Ft, and the actual value of the time-series was Yt-1 during period t-1, Yt-2 during period t-2, etc., then k period simple moving average is expressed as:
CHOOSING THE AVERAGING PERIODThe averaging period (value of n) must be determined by the decision-maker. It is important to try to select the best period to use for the moving average. As a general rule, the number of periods used should relate to the amount of random variability in the data. Specifically, the bigger the moving average period, the greater the random elements are smoothed.
EXAMPLE
MonthNumber of clientsMoving average (2)January50February30March2040April3025May (forecast)25
CALCULATION OF ERRORS: EXAMPLE
MonthNumber of clientsMoving average (2)ErrorPercentage error (MAPE)January50February30March2040-20100April3025517May (forecast)25Mean error7.558.5
EVALUATION OF MAAdvantage: Very simple method.Shortcomings: Not applicable when trend exists,No strict rule of choosing its parameter,The new and the old data are treated in the same way (while, in fact, the old data should be treated as being less signifficant).
EXAMPLECertain barbecue restaurant offers an entre of lamb on Friday. This rare dish has been ordered by 75, 64, 68 and 70 clients during the past four weeks. Prepare a demand forecast for the next week using a moving average of four periods.
EXAMPLEThe following chart shows the price (in U.S. Dlls.) per ounce of silver in the first trading day of each month. With a running average of 10 terms, predict the price of silver for the next month..
EXPONENTIAL SMOOTHING FORECASTING METHOD STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa Olascoaga
MAIN IDEA OF THE METHOD
The exponential smoothing method main idea is to smooth down variations in the data. Forecast error for the previous period is taken into account. Time series should have irregular variations:
Chart1
40
61
43
35
58
52
37
50
60
Horizontal pattern
Patterns of the time-series data
1. Horizontal (random, irregular variation)
Example: Number of visitors in a small librarry
DayNumber of visitors
140
261
343
435
558
652
737
850
960
1067
3. Periodinis atsitiktinis pavidalas (savaitinis, nuo pirmadienio iki sekmadienio, pavaizduotos 3 savaits)
DienaLankytoj skaiius
539
645
746
822
934
1016
118
1241.4
1344.3
1441.1
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
4 Sudtingas atsitiktinis, kryptinis, periodinis
DienaLankytoj skaiius
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Horizontal pattern
Horizontal (irregular variations)
Trend
Periodinis atsitiktinis pavidalas
Periodical seasonal
Sudtingas atsitiktinis, kryptinis, periodinis pavidalas
Complex
Patterns of the time-series data
2. Trend (close to the linear growth)
Example: Number of library visitors during the 1-6 week of the Winter semester
WeekNumber of library visitors
11063
22369
33159
43964
55001
Complex
Trend (close to the linear growth)
Linear
Patterns of the time-series data
Patterns of the time-series data
3. Periodical random (seasonal variations)
Example: Number of visitors in a small librarry
DayNumber of visitors
539
645
746
822
934
1016
118
1241
1344
1441
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
Linear
39
45
46
22
34
16
8
41.4
44.3
41.1
25
35
9
13
34
41
43
29
36
8
6
Periodical seasonal
Logarithmic
Patterns of the time-series data
4. Complex data pattern including random, trend and periodical variations
DayNumber of visitors
102
111
122
1316
146
1518
1631
1726
181
1929
206
215
2228
2321
2419
2514
2624
276
285
2926
3027
3136
139
224
37
45
539
645
746
822
934
1016
118
1269
1335
1433
1525
1635
179
1813
1934
2041
2143
2229
2336
248
256
2660
2751
2862
2956
3049
122
223
343
428
526
6122
728
818
923
1030
1137
1234
1336
1427
157
163
1720
184
Logarithmic
2
1
2
16
6
18
31
26
1
29
6
5
28
21
19
14
24
6
5
26
27
36
39
24
7
5
39
45
46
22
34
16
8
69
35
33
25
35
9
13
34
41
43
29
36
8
6
60
51
62
56
49
22
23
43
28
26
122
28
18
23
30
37
34
36
27
7
3
20
4
Trend (poly)
Complex data pattern including random, trend and periodical variations
Power
Trend (linear)
Linear
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
10.22
10.85
Power
1.31
2
3.6
4.62
5.33
6.67
7.82
8.61
Linear trend
Exponential
Trend (logarithmic)
Logarithmic
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
11.45
11.75
Exponential
1
4.67
5.95
7.32
8.53
9.6
10.14
10.8
Logarithmic trend
Polynomial
Trend (power)
0.55
1.2
2.21
3.79
5.6
7.72
9.52
5.66
9
10.11
Polynomial
0.55
1.2
2.21
3.79
5.6
7.72
9.52
Trend (power)
Smoothing illustration
Trend (exponential)
0.09
0.64
1.2
2.33
7.4
24.3
51.7
14.5
21.3
10
Smoothing illustration
0.09
0.64
1.2
2.33
7.4
24.3
51.7
Trend (exponential)
Trend (polynomial)
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
3.36
1.29
1.43
2.66
4.47
6
6.48
5.95
Trend (polynomial)
Smoothing the data variation
Number of visitors in a smal library
WeekNumber of visitors
140
261
343
435
558
652
737
850
960
1067
1141
1233
1350
1461
1544
1646
1760
1835
1957
2038
2163
2247
2337
2450
Data
Smoothed data
Moore smoothed data
Smoothing the data variation: a graphical presentation
EVALUATION OF ESAdvantage: Rather simple method; More recent data are considered as being more influential. Requires only two data values to smooth the future: the most recent observation, and the most recent estimate, also requires a default value for alpha ().Short term - inventoriesShortcomings: No definite rule of choosing its parametersThe value of should be determined by trial and error. (Test different values of to find the lowest MSE).
FORMULAFt+1= forecast for the period t + 1 Yt = real value of time series in period tFt = forecast for period t of time series = smoothing constant (0 1)
EXAMPLE
MonthNumber of clientsForecast(Exponential Smoothing)=.02January40February37March43April45May
Calculation of errors: Example
MonthNumber of clientsExponential Smoothing Forecast=ErrorSquared errorJanuary40February37 March43April45May
EXERCISESThe sales of cars in a Ford Agency are calculated using simple exponential smoothing. The agency believes that the sales have no seasonal variation or trend, thus this method works fine. However, each month of march the agency observes that the forecast for March is higher than that of february by 200 units. Supose that at the end of february of 2002, Yt = 600. During march of 2002, 900 cars were sold. With = 0.6, find the expected sales of cars for April 2002.
EXERCISESApril sales expected to be for 860 units
Real SalesForecast1- February6000.60.4March900800860
EXERCISESA distributor of construction materials is using exponential smoothing to forecast the monthly demand (in tons) of a material. For June the forecast demand was of 130 ton, however the sales were of 135 ton. For July, the forecast was for 133.75, and 132 ton were sold. Find the smoothing constant and forecast the demand for August.
EXERCISESThe smoothing constant equals .75 and the forecast the demand for August equals 132.4375 tons.
Real SalesForecastJune135130ft+1=a(yt)+ft(1-aJuly132133.75ft+1=ayt+ft-aftAugust132.4375ft+1 - ft =a(yt-ft)a= ft+1 - ft/(yt-ft)0.751- 0.25
EXERCISESThe weekly demand for car loans in the Washington Federal Credit Union in the last six weeks is shown in the table below. Find:
Find using exponential smoothing the forecast for week seven (try constants =0.1, 0.3 and 0.5)Using the MSE determine which of the three options provides the best forecast. Using the MAPE criteria determine which of the three options provides the best forecast.Calculate and interpret the corresponding values of the MAE. Calculate and interpret the corresponding values of the MPE.
WeekDemand of loans120218322424528623
EXERCISESThe weekly demand for car loans in the Washington Federal Credit Union in the last six weeks is shown in the table below. Find:
WeekDemand of loansForecastErrorAEESPEAPE1202183224245286237MEAN
ADAPTIVE RESPONSE RATE EXPONENTIAL SMOOTHING STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa Olascoaga
MAIN IDEA OF THE METHOD
Adaptive exponential smoothing methods allow a smoothing parameter to change over time, in order to adapt to changes in the characteristics of the time series.
EVALUATION OF ARRESAdvantage: automatically adjusts the smoothing parameters based on the forecast error. The smoothed term is replaced by t, and the later is adaptive over timeShortcomings: The underlying rationale for time varying is less clear. as a random coefficient or autoregressive form, depending on the nature of the process.Another drawback for this model is that there is no explicit way to handle seasonality.A major flaw with smoothing models is their inability to predict cyclical reversals in the data, since forecasts depend solely on the past.
FORMULAe t = Yt Ft Et = et + (1)Et 1 = smoothed error Mt =letl+(1)Mt1 = abs. val. Of smoothed error =
= 0.2, a choice variable (chosen by the decision maker)
CHOOSING THE SMOOTHING CONSTANT The forecasting procedure for this model can be proceeded recursively:
Given the values of Yt and Ft, we can estimate et from (1). The et then is plugged into (2) and (3).Given the estimated value of , we can obtain t by using (4). Finally, we use t, Yt and Ft to predict Ft+1 by employing the first equation.
The smoothing constant () must be determined by the decision-maker. However, in this case = 0.2 is the general choice.
Example
EXERCISESA
STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa OlascoagaLINEARLY WEIGHTED MOVING AVERAGE
MAIN IDEA OF THE METHOD
It calculates a second moving average from the original moving average.
EVALUATION OF ARRESAdvantage: This method is used to forecast series with a linear trend line since this method handles it better that the simpler one.Designed to handle trending data. One set of moving averages is calculated and then a second set is calculated as a moving average of the first set.Weighted Moving Average - place more weight on recent observations. Sum of the weights needs to equal 1
FORMULAFirst moving averageDifference between both moving averagesSecond moving averageAnother adjustment constantForecast value p periods to the future Note: n is periods to calculate the moving average and p is periods to forecast
ExampleCalculate de DMA for the following rental information. Consider a p=3.
TimeRents16542658366546725673667176938694970110703117021271013712147111572816
Example
Chart1
65411
65822
6656593
6726654
673670664.6666666667
671672669
693679673.6666666667
694686679
701696687
703699.3333333333693.7777777778
702702699.1111111111
710705702.1111111111
712708705
711711708
728717712
Rents
SMA
DMA
Time
Rents
Weekly Rents 3 Period Double Moving Average
Sheet1
TimeRentsSMADMAabForecastError
1654
2658
3665659
4672665
56736706656755
66716726696753681-10
7693679674684567815
869468667969376904
970169668770597001
107036996947056714-11
117027026997053710-8
1271070570270837082
1371270870571137111
147117117087143714-3
15728717712722571711
16727
Sheet2
Sheet3
EXERCISESLet 198.75 be the first linear moving average in the period 8, and 199.93 the value of the second moving average in that same period. Calculate the value of the forecast for period 9, 15 and 18. Consider n = 4.
EXERCISESFind the equation of the line and the forecast for 1998, using DMA for four periods (n=3)
STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa OlascoagaBROWN METHOD OF FORECASTING
MAIN IDEA OF THE METHOD
Also known as Double Exponential Smoothing. Used to forecast a series with a linear trend.
EVALUATION OF BROWNAdvantage: Similar to the double moving average model.If the trend as well as the mean is varying slowly over time, a higher-order smoothing model is needed to track the varying trend.Uses two different smoothed series that are centered at different points in time. The forecasting formula is based on an extrapolation of a line through the two centers.
FORMULAEquationsUsed for t: 2, 3.
FORMULAEquationsUses a single coefficient, alpha, for both smoothing operations. Calculates the difference between single and double smoothed values as a measure of trend (at). It then adds this value to the single smoothed value together with an adjustment for the current trend (bt).
EXERCISESGiven b4 = 1.0696 and A4 = 96.064 calculate the value of the forecast for period five. Use =.2
Given the first and second observation whose values are 94 and 90, respectively determine the forecast for period 3. Use =.25
ExampleFind the linear equation with this method and the forecast for period 8,10 & 15. Use =.2
PeriodYtAtAtatbt15.425.335.345.656.967.277.281015
STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa OlascoagaHOLT METHOD
MAIN IDEA OF THE METHOD
Is an extension of Browns double exponential smoothing but it uses two coefficients one for smoothng trend and other the slope .
=is the smoothing constant for the level = is the trend smoothing constant - used to remove random error
MAIN IDEA OF THE METHOD
How do we find the best combination of smoothing constant?
Low values of alpha and beta should be used when there are frequent random fluctuations in the data.High values of alpha and beta should be used when there is a pattern such as trend in the data.
EVALUATION OF HOLTAdvantage: Reduces the effect of randomness (using the difference between the averages calculated in two successive periods). Updates the forecasting trend.Avoids a forecast with a reaction delayed growth.
Equations:
Where:
FORMULA
Start with:
Define the smoothing constantsFind At and Tt for all the periods
Find the quadratic equation
FORMULA
EXERCISESThe following table shows annual tax on income (millions of U.S. Dlls.) paid to the Government by residents of a city. Use the method of Holt with = 0.95 and = 0.5, to obtain the forecasting equation and the forecast for 1998.
Example
YearPeriodYtAtTtFt1995155.41996261.51997368.71998487.21999590.42000686.22001794.720028103.220039119200410122.4200511131.6200612157.6200713181200814217.8200915244.12012
ExampleUse the Holt method to predict the monthly sales of DVD's in Highland Appliance. It is known that in October 2010, At = 200 and Tt = 10. During November 2010, 230 were sold DVD's. Forecasts sales of DVDs for December 2010 using = = 0.5.
ExampleThe method of Holt, exponential smoothing for time trend with no seasonal variation series, is used to predict weekly sales of an agency Ford. The previous to last week sales were 50 cars per week, with a trend of 6 cars per week. 30 Cars were sold last week. After observing the sales of the previous to last week, predict the number of cars to be sold during this and the next week. Use = = 0.7. Discuss the result.
ExampleThe following table shows the sales of saws for the Acme tool Company.These are quarterly sales From 2008 through 2010.
YearQuartertsales200811500223503325044400200915450263503720048300201019350210200311150412400
ExampleFor Holt Method use: = .3 and =.1 to predict sales for 2008 Q3 and 2010 Q2Use Brown to forecast Q3 of 2011Use DMA: to forecast with a moving period of 4 Q2 2010
YearQuartertsales200811500223503325044400200915450263503720048300201019350210200311150412400
STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa OlascoagaQES METHOD
MAIN IDEA OF THE METHOD
This method is used when there is a non-linear trend in the time series
EVALUATION OF QESAdvantage: This technique achieves good results when forecasting this type of series as it uses three smoothings to perform the calculation of forecast.
FORMULA
FORMULAConsider:
Calculate the first, second and third smoothing for t= 2,3,4,
Find the quadratic equation
EXERCISESCalculate using = 0.1 the quadratic equation for this model and the value for the forecast for period 3 & 7. Having the observed values for periods one to four: 105, 108, 111 and 103.
Example
EXERCISESFor the following exercises consider that the trend equation is quadratic with a smoothing coefficient : 0.3.
Find the equation knowing that: Y4= 9.25, A3= 8.22, A3=8.31 & A4= 8.4
There are only two observations for a new product are: 8.48 & 8.06. Find the equation and the forecast for time 4.
STATISTICS 2ITESM Campus GuadalajaraProf: Ing. Maria Luisa OlascoagaWINTERS METHOD
MAIN IDEA OF THE METHOD
Another method for forecasting that can adequately handle the presence of seasonality in a time series is the Winters Method. (multiplicative seasonality)
Equations:
Where:
FORMULA
Start with:
Use formulas of the method
FORMULA
EXERCISEForecast for next year (Period 7, 8 & 9) using = 0.822 ; = 0.055 y = 0.001
PeriodSales (Yt)Level (At)Trend (T)Seasonal Index (SI)Forecast (Ft)136223853432434153826409749883879473
EXERCISE
PeriodSales (Yt)Level (At)Trend (T)Seasonal Index (SI)Forecast (Ft)1362 0.953 2385 1.013 3432 1.137 43413809.750 0.897 5382398.99310.258 0.953 371.29 6409404.67910.007 1.013 414.64 7 471.43 8 381.11 9 414.11
Outdoor Furniture Swings. Usually the customers buy more swings in the hot months than in the cold ones, so sales change with the seasons. Suppose that the Outdoor Furniture swings are very good and verbal advertising increases the number of people who buy them. Their data that reflects seasonality and trend are given in the following table. Calculate sales for next year using = 0.15 ; = 0.1 y = 0.2
EXERCISE
Outdoor Furniture Swings.
EXERCISE
Outdoor Furniture Swings. (L=4)
EXERCISE
YearQuarter1231606984223426631031631882124505964
Use the method of Winters for a time series with seasonality (quarters). The values registered for the four quarters of the first year are: 57.26 66.81, 68.39 and 77.99 respectively; Likewise known records of the four quarters of the second year are: 65.18, 74.02, 74.12 and 82.31. Use the forecasting method to find period 9. (= 0.3, = 0.2 and = 0.2)
EXERCISE