What algorithms are used in forecasting?
SolutionThe following formulas use these abbreviations:
Consumption value in Period i: c(i)
Number of consumption values used for forecasting: p
Number of periods in one seasonal cycle: x
Initial value of Trend value: T(0)
Initial value of Basic value: B(0)
Initial values of Seasonal indices: S(0,j)
m
Mean value: M = 1/m * Sum c(i)
i=1
Depending on the forecast model a certain minimum number of initialization periods is required to carry out the forecast. If the number of initialization periods is not specified in the material master or if the number is below the minimum number, then the minimum number of initialization periods is used:
Forecast model minimum number of initialization periods
constant model (D) 1
trend model (T) 3
saisonal model (S) one full saisonal cycle (note 65088)
saisonal trend model (X) one full saisonal cycle + 3 (note 65088)
exp.smoothing 2.nd order (B) 3
The following procedure is used for both constant model (model 'D') and constant model with smoothing factor adjustment (model 'K').
m
B(0) = 1/m * Sum c(i) = M
i=1
In this formula m is the number of initialization periods.
The following procedure is used for the trend model (model 'T'), for second order exponential smoothing (model 'B'), and for second order exponential smoothing with smoothing factor adjustment.
t(i) = (m-1)/2 - (i-1)
m m
T(0) = (Sum c(i) * t(i) ) / ( Sum t(i)*t(i) )
i=1 i=1
The basic value is the starting value of the new forecast. This is calculated by adding the mean plus the trend value times half the number of initialization periods.
B(0) = M + T(0) * (m-1)/2
The following formulas are used below
Number of complete seasons:
n = p div x
Only consumption values of complete seasonal cycles are used for initialization.
m = n * x
The trend is calculated by computing the average of all x trend values of the lines connecting corresponding periods in seperate seasonal cycles.
t(i) = x/2 - (i-1)x
x n n
T(0) = -1/x * Sum ( Sum ( c(k) * t(i) ) / Sum ( t(i) * t(i) ) )
j=1 i=1 i=1
The basic value is the starting point of the new forecast (not considering seasonal indices in the moment). It is calculated as for the trend model.
B(0) = M + T(0) * (m-1)/2
In forecasting the seasonal indices are used as a factor with which the sum of basic value and trend value is multiplied. To calculate initial values the quotient of consumption value and the sum of basic value and trendvalue is calculated. The initial values of the seasonal indices are calculated by computing the mean of corresponding such quotients.
n
S(0,j) = 1/n * Sum ( c(k) / ( B(0) + T(0)*l ) )
i=1
Index k is calculated the following way: k = (i-1)*x+j
Factor l is calculated the following way: l = (n+1-i)*x-j
Example:
Consumption values: 112, 115, 124, 177, 112, 101, 185, 202
p = 8, x = 4, n = 2, m = 8, M = 141
T(0) = - 1/4 * ( (112*2 + 112*(-2)) / (4 + 4)
+ (115*2 + 101*(-2)) / (4 + 4)
+ (124*2 + 185*(-2)) / (4 + 4)
+ (177*2 + 202*(-2)) / (4 + 4) ) = 4.5
B(0) = 141 + 4.5*7/2 = 156.75
S(0,1) = 1/2 * ( 112/(156.75 + 4.5*(-7)) + 112/(156.75 + 4.5*(-3)))
= 0.838
S(0,2) = 1/2 * ( 115/(156.75 + 4.5*(-6)) + 101/(156.75 + 4.5*(-2)))
= 0.784
S(0,3) = 1/2 * ( 124/(156.75 + 4.5*(-5)) + 185/(156.75 + 4.5*(-1)))
= 1.069
S(0,4) = 1/2 * ( 177/(156.75 + 4.5*(-4)) + 202/(156.75 + 4.5*0))
= 1.282
Forecast periods for periods 9, 10, and 11.
c(9) = ( 156.75 + 4.5 ) * 0.838 = 135
c(10) = ( 156.75 + 4.5*2) * 0.784 = 130
c(11) = ( 156.75 + 4.5*3) * 1.069 = 182