Simple Exponential Smoothing
Simple Exponential Smoothing
Let an observed time series be y1, y2, …. yn. Formally, the simple exponential
smoothing equation takes the form of
Forecasted value.
This means:
Generalizing,
Ft+1 = ∑𝑡−1 i t
𝑖=0 𝛼 (1-α) yt-i + (1-α) F1
The series of weights used in producing the forecast Ft are α , α (1-α ), α(1-α)2 ,
α(1-α)3…. These weights decline toward zero in an exponential fashion; thus, as
we go back in the series, each value has a smaller weight in terms of its effect
on the forecast. The exponential decline of the weights towards zero is evident.
Choosing α:
After the model is specified, its performance characteristics should be verified
or validated by comparison of its forecast with historical data for the process it
was designed to forecast.
We can use the error measures such as MAPE (Mean absolute percentage error),
MSE (Mean square error) or RMSE (Root mean square error) and α is chosen
such that the error is minimum.
Usually the MSE or RMSE can be used as the criterion for selecting an
appropriate smoothing constant. For instance, by assigning a values from 0.1 to
0.99, we select the value that produces the smallest MSE or RMSE
Two Holt-Winters methods are designed for time series that exhibit linear trend
1. Additive Holt-Winters method: used for time series with constant
(additive) seasonal variations
2. Multiplicative Holt-Winters method: used for time series with increasing
(multiplicative) seasonal variations
This method is appropriate when a time series has a linear trend with a
multiplicative seasonal pattern.
Initialising:
µp = (y1 + y2 +…..yp) / p
bp = ( (yp+1 + yp+2 +...yp+p)-(y1+y2+….yp) ) / p2
Si = yi / µp i=1,2,3….p
Choice of α,β,γ
α is used to smooth randomness, β to smooth trend and γ to smooth
seasonality. Choose α,β,γ which minimize MSE or MAPE.
Holt- Winter’s Trend and Seasonality Method for Additive Model:
It is generally considered to be best suited to forecasting time series that can be
described by the equation:
yt=(Tt + St +It)
where
Tt Trend Estimate
p the period of seasonality ( p=4 for quarterly data & p=12 for monthly data)
Initialising:
µp = (y1 + y2 +…..yp) / p
bp = ( (yp+1 + yp+2 +...yp+p)-(y1+y2+….yp) ) / p2
Si = yi -µp i=1,2,3….p
Choice of α,β,γ
α is used to smooth randomness, β to smooth trend and γ to smooth
seasonality. Choose α,β,γ which minimize MSE or MAPE.
Time series- A time series consists of data which are arranged chronologically. It
establishes a relationship between two variables in which one of the variable is
independent variable i.e. the time and other variable y is the dependent variable whose
value changes with regard to time variable e.g. total agricultural production in different
years.
Mathematically, a time series is defined by the values Y1, Y2, Y3… Yn of the variable
Y at times t1, t2, t3… tn.
Trend-Trend refers to long term movement in the time series, i.e. Trend refers to the
ability of the time series to increase or to decrease or to remain constant over a long
period of time. If the values of the variable are scattered around a straight line, then we
have a linear trend. Otherwise, the trend is non-linear e.g. long- term changes in
productivity.
Cyclical variations- Cyclical variations are oscillatory variations in the time series that
oscillate around the trend line with period of oscillation as more than one year. These
variations do not follow any regular pattern and move in somewhat unpredictable
manner. These are upswings and downswings in the time series that are observable over
extended periods of time.
Irregular variations- The irregular component of the time series is the residual factor
that accounts for the deviations of the actual time series values from what we would
expect from the trend, seasonal, and cyclical components. It accounts for the random
availability in the time series. The irregular component is caused by the short-term,
unanticipated, and non-recurring factors that affect the time series, viz. earthquakes,
floods etc.
MODELS OF DECOMPOSITION
The additive model- This model is used when it is assumed that the four
components are independent of one another, i.e., when the pattern of occurrence
and the magnitude of movement in any particular component are not affected
by other components under this assumption, the magnitude of time series (Y(t)),
at any time t is the sum of the separate influences of its four components, i.e.
Y(t)= T(t) + S(t)+ C(t)+ I(t)
Y(t)= T(t)*S(t)*C(t)*I(t)
MEASUREMENT OF TREND: Methods of measuring trend are as follows:
Free hand method or Graphical method- Original time series values are plotted for
the values of Y(t) (on Y-axis) against t (on X-axis) to get an idea about the trend
exhibited by the time series.
Semi-average method-
Steps
i. Divide the series into two equal parts.
ii. Take average of each part separately.
iii. Plot the average of each part against the middle of the time period covered by the
respective parts.
iv. Join the plotted points.
Note- If the number of time periods is even, we can divide such a data into two equal
parts without ignoring any observation but if the number of time periods is odd, the
normal practice is to ignore the middle period and divide the resulting series into two
halves.
1991 38
1992 40
1994 49
1995 51
1996 55
1997 61
1998 63
2000 72
2001 80
These two semi- averages are plotted in the middle of the respective time spans. Thus 44.8
is plotted against 1993; and 69.0 against 1999. These two points are then connected by a
straight line.
Q. The following are the annual profits in thousands in a certain business. By the method
of least squares fit a straight line.
(X)
1991 60 -3 -180 9
1992 72 -2 -144 4
1993 75 -1 -75 1
1994 65 0 0 0 Y_cap=76+4.857*X
1995 80 1 80 1
1996 85 2 170 4
1997 95 3 285 9
=532 136 28
In this case, the normal equations by the method of least squares are
∑Y=na+b∑X+c∑(X^2)
∑XY=a∑X+b∑(X^2)+c∑(X^3)
∑X^2*Y=a∑(X^2)+b∑(X^3)+c∑(X^4)
Q. Fit a quadratic trend on the following data.
X 0 1 2 3 4
Y 1.0 1.5 1.5 2.3 3.5
Sol.
Case 1:
If m is odd i.e. m = 2n+1
Then the average is placed against the middle of time interval which it covers, i.e. t =
n+1.
Case 2:
If m is even i.e. m = 2n
Then the average is placed between 2 middle values of the time interval which it
covers i.e. t = n & t = n+1.
So in this case the moving average value doesn’t coincide with the original time period
and thus to make it coincide with the original time period we find centered moving
average value by finding average of two periods at a time.
Year 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
Q. Assuming no trend in the series, calculate seasonal indices for the following data:
Quarter
Year I II III IV
1994 78 66 84 80
1995 76 74 82 78
1996 72 68 80 70
1997 74 70 84 74
1998 76 74 86 82
Quarterly total 376 352 416 384
Quarterly Average 75.2 70.4 83.2 76.8
Seasonal indices 75.2/76.4*100 70.4/76.4*100 83.2/76.4*100 76.8/76.4*100
=98.43 =92.15 =108.90 =100.52
Ratio to trend method
Steps involved:
(i) Find the trend values with the help of method of least squares.
(ii) Divide the given original data (quarterly or monthly) by corresponding
trend value and multiply this by 100 (i.e. they are trend eliminated). The
values so obtained are free from trend.
(iii) Find the quarterly or monthly (as the case may be) averages of trend
eliminated values.
(iv) Add the quarterly (or monthly) averages and the sum is say S and find
constant factor by dividing 400 (or 1200) by S.
(v) Multiply each quarterly (or monthly) average obtained in step (iii) by
the constant factor obtained in step (iv).
Q. For the given data below compute seasonal variations using ratio to trend method.
Year I II III IV
1996 60 80 72 68
1997 68 104 100 88
1998 80 116 108 96
1999 108 152 136 124
2000 160 184 172 164
Sol. First determine the trend on yearly basis and later we compute quarterly trend values.
Year Yearly Quarterly Deviations from x*Y x^2 Y_cap
total average(Y) mid- value, i.e.
X 1998, x=
X-1998
1996 280 70 -2 -140 4 64
1997 360 90 -1 -90 1 88
1998 400 100 0 0 0 112
1999 520 130 1 130 1 136
2000 680 170 2 340 4 160
N=5 ∑=560 0 ∑=240 ∑=10
a=∑Y/N=112; b=∑xY/∑(x^2)=24
Y_cap = 112 + 24*x = 112+24(X-1998)
Yearly increment=24; Quarterly increment=24/4=6
Calculation of quarterly trend values:
Consider 1996, trend value for middle quarter, i.e. half of 2 nd and half of 3rd is 64. Quarterly
increment is 6. So the trend value of 2nd quarter is 64-6/2=61 and for 3rd quarter is 64+6/2=67.
Trend value for the first quarter is 61-6=55 and of the 4th quarter is 67+6=73.
Q. Calculate seasonal indices by the ratio-to-moving average method from the following
data:
Year I II III IV
1997 68 62 63 78
1998 75 58 56 72
1999 60 63 67 93
2000 54 59 56 90
2001 59 55 58 65
Sol.
1 2 3 4 5 6 7
1997 QI 68 - - - -
QII 62 - - - -
QIII 63 271 549 68.63 (63/68.83)*100=91.79
QIV 78 278 552 69.00 (78/69)*100=113.04
1998 QI 75 274 541 67.63 (75/67.63)*100=110.90
QII 58 267 528 66.00 (58/66)*100=87.88
QIII 56 261 507 63.38 (56/63.38)*100=88.36
QIV 72 246 497 62.13 (72/62.13)*100=115.89
1999 QI 60 251 513 64.13 (60/64.13)*100=93.56
QII 63 262 545 68.13 (63/68.13)*100=92.47
QIII 67 283 560 70.00 (67/70)*100=95.71
QIV 93 277 550 68.75 (93/68.75)*100=135.27
2000 QI 54 273 535 66.88 (54/66.88)*100=80.74
QII 59 262 521 65.13 (59/65.13)*100=90.59
QIII 56 259 523 65.38 (56/65.38)*100=85.65
QIV 90 264 524 65.50 (90/65.50)*100=137.50
2001 QI 59 260 522 65.25 (59/65.25)*100=90.42
QII 55 262 499 62.38 (55/62.38)*100=88.17
QIII 58 237
QIV 65 -
-
Ratio to moving average values
Year I II III IV
1997 - - 91.79 113.04
1998 110.90 87.88 88.36 115.89
1999 93.56 92.47 95.71 135.27
2000 80.74 90.59 85.65 137.50
2001 90.42 88.17 - -
Total 375.62 359.11 361.51 501.17
Quarterly 93.9 89.77 90.373 125.3
averages
We know that a time series consisting of annual data for longer periods is depicted by trend lines. This
facilitates us to isolate the component of secular trend variation from the series and examine it for
cyclical, seasonal and irregular components. Here, we will look at "Residual Method", by which one
can isolate the cyclical variation component. This method can be bifurcated into two measures:
Both these measures are expressed in terms of percentage. We look at each of them.
When the ratio of actual values (Y) and the corresponding estimated trend values ( Ŷ ) is multiplied by
100, we are expressing the cyclical variation component as a percent of trend. Mathematically, we
express it as
(Y/ Ŷ ) * 100
In this measure, we take the ratio of the difference between the Y and the corresponding Ŷ values (that
is, Y - Ŷ ), and the Ŷ values. To express these values in terms of percentage we multiply them by 100.
In other words, the percentage deviation from the trend is found for all the values in the series.
1993 91 91 100.00 0 0
In 1989, the percentage of trend indicates that the actual sales were 92.77% of the expected sales for
that year.
For the same year, the relative cyclical residual indicates that the actual sales were 7.22% short of the
expected value.
Methods to measure accuracy of the fitted model
MAE=Mean |e(t)|
MSE=Mean {e(t)^2}
Since, both these methods are scale dependent, we cannot use them to compare series which are on
different scales.
i.e. Mean|p(t)|
where, p(t)=e(t)/y(t)*100
STATIONARY RANDOM SERIES
A strictly stationary stochastic process is one where given t1, . . ., tn; the joint
statistical distribution of Xt1 , . . ., Xtn is the same as the joint statistical
distribution of Xt1+τ, . . ., Xtℓ+τ for all ℓ and τ .
This is an extremely strong definition: it means that all moments of all degrees
(expectations, variances, third order and higher) of the process, anywhere are
the same. It also means that the joint distribution of (Xt , Xs) is the same as (Xt+r,
Xs+r) and hence cannot depend on s or t but only on the distance between s and
t, i.e. s − t.
Since the definition of strict stationarity is generally too strict for everyday life
a weaker definition of second order or weak stationarity is usually used.
Weak Stationarity or Covariance Stationarity means that mean and the
variance of a stochastic process do not depend on t (that is they are constant)
and the autocovariance between Xt and Xt+τ only can depend on the lag τ (τ is an
integer, the quantities also need to be finite). Hence for stationary processes,
{Xt}, the definition of autocovariance is
γ(τ ) = cov(Xt , Xt+τ ), for integers τ .
where "E" is the expected value operator. Note that this expression is not well-
defined for every time series or process, because the variance may be zero (for
a constant process) or infinite. If the function R is well-defined, its value must lie
in the range [−1, 1], with 1 indicating perfect correlation and −1 indicating
perfect anti-correlation.
If Xt is a wide-sense stationary process, then the mean μ and the variance σ2 are
time-independent, and further the autocorrelation depends only on the lag
between t and s: the correlation depends only on the time-distance between
the pair of values but not on their position in time. This further implies that the
autocorrelation can be expressed as a function of the time-lag, and that this
would be an even function of the lag τ = s − t. This gives the more familiar form
and the fact that this is an even function can be stated as
where μ is the mean of the series, the θ1, ..., θq are the parameters of the
model and the εt, εt−1,..., εt−q are white noise error terms.
Given a time series of data Xt, the ARMA model is a tool for understanding and,
perhaps, predicting future values in this series. The model consists of two parts,
an autoregressive (AR) part and a moving average (MA) part. The model is
usually then referred to as the ARMA (p, q) model where p is the order of the
autoregressive part and q is the order of the moving average part
The notation ARMA (p, q) refers to the model with p autoregressive terms
and q moving-average terms. This model contains the AR (p) and MA (q) models,