Vous êtes sur la page 1sur 5

5/31/2011 Time Series - Introduction

Contents

Time Series

Introduction

Time series is a set of observations generated sequentially in time. If the set is continuous then the time series is
continuous. If the set is discrete then the time series is discrete.

See the plot below. It is drawn from a data of monthly bookings for an airline. This data is a time series.

The usage of time series models is twofold:

Obtain an understanding of the underlying forces and structure that produced the
observed data
Fit a model and proceed to forecasting and monitoring.

XLMiner� analyzes Univariate Discrete Time Series. It uses several techniques for exploring and forecasting time
series data.

Exploratory techniques : We use these techniques as a beginning. Some conclusions can be drawn by just
observing the plots drawn using these techniques. XLMiner� uses ACF (Autocorrelation function) and PACF (Partial
autocorrelation function) as exploratory techniques. These techniques help the user to explore various patterns in
data and this information can be used in model building.

ACF : Autocorrelation is the correlation between observations of a time series separated by say, k time units.
Suppose there are n time based observations, X1, X 2, X 3, ....., X n. In ACF technique XLMiner� finds correlation
between the observations for different lags.

Eg. when lag=1, XLMiner� creates the following two sets and finds a value of correlation.

X Y
X0 X1
X1 X2
resample.com/…/Timeseries_intro.htm 1/5
5/31/2011 Time Series - Introduction
X2 X3
...
Xn-1 Xn

Lag=2 gives another such table and one more value of correlation.

X Y
X0 X2
X1 X3
X2 X4
...
Xn-2 Xn

This way we get a lot of sets and plot them. See the following plot.

In this plot, UCL : Upper confidence level and LCL : Lower confidence level. If the data is random then the plot should
be within the UCL and LCL. If it goes beyond UCL or LCL, as seen in the plot above then we conclude that some
correlation exists in the data.

PACF : PACF technique is used to compute and plot the partial autocorrelations of a time series. With PACF we can
find correlation between some components of the series, eliminating the contribution of other components. PACF
technique measures the strength of relationship with other terms being accounted for.

XLMiner� applies these techniques and shows the plots. For this it is good to partition the data into training and
validation sets.

Partitioning : XLMiner� provides the utility to partition the time series data. This partitioning is not random. We can
visually see the plots of Training and Validation data and decide whether to fit the model. For fitting a model, the
Training and Validation sets should exhibit the same pattern.

Smoothing and Forecasting :

The data taken over time are likely to show some form of random variation. "Smoothing techniques" are used to
reduce or cancel the effect due to these variations. These techniques, when properly applied, reveal more clearly the
underlying trends.

XLMiner� uses the following smoothing techniques :-

Moving average smoothing : In this technique equal weight is assumed to each observation. Further observations
resample.com/…/Timeseries_intro.htm 2/5
5/31/2011 Time Series - Introduction
are forecasted by taking average of earlier observations. These can be earlier two or three observations. Thus, if we
have a time series X 1, X 2, X3, ....., X t then we predict X t+k as follows :

S t = Average (xt-k+1, xt-k+2, ....., xt), t= k, k+1, k+2, ...N

In this model k is the smoothing parameter. We can specify this parameter. The forecast is calculated
as follows :

X t+k = S t , k= 1, 2, 3, ... ,

if we think past three observations are enough to predict the next observations. Moving Average technique is not
effective if we suspect a trend in the series.

Exponential smoothing : This is a very popular scheme to produce a smoothed Time Series. Exponential
Smoothing assigns exponentially decreasing weights as the observations get older. In other words, recent
observations are given relatively more weight in forecasting than the older observations.

In this smoothing technique, a calculated S i stands for smoothed observation for xi which stands for the original
observation. The subscripts refer to the time periods, 1, 2, ..., n. For the third period, S 3 =  x3 + (1-) S 2; and so
on. There is no S 1; the smoothed series starts with the smoothed version of the second observation.

For any time period t, the smoothed value S t is found by computing

S t =  xt + (1-)
S t-1 0<  <= 1
; t >= 3

This is the basic equation of exponential smoothing and the constant or parameter  is called the smoothing
constant. If we substitute the value of S t-1 in the above formula then we get exponents of , so the name exponential
smoothing. In exponential smoothing there are one or more smoothing parameters to be determined (or estimated)
and these choices determine the weights assigned to the observations. Again, exponential smoothing is useful when
there is no trend. The forecast will be a constant which is the smoothened value of the last observation. So, a limited
number of forecasts is recommended.

Double exponential smoothing : Double exponential smoothing is defined as Exponential smoothing of Exponential
smoothing. Exponential smoothing does not excel in following the data when there is a trend. This situation can be
improved by the introduction of a second equation with a second constant, , the trend component, which must be
chosen in conjunction with , the mean component. Double exponential smoothing is defined in the following manner
:

S t = At + Bt , t = 1,2,3,..., N

Where, At = Xt + (1- ) S t-1 0<  <= 1

Bt =  (At - At-1) + (1 -  ) Bt-1 0< <= 1

So, the forecast will be X t+k = At + K Bt , K = 1, 2, 3, ...

In the above equations the parameter is for level and is for trend. If we do not know  and  , we should do trials
with them. Initial values of At and Bt are calculated using linear regression over time. XLMiner� tries various values
and gives that optimal value for which the Forecasting mean square error (FMSE) is low. So we can conclude that
this smoothing method is equivalent to exponential smoothing if 0.

Holt Winters' smoothing : What happens if the data show trend as well as seasonality? In this case double
exponential smoothing will not work. We now introduce a third parameter,  to take care of seasonality (sometimes
resample.com/…/Timeseries_intro.htm 3/5
5/31/2011 Time Series - Introduction
called periodicity). The resulting set of equations is called the Holt-Winters method after the names of the inventors.
Thus Holt Winters method catches level, trend and seasonality (,  , ), all these parameters have values ranging
between 0 and 1. There are three models associated with this method :

Multiplicative : X t = (A+ Bt)* S t + t A and B are previously calculated initial estimates. S t is the average seasonal
factor for tth season.

Additive : X t = (A+ Bt) +SNt +  t

No Trend :  = 0, so, X t = A * SNt + t

This means that Holt Winters' smoothing is similar to exponential smoothing if and  = 0. It will be similar to double
exponential smoothing if  = 0.

Model Building :

This is a parametric approach. We device a tentative model based on the exploratory analyses. When it comes to
fitting a model, ARMA (AutoRegression and Moving Average integrated) models are generally popular.

The ARMA model is expressed as ARMA (p,q) where

p = Number of autoregressive
parameters and

q = Number of moving average


parameters.

It is defined as,

Xt =  1Xt-1 +  2Xt-2 + ........ + pXt-p - 1 t-1 - 2 t-2 - .... - q t-q +  t

The basic assumption in estimating the ARMA coefficients is that the data are stationary, that is, the trend or
seasonality can not affect variance. This is generally not so. To achieve the stationary data we use differencing ..
ordinary, seasonal or both. XLMiner� performs this differencing for us so the resulting model is --

ARIMA (p, d, q) (P, D, Q) S

Where,

�p� : Number of �ordinary� AR


parameters. (AR : Autoregressive)
�d� : Number of �ordinary�
differences.
�q� : Number of �ordinary� MA
parameters. (MA : Moving average)
�P�: Number of �seasonal� AR
parameters.
�D�: Number of �seasonal�
differences.
�Q�: Number of �seasonal� MA
parameters.
�S�: Period (Seasonality in data.)

After XLMiner� fits the model it shows various results. We can decide the quality of our model by taking a look at the
resample.com/…/Timeseries_intro.htm 4/5
5/31/2011 Time Series - Introduction
Time plot of actual values Vs forecast. If both the curves are close enough then the model is good. The model should
explain the trend and seasonality, if any. XLMiner� fits the model and shows the results. If the residuals are random
then our model is good. If they show some trend then we need to refine the model.

If we fit ARIMA (0,1,1) the result is same as exponential smoothing. ARIMA (0,2,2) works same as double
exponential smoothing.

See also

Using Time Series in XLMiner�


Examples - Time Series

resample.com/…/Timeseries_intro.htm 5/5

Vous aimerez peut-être aussi