Professional Documents
Culture Documents
Handout
Handout
Demand
1500
2200
2700
4200
7800
5400
Calculation
Forecast
2133
Sales
6000
5000
Demand
4000
Forecast
3000
2000
1000
0
1
4
Period
Example: The demand for Gingerbread Men is shown in the table. Forecast the demand for
month 7, weighting the past three months as follows: last month 3, two months ago 2, three
months ago 3
Period
Last Month
Two Months Ago
Three Months Ago
Sum of Weights
Month
1
2
3
4
Demand
1500
2200
2700
4200
7800
5400
Weight
3
2
1
Calculation
Forecast
2333
3
Bakery Gingrbread Man Sales
9000
8000
7000
6000
5000
Series1
Series2
4000
3000
2000
1000
0
1
P eriod
Ft
Ft-1
At-1
= New Forecast
= Previous Forecast
= Smoothing Constant: (0 1)
= Previous Periods Actual Demand
Example: The demand for Gingerbread Men is shown in the table. Forecast the demand for
month 7, using a smoothing constant of 0.4. The forecast for month 1 is 1500 units.
Month
1
2
Demand
1500
2200
Calculation
1500 + 0.4(1500 1500)
Forecast
1500
1500
2700
1780
4200
7800
5400
4
Bakery Gingerbread Man Sales
9000
8000
7000
Sales
6000
5000
Demand
Forecast
4000
3000
2000
1000
0
1
Period
forecast errors
n
Example: Calculate the MAD for the value of used in the Exponential Smoothing Example.
Month
1
2
3
Demand
1500
2200
2700
Forecast
1500
1500
1780
4200
2148
7800
2969
5400
4901
Error
1500 1500 = 0
2200 1500 = 700
| Error |
0
700
Total:
MAD:
5
MSE =
forecast errors
Example: Calculate the MAD for the value of used in the Exponential Smoothing Example.
Month
1
2
3
Demand
1500
2200
2700
Forecast
1500
1500
1780
4200
2148
7800
2969
5400
4901
Error2
0
490000
Error
1500 1500 = 0
2200 1500 = 700
Total:
MSE:
Ft
Tt
At
Example: The demand for Gingerbread Men is shown in the table. Forecast the demand for
month 7, using a smoothing constant for the average of 0.4, and a smoothing constant for the
trend of 0.2. The forecast for month 1 is 1500 units and the trend for month 1 is 200 units.
Month
1
2
3
Demand Forecast
1500
1500
2200
0.4(1500) + 0.6(1700)
= 1620
2700
4200
7800
Trend
200
0.2(1620 1500) + 0.8(200)
= 184
FIT
1700
1804
6
6
5400
9000
8000
7000
6000
Demand
5000
Forecast
Trend
4000
FIT
3000
2000
1000
0
1
P er i od
Where
a
b
x
xy - nxy
x nx
2
a y - bx
Example: The demand for Gingerbread Men is shown in the table. Forecast demand for
period 7 by fitting a single line trend to the data.
Month (x)
1
2
3
Demand (y)
1500
2200
2700
4200
7800
x2
1
4
xy
(1)(1500) = 1500
(2)(2200) = 4400
7
6
5400
x =
y =
x2 =
xy - nxy
x nx
2
xy =
y
n
a y - bx =
2000
1300
2000
2001
1500
2200
2300
2500
2700
3800
4000
4200
4500
4700
4900
5000
5200
5400
5500
5700
5900
4800
5000
5200
8
9
3000
3200
3400
10
2200
2400
2600
11
1500
1700
1900
12
1200
1400
1600
Average Monthly Demand =
45000
12
a bx
y
xy - nxy
x nx
2
a y - bx
Example: We think that there may be a relationship between park attendance and number of
gingerbread men sold. Data for the first six months are shown in the table. Forecast the
number of gingerbread men that will be sold in month 7 if monthly park attendance is forecast
as 25000 people.
Sales (y)
x2
xy
1
2
Attendance (x)
(,000)
8
12
1500
2200
64
(8)(1500) = 12000
14
2700
18
4200
19
7800
22
5400
x =
y =
x2 =
xy =
Month
9
x
xy - nxy
x nx
2
y
n
a y - bx =
x
=
a y - b xy
n2
Example: Compute the Standard Error of the Estimate for our regression analysis example
S y,x
a y - b xy
n2
n x
n xy x y
2
x n y 2 y
2
Example: Compute the Correlation Coefficient of the data in our regression analysis example
10
11
predict Y from X, the higher the value of X, the higher your prediction of
Y.
Table 1. Example data.
X
1.00
1.00
2.00
2.00
3.00
1.30
4.00
3.75
5.00
2.25
12
prediction is small. By contrast, the yellow point is much higher than the
regression line and therefore its error of prediction is large.
Figure 2. A scatter plot of the example data. The black line consists of the
predictions, the points are the actual data, and the vertical lines
between the points and the black line represent errors of prediction.
The error of prediction for a point is the value of the point minus the
predicted value (the value on the line). Table 2 shows the predicted
values (Y') and the errors of prediction (Y-Y'). For example, the first
point has a Y of 1.00 and a predicted Y (called Y') of 1.21. Therefore, its
error of prediction is -0.21.
Table 2. Example data.
X
Y'
Y-Y'
(Y-Y')2
1.00
1.00
1.210
0.210
0.044
2.00
2.00
1.635
0.365
0.133
3.00
1.30
2.060
0.760
0.578
4.00
3.75
2.485
1.265
1.600
5.00
2.25
2.910
0.660
0.436
13
You may have noticed that we did not specify what is meant by "bestfitting line." By far, the most commonly-used criterion for the best-fitting
line is the line that minimizes the sum of the squared errors of
prediction. That is the criterion that was used to find the line in Figure 2.
The last column in Table 2 shows the squared errors of prediction. The
sum of the squared errors of prediction shown in Table 2 is lower than it
would be for any other regression line.
The formula for a regression line is
Y' = bX + A
where Y' is the predicted score, b is the slope of the line, and A is the Y
intercept. The equation for the line in Figure 2 is
Y' = 0.425X + 0.785
For X = 1,
Y' = (0.425)(1) + 0.785 = 1.21.
For X = 2,
Y' = (0.425)(2) + 0.785 = 1.64.
COMPUTING THE REGRESSION LINE
In the age of computers, the regression line is typically computed with
statistical software. However, the calculations are relatively easy, and
are given here for anyone who is interested. The calculations are based
on the statistics shown in Table 3. MX is the mean of X, MY is the mean
of Y, sX is the standard deviation of X, sY is the standard deviation of Y,
and r is the correlation between X and Y.
Formula for standard deviation
Formula for correlation
Table 3. Statistics for computing the regression line.
MX
MY
sX
sY
2.06
1.581
1.072
0.627
14
b = r sY/sX
and the intercept (A) can be calculated as
A = MY - bMX.
For these data,
b = (0.627)(1.072)/1.581 = 0.425
A = 2.06 - (0.425)(3) = 0.785
Note that the calculations have all been shown in terms of sample
statistics rather than population parameters. The formulas are the
same; simply use the parameter values for means, standard deviations,
and the correlation.
STANDARDIZED VARIABLES
The regression equation is simpler if variables are standardized so that
their means are equal to 0 and standard deviations are equal to 1, for
then b = r and A = 0. This makes the regression line:
ZY' = (r)(ZX)
where ZY' is the predicted standard score for Y, r is the correlation, and
ZX is the standardized score for X. Note that the slope of the regression
equation for standardized variables is r.
A REAL EXAMPLE
The case study "SAT and College GPA" contains high school and
university grades for 105 computer science majors at a local state
school. We now consider how we could predict a student's university
GPA if we knew his or her high school GPA.
Figure 3 shows a scatter plot of University GPA as a function of High
School GPA. You can see from the figure that there is a strong positive
relationship. The correlation is 0.78. The regression equation is
University GPA' = (0.675)(High School GPA) + 1.097
Therefore, a student with a high school GPA of 3 would be predicted to
have a university GPA of
15