Beruflich Dokumente
Kultur Dokumente
Sivaramane, N.
Indian Agricultural Statistics Research Institute, New Delhi-110012
The trend component may be linear or quadratic or curvilinear. The process of removing the
trend in the original data is called detrending. Detrending may be accomplished either
93
8: Linear Time Series Analysis
Cycles can be observed in long time series data. Cycles may be related to business
phenomenon like business cycles or may be related to some biological phenomenon. Cycles
may be sometimes difficult to detect and hence ignored.
Seasonal components are common in a high frequency data. Seasonality may be based on
agricultural seasons like kharif, rabi and zaid or weather based seasons like summer autumn
spring and winter or it may be quarters or months, or any other periodicity within a year.
Generally seasonality is assumed to follow a definite pattern across years.
The unexplained part of the time series data or the residual left over after removing the
cyclical, trend and seasonality component of a time series data is called Irregular component.
Forecasting
Forecasting (or prediction) refers to the process of generating future values of a particular
event. Forecast is an important purpose of any time series analysis. Forecasting may be
performed either through quantitative methods with the application of simple or complicated
statistical procedure (exponential smoothing, ARIMA, etc.) or through simple guess or
opinions based on subjective and judgmental methods (Delphi method). Forecasting can also
be made through a mix of several approaches.
The focus of this training session will be on univariate time series models including
exponential smoothing models and Autoregressive Integrated Moving Averages (ARIMA).
Moving averages model also sometimes used for forecasting but its main purpose is to
smoothen the series. Any univariate technique holds good only for a short-run forecast.
94
8: Linear Time Series Analysis
However, relatively ARIMA produces forecasts for few more periods ahead as compared to
simple exponential smoothing model which gives forecast for a very short period.
Modeling Procedure involves (a) Training; (b) Validation and (c) Forecasting. A training data
set of approximately two-third of the original data set is used for training. The remaining one-
third of the data set is reserved for forecasting. Once the parameters are optimized, they are
used for the forecast process.
Naive model
Ft +i = Yt
The naïve model is useful and will perform most satisfactorily when the actual historical data
is very short and contains no systematic pattern, or a pattern that is changed very slowly.
Ft +i = Y
The mean forecast model will perform most satisfactorily when the actual historical data is
fluctuated around a constant or stationary value.
Ft +1 = Yt + average of changes
(ΔYt −1 + ΔYt )
Average of changes =
2
(ΔYt−1 +ΔYt )
Ft+1 =Yt +
2
Or the current predicted value is
95
8: Linear Time Series Analysis
(ΔYt −2 + ΔYt −1 )
Ft = Yt −1 +
2
where ΔYt = Yt − Yt −1
(ΔYt −1 / Yt −1 ) + (ΔYt / Yt )
Average of percent changes =
2
Moving Average
1. Simple moving average (SMA):
The idea of moving average is to find the trend of irregular data (smoothing the irregular
data for better visual). Assume that a future value will equal an average of past values:
(Yt −n + ... + Yt −3 + Yt −2 + Yt −1 )
Ft = SMA(n) t =
n
Where Y is the actual value of a series, and F is the forecasted value. An n-period moving
average denotes that each new forecast moves ahead one period by adding the newest
actual and dropping the oldest actual.
(Yt −4 + Yt −3 + Yt −2 + Yt −1 )
Ft = SMAt =
4
(Yt −5 + Yt −4 + Yt −3 + Yt −2 )
Ft −1 = SMAt −1 =
4
… …
(Yt −k −4 + Yt −k −3 + Yt −k −2 + Yt −k −1 )
Ft −k = SMAt −k =
4
Therefore, a forecast series of simple moving average, SMAt or Ft, is constructed. The
forecast error is et = Yt − Ft
The accuracy of different models by choosing different average periods is to minimize the
errors. In order to compare the accuracy of different models, some criterions are commonly
used:
96
8: Linear Time Series Analysis
n −1
In general, the optimal number of periods to have in a SMA is that the number minimizing
the RSE. For examples, a four-period average only has a memory of four past periods, and an
eight-period average only remembers eight past observations. A long-period SMA yields the
lowest RSE when a series is very random and erratic. A short-period SMA will yield a lowest
RSE when a series is random but moves smoothly up and down. (This series is also implied
with highly autocorrelation).
Advantage: It smoothes large random variations, it is less influenced by the outliers than
the method of the first differences.
Disadvantage: It does not model the seasonality of the series. Also, there is problem of
determining the optimal number of periods.
97
8: Linear Time Series Analysis
For example: When the price level goes up as well as the MA curve goes up, it indicates the
market has an upward trend. But when the market has a sudden drop, and the MA is still
continue to go up, therefore, the MA has its function to indicate the market should has some
supporting points for the price to reverse or drop. Therefore, the MA provides an alarm
signal for the market to turn upward or downward.
Price
buy
MA
HSPI
sell
Time
In general, the best MA (N) model is the one that provides the minimum SSE or RSE.
It is because the most important general objective in forecasting is to decrease the width of
confidence intervals used to make probability statement about future value.
Actual = Forecast +/- Z*RMSE
A longer period moving average yields the lowest RSE when a series is very random and
erratic or pattern-less (no high autocorrelation). However, if the series is a random and moves
smoothly up and down, that is random walk (high autocorrelation), a short period MA will
yield a lower RSE. Generally, moving average models work well with pattern-less time
series which has not a trend or seasonality in it.
98
8: Linear Time Series Analysis
Advantages: The weights placed on past can be varied. However, a determination of the
optimal weights can be costly. This type of model is most useful when the historical data are
characterized by period-to-period changes that are approximately the same size.
Limitations of the WMA models: They do not model seasonality and trend. It is very
difficult to determine the optimal number of periods because the RSE may not be the best
critical values and costly to determine the optimal weight. Therefore the WMA is not
frequently used.
Ft = α Yt−1 + (1−α)Ft−1
(The current forecast equals to a weighted average of the most recent actual value and the
most recent forecasted value. The first actual value is chosen as the forecast for the second
period.)
Where α always lies between zero (fully smoothened ie. Horizontal line) and one (no
smoothing), the best α should be the one that minimize the criteria eg. RMSE. If greater
weight is to be given to the most recent actual value, a high smoothing constant is chosen.
This refers to as Low Smoothing.
When α =1 provides no smoothing because the forecast equals the most recent actual value.
This refers to zero smoothing and becomes a one–period MA (Naïve model).
Principles to determine α in the SES:
(1) For random and pattern-less and erratic time series data, use a larger value of α.
(2) For random walk (randomly and smoothly walks up and down without any repeating
patterns) time series data, use a smaller value of α.
(3) A greater amount of smoothing is desired,
99
8: Linear Time Series Analysis
∞
Ft = α ∑ (1 − α ) s Yt −s−1 Where (1-α)∞Ft-∞ =0
s =0
It simply states that the forecast in t-period is equal to a weighted average of all past actual
values and one initial forecast (closer to zero).
∞
α
All weight will be summed to 1 since α ∑ (1 − α ) S = =1
S =0 1 − (1 − α )
100
8: Linear Time Series Analysis
α
bt = ( S t' − S t'' )
1−α
Where bt is the estimated trend of the end of period t.
Same as the SES, the Double smoothing estimation also requires a starting value to initialize
the formulas. The common methods for estimating the starting values for Brown’s
exponential smoothing are as follows:
(Y2 − Y1 ) + (Y4 − Y3 )
Let S t' = S t'' = Y1 ; a1 = Y1 ; bt =
2
The choice of the initialization value can greatly affect the fits and forecasts.
Disadvantages: There is some loss of flexibility due to the best smoothing constant for
the level and trend may not be equal.
It does not model the seasonality of a series.
This model uses a second smoothing constant, β, to separately smooth the linear trend. The
exponential smoothing value at end of time period t is
101
8: Linear Time Series Analysis
102
8: Linear Time Series Analysis
Yt
The seasonality estimate: SI t = γ + (1 − γ ) SI t − s
St
In this equation, the trend is additive and the seasonal influences is multiplicative. Therefore,
alternative models can also be applied as follows:
Initial values of b1, S1, and SI1 to SI12 can be estimated by using the seasonal indexes
decomposition method and the trend line from the percent moving average method of
previous discussed method. Alternatively, a regression decomposition method might also be
used to determine these initial values.
Data requirements: At least 36 months for three seasons of monthly data, or 16-20 quarters
for four to five seasons of quarterly data, or 156 weeks for three seasons of weekly data.
Advantages: Winter’s method provides alternative way to adjust the randomness, trend, and
seasonality in a model when the data have a seasonal pattern. Particular, the seasonal factor is
calculated for the next cycle of forecasting and used to forecast values one or more seasonal
cycles ahead. And the seasonal indexes are easily interpreted.
Disadvantages: Difficult to determine the initialize values of α, β, and γ. It is too complex for
data does not have identified trends and seasonality. Outliers can have a very large effect on
forecast.
103
8: Linear Time Series Analysis
Ft = α tYt + (1 − α t ) Ft −1 OR Ft = Ft −1 + α t (Yt −1 − Ft −1 )
The basic equation is similar to SES except that α is replaced by αt Where αt is called
adaptive alpha and it value is between 1 and 0. The adaptive response rate, α, is the ratio of
the absolute value of mean forecast error (ME) and the mean absolute forecast error (MAE),
and α is called as “tracking signal” because it tracks errors over time.
At
αt = ; At = β ( Et ) + (1 − β ) At −1
Mt
M t = β (Yt − Ft ) + (1 − β ) M t −1 where Et = Yt − Ft
If the model is forecasting accurately, ‘A’ will be nearly equal to zero and the ratio αt will
therefore be low. However, if the model consistently under or over-forecasts A will approach
the value M, and α will equal one.
Advantages: Capable of representing almost all data patterns, the value of αt change
automatically whenever a change in the data pattern dictates that a change is desire.
Limitations: It does not work well for the data that is very randomly and low autocorrelation.
The process of re-computing the necessary statistics each time when new
observations become available is relatively cumbersome. The forecasts from this
technique lag turning points by one period, that is, it does not anticipate turning
points in the forecasted time series.
References
104
8: Linear Time Series Analysis
105