Download as pdf or txt
Download as pdf or txt
You are on page 1of 87

TIME SERIES ANALYSIS

FOR
FORECASTING

Rupika Abeynayake
Professor in Applied Statistics
Introduction
 Frequently there is a time lag between awareness of an impending
event or need and occurrence of the event

 This lead-time is the main reason for planning and forecasting. If


the lead-time is zero or very small, there is no need for planning

 If the lead-time is long, and the outcome of the final event is


conditional on identifiable factors, planning can perform an
important role

 In management and administrative situations the need for


planning is great because the lead-time for decision making
ranges from several years to a few days or hours to a few second.
Therefore, forecasting is an important aid in effective and
efficient planning
Introduction…

 Forecasting is a prediction of what will occur in the future, and it


is an uncertain process

 One of the most powerful methodologies for generating forecasts


is time series analysis

 A data set containing observations on a single phenomenon


observed over multiple time periods is called time-series. In time
series data, both values and the ordering of the data points have
meaning. For many agricultural products, data are usually
collected over time
Introduction

 Time series analysis and its applications have become


increasingly important in various fields of research, such as
business, economics, agriculture, engineering, medicine, social
sciences, politics etc.

 Realization of the fact that “ Time is Money " in business


activities, the time series analysis techniques presented here,
would be a necessary tool for applying to a wide range of
managerial decisions successfully where time and money are
directly related
Forecasting scenario

 On the time scale we are standing at a certain point called the


point of reference (Yt) and we look backward over past
observations (Yt-1, Yt-2,…,Yt-n+1) and foreword into the future
(Ft+1, Ft+2, …,Ft+m)

 Once a forecasting model has been selected, we fit the model


to the known data and obtain the fitted values. For the known
observations this allows calculation fitted errors (Yt-1- Ft-1)

 A measure of goodness-of-fit of the model and as new


observations become available we can examine forecasting
errors (Yt+1- Ft+1)
Measuring Forecast accuracy
1 n
Mean error : ME   e t
n t 1
1 n
Mean absolute error : MAE   | e t |
n t 1
1 n 2
Mean squared error : MSE   | e t |
n t 1

Percentage error (PE) : PEt = 100*(Yt - Ft )/Yt

1 n
Mean percentage error (MPE) : MPE   PE t
n t 1

1 n
Mean absolute percentage error (MAPE) : MAPE   | PE t |
n t 1
Main components of time series data

There are four types of components in time series analysis

Seasonal component (S)


Trend component (T) Yt = St , Tt , Ct , I
Cyclical component (C)
Irregular component ( I )

Time Series Seasonal Trend removal Cyclical


Yt=S,T,C, I removing using using removing using I
smoothing regression % ratio
Moving averages
 Smoothing techniques are used to reduce irregularities (random
fluctuations) in time series data

 Moving averages rank among the most popular techniques for the
preprocessing of time series. They are used to filter random "white
noise" from the data, to make the time series smoother

 There are several methods of Moving averages

 Simple Moving Averages

 Double moving averages

 Centered Moving Average

 Weighted Moving Average


Simple Moving Averages

 Moving Averages (MA) is effective and efficient approach provided


the time series is stationary in both mean and variance

 The simple moving average required an odd number of observations


to be included in each average at the middle of the data value being
averaged

 Takes a certain number of past periods and add them together; then
divide by the number of periods gives the simple moving average

 The following formula is used in finding the moving average of


order n, MA(n) for a period t+1

MAt+1 = [Yt + Yt-1 + ... +Yt-n+1] / n


Example
Month Time Observed Three-month Five-month
period values moving moving
average 3 MA average 5 MA
Jan 1 266.0 - -
Fab 2 145.9 - -
Mar 3 183.1 - -
Apr 4 119.3 198.333 -
May 5 180.3 149.433 -
Jun 6 168.5 160.900 178.92
Jul 7 231.8 156.033 159.42
Aug 8 224.5 193.533 176.60
Sep 9 192.8 208.267 184.88
Oct 10 122.9 216.367 199.58
Nov 11 336.5 180.067 188.10
Dec 12 185.9 217.400 221.70
Jan 13 194.3 215.100
. 212.52
Feb 14 149.5 238.900
. .
206.48
Example…

Moving Average

350 Actual
Smoothed
Forecast
Actual
250 Smoothed
Forecast
Obs

150 Moving Average


Length: 3

MAPE: 32.03
50 MAD: 57.39
MSD: 5165.47

0 10 20
Time
Example…

Moving Average

Actual
Smoothed
300 Forecast
Actual
Smoothed
Forecast
Obs

200
Moving Average
Length: 5

100 MAPE: 26.23


MAD: 52.74
MSD: 4496.37

0 10 20
Time
1Centered Moving Average

 Suppose we wish to calculate a moving average with an even


number of observations for example, to calculate a 4-term
moving average or 4 MA for, the data

 The center of the fist moving average is at 2.5 while the center
of the second moving average is at 3.5

 The average of the two moving averages is centered at 4

 Therefore, this problem can be overcome by taking an


additional 2-period moving average of the 4-period moving
average

 This centered moving average is denoted as 2 X 4 MA


2.1Example
Month Time Observed Four-month 2 X 4 MA
period values moving
average 4 MA
Jan 1 266.0 - -
Fab 2 145.9 178.6 -
Mar 3 183.1 157.6 -
Apr 4 119.3 162.8 -
167.863
May 5 180.3 174.9 -
Jun 6 168.5 201.3 167.863
Jul 7 231.8 204.4 159.975
Aug 8 224.5 193.0 168.887
Sep 9 192.8 219.2 188.125
Oct 10 122.9 209.5 202.837
Nov 11 336.5 209.9 198.700
Dec 12 185.9 216.6 206.088
Jan 13 194.3 . 214.350
Feb 14 149.5 . 209.712
Weighted Moving Average
 This method is very powerful with comparing simple moving
averages

 Weighted MA(3) can be expressed as,

Weighted MA(3) = w1.Yt + w2.Yt-1 + w3.Yt-2

where w1, w2, & w3 are weights

 There are many schemes selecting appropriate weights (Kendall,


Stuart, and Ord (1983)

 Weights are any positive numbers such that,

w1 + w2 + w3 = 1

 One of the methods of calculating weights is,

w1 = 3/(1 + 2 + 3) = 3/6, w2 = 2/6, and w3 = 1/6


2.Exponential Smoothing Techniques

 One of the most successful forecasting methods is the exponential


smoothing (ES)

 ES is an averaging technique that uses unequal weights and assigns


exponentially decreasing weights as the observations get older

 There are several exponential smoothing techniques

Single Exponential Smoothing


Holt’s linear method
Holt-Winters’ trend and seasonality method
Single Exponential Smoothing
 The method of single exponential forecasting takes the
forecast for the previous period and adjust it using the
forecast error. [(Forecast error = (Yt – Ft)]

Ft+1 = Ft + a (Yt - Ft)


Ft+1 = a Yt + (1 - a) Ft
where:
Yt is the actual value
Ft is the forecasted value
a is the weighting factor, which ranges from 0 to 1
t is the current time period
Choosing the Best Value for Parameter a (alpha)

 In practice, the smoothing parameter is often chosen by a grid


search of the parameter space

 That is, different solutions for = 0.1 to are tried starting with
0.9, with increments of 0.1.

 Then is chosen so as to produce the smallest sums of squares (or


mean squares) for the residuals.
Month Time Observed Exponentially Smoothed values
period values
a = 0.1 a = 0.5 a = 0.9
Jan 1 200.0

Feb 2 135.0 200.0 200.0 200.0

Mar 3 195.0 193.5 167.5 141.5

Apr 4 197.5 193.7 181.3 189.7

May 5 310.0 194.0 189.4 196.7

Jun 6 175.0 205.6 249.7 298.7

Jul 7 155.0 202.6 212.3 187.4

Aug 8 130.0 197.8 183.7 158.2

Sep 9 220.0 191.0 156.8 132.8

Oct 10 277.5 193.9 188.4 211.3

Nov 11 235.0 202.3 233.0 270.9

Dec 12 - 205.6 234.0 238.6


Analysis of Errors (Test period : 2 – 11)

a = 0.1 a = 0.5 a = 0.9

Mean Error 5.56 6.80 4.29

Mean Absolute Error 47.76 56.94 61.32

Mean Absolute percentage Error 24.58 29.20 30.81


(MAPE)

Mean Square Error (MSE) 3438.33 4347.24 5039.37

Theil’s U-statistics 0.81 0.92 0.98


Time Series Plots

350

300

250
Observed values
Shipments

200 SES = 0.1

150 SES = 0.5


SES = 0.9
100

50

0
1 2 3 4 5 6 7 8 9 10 11 12

Month
Holt’s linear method
 Holt (1957) extended single exponential smoothing to linear
exponential smoothing to allow forecasting of data with trends

 The forecast for Hollt’s linear exponential smoothing is found


using two smoothing constants, a and  (values between 0 & 1),
and three equations

Lt  aYt  (1  a )( Lt 1  bt 1 ) Smoothing of data

bt   ( Lt  Lt 1 )  (1   )bt 1 Smoothing of trend

Ft  m  Lt  bt m Forecast for m period a head

The initialization process : L1 = Y1 and


b1 = Y2 – Y1 or b1 = (Y4-Y1) / 3
Holt-Winters’ trend and seasonality method
 Holt’s method was extended by Winters (1960) to capture
seasonality

 The Holt-Winter’s method is based on three smoothing equations,


one for level, one for trend, and one for seasonality

Yt
Lt  a  (1  a )( Lt 1  bt 1 ) Level
S t s
bt   ( Lt  Lt 1 )  (1   )bt 1 Trend
Yt
St    (1   ) S t  s Seasonal
Lt
Ft m  ( Lt  bt m)S t  s  m Forecast
Example…

Winters' Multiplicative Model for Yt

Actual
700
Predicted

600 Forecast
Actual
Predicted
500
Forecast
Yt

400
Smoothing Constants
Alpha (level): 0.200
300
Gamma (trend): 0.200
Delta (season): 0.200
200
MAPE: 5.163
MAD: 12.557
100
MSD: 356.695

0 50 100 150
Time
Seasonal Factor
Ratio-to-moving-average

Season Sales Average Sales Seasonal


Factor
Spring 200 250 200/250 = 0.8

Summer 350 250 350/250 = 1.4

Fall 300 250 300/250 = 1.2

Winter 150 250 150/250 = 0.6

Total 1000 1000


If Next year expected sale increment is 10%

Season Average Sales Next Year FORECAST


(1100/4) Forecast
Spring 275 275*0.8 220

Summer 275 275*1.4 385

Fall 275 275*1.2 330

Winter 275 275*0.6 165

Total 1100 1100


The table below represent the Quarterly sales
Figures

Year Q1 Q2 Q3 Q4

2008 20 30 39 60

2009 40 51 62 81

2010 50 64 74 85
Time Quarter Time Sales Centered Sales/MA*100
Period index MA (4)

2008 Q1 1 20
2008 Q2 2 30
2008 Q3 3 39
2008 Q4 4 60 39.750 150.943
2009 Q1 5 40 44.875 89.136
2009 Q2 6 51 50.375 101.241
2009 Q3 7 62 55.875 110.962
2009 Q4 8 81 59.750 135.565
2010 Q1 9 50 62.625 79.840
2010 Q2 10 64 65.750 97.338
2010 Q3 11 74 67.750 109.225
2010 Q4 12 85
Year Q1 Q2 Q3 Q4
2008 150.94
2009 89.14 101.24 110.96 135.56
2010 79.84 97.33 109.22
Mean 84.49 99.29 110.095 143.25 437.125
AF 0.915 0.915 0.915 0.915
Seasonal 77.3085 90.85 100.736 131.0737 399.9693
Index

Adjusted Factor (AF) = 400/437.125=0.915


Component Analysis

Original Data Detrended Data


600 1.4
1.3
500 1.2
1.1
400 1.0
0.9
300
0.8
200 0.7
0.6
100 0.5
0 50 100 150 0 50 100 150

Seasonally Adjusted Data Seasonally Adj. and Detrended Data


500 50

400
0

300
-50
200
-100
100
0 50 100 150 0 50 100 150
General overview of forecasting techniques

Classification of the widely used Forecasting


Techniques

Causal Smoothing Time Series


Model Techniques Model
Model

Regression Moving averages Box-Jenkins


Analysis and Exponential Processes
Smoothing
Techniques
Box-Jenkins ARIMA Plot series

models (1970)
No
Is variance Apply
stable transformation
Yes
Obtain ACFs and
PACFs

No Apply regular and


Is mean
seasonal
stable
differencing
Yes
Model selection

Estimate parameter values

Are residual
Box-Jenkins Modeling
Modify Model uncorrelated Approach to Forecasting
No
Yes

Are parameters
significant

Yes
Forecasting
Autocorrelation function
 The key statistics in time series analysis is the autocorrelation
coefficient (or the correlation of the time series with itself, lagged by
1, 2, or more periods), which is given by the following formula

 (Y t  Y )(Yt  K  Y )
rk  t  k 1
n

 (Y
t 1
t  Y )2

 Then r1 indicates how successive values of Y relate to each other, r2


indicates how Y values two period apart relate to each other, and so on

 Autocorrelations at lags 1, 2, …, make up the autocorrelation function


or ACF
Partial autocorrelation function

 Partial autocorrelations are used to measure the degrees of


association between Yt and Yt-k, when the effects of other time
lags 1, 2, 3,…,k-1 are removed

 Suppose there was a significant autocorrelation between Yt and


Yt-1. Then there will also be a significant correlation between Yt-1
and Yt-2 since they are also one time unit apart

 Consequently, there will be a correlation between Yt and Yt-2


because both are related to Yt-1
 So, to measure the real correlation between Yt and Yt-2, we need to
take out the effect of the intervening value Yt-1. This is what partial
autocorrelation does.
Autocorrelation function

Y Y t-1 Yt-Ӯ Yt-1- Ӯ (Yt-Ӯ)( Yt-1- Ӯ) (Yt-Ӯ) (Yt-Ӯ)


2 -4 16
3 2 -3 -4 12 9
5 3 -1 -3 3 1
7 5 1 -1 -1 1
9 7 3 1 3 9
10 9 4 3 12 16
Total 29 52

n
 (Yt  Y)(Yt K  Y) 29
rk  t  k 1
n
  0.557692
52
 (Yt  Y) 2
t 1
Sampling distribution of Auto Correlation
Portmanteau Tests (317)
An alternative to this would be to examine a whole set of rk values,
say the first 10 of them (r1 to r10) all at once and then test to see
whether the set is significantly different from a zero set. Such a test
is known as a portmanteau test, and the two most common are the
Box-Pierce test and the Ljung-Box Q* statistic..

The Box-Pierce Test

Here is the Box-Pierce formula:


Checking for Error Autocorrelation
• Test: Durbin-Watson statistic: k is number
of parameters in the model subtract one

d   i 2i 1 , for n and K d.f.


(e  e ) 2

 ei

Positive Zone of No Autocorrelation Zone of Negative


autocorrelation indecision indecision autocorrelation
|_______________|__________________|_____________|_____________|__________________|___________________|
0 d-lower d-upper 2 4-d-upper 4-d-lower

Autocorrelation is clearly evident


Ambiguous – cannot rule out autocorrelation
Autocorrelation in not evident
• Value near 2 indicates non-autocorrelation

• Value toward 0 indicates positive autocorrelation

• Value toward 4 indicates negative autocorrelation


To test for positive autocorrelation at significance α,
the test statistic d is compared to lower and upper
critical values (dL,α and dU,α):

•If d < dL,α, there is statistical evidence that the error


terms are positively autocorrelated

•If d > dU,α, there is no statistical evidence that the


error terms are positively autocorrelated

•If dL,α < d < dU,α, the test is inconclusive

Positive serial correlation is serial correlation in which


a positive error for one observation increases the
chances of a positive error for another observation
To test for negative autocorrelation at significance α, the
test statistic (4 − d) is compared to lower and upper
critical values (dL,α and dU,α):

•If (4 − d) < dL,α, there is statistical evidence that the


error terms are negatively autocorrelated.

•If (4 − d) > dU,α, there is no statistical evidence that the


error terms are negatively autocorrelated.

•If dL,α < (4 − d) < dU,α, the test is inconclusive.


Stationary of the time series data
There is no growth or decline in the data. The data must be
roughly horizontal along the time axis. In other words the data
fluctuate around a constant mean, independent of time and the
variance of the fluctuation remain essentially constant over time.

1.0

0.5

ACF
0.0

-0.5

-1.0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Lag Number

A series stationary in mean ACF for non-stationary time


and variance series data
Non-stationary of the time series data

A series non-stationary in mean A series non-stationary in mean


and variance
Unit Roots
• Consider an AR(1) model:
yt = a1yt-1 + εt (eq. 1)
εt ~ N(0, ζ2)
• Rewrite equation 1 by subtracting yt-1 from
both sides:
yt – yt-1 = a1yt-1 – yt-1 + εt (eq. 2)
Δyt = δ yt-1 + εt
δ = (a1 – 1)
Unit Roots
• H0: δ = 0 (there is a unit root) not stationary
• HA: δ ≠ 0 (there is not a unit root) stationary
• If δ = 0, then we can rewrite equation 2 as
Δyt = εt

Thus first differences of a random walk time series are


stationary, because by assumption, εt is purely
random.
In general, a time series must be differenced d times to
become stationary; it is integrated of order d or I(d).
A stationary series is I(0). A random walk series is
I(1).
Tests for Unit Roots
• Dickey-Fuller test
– Estimates a regression equation
– The usual t-statistic is not valid, thus D-F
developed appropriate critical values.
– You can include a constant, trend, or both in the
test.
– If you accept the null hypothesis, you conclude
that the time series has a unit root.
– In that case, you should first difference the
series before proceeding with analysis.
Tests for Unit Roots
• Augmented Dickey-Fuller test
– We can use this version if we suspect there is autocorrelation in
the residuals.
– This model is the same as the DF test, but includes lags of the
residuals too.
• Phillips-Perron test
– Makes milder assumptions concerning the error term, allowing
for the εt to be weakly dependent and heterogenously
distributed.
• Other tests include Variance Ratio test, Modified
Rescaled Range test, & KPSS test.
• There are also unit root tests for panel data (Levin et al
2002).
Removing the non-stationary in a time series
 One way of removing non-stationarity is through the method of
differencing

 Differenced series can be expressed as

Yt '  Yt  Yt 1
Yt '  The differenced series will have only n-1 values since it is not possible
Yt '
to calculate a difference for the first observation

 With seasonal data, which is non-stationary, it may be appropriate to


take seasonal differences. A seasonal difference is the difference
between an observation and the corresponding observation from the
previous year. So for monthly data having an annual 12-month pattern

Yt  Yt  Yt 12
'
Backshift Notation
• A very useful notational device is the backward
shift operator, B which is used as follows:

BYt  Yt 1

• B operating on Yt , has the effect on shifting


the data back one period
Therefore,

BYt  Yt 1 B( BYt )  B Yt  Yt 2
2

B Yt  Yt 2
2

B Yt  Yt 3
3

B Yt  Yt d
d
Yt '  Yt  Yt 1 First Difference

Yt  Yt  BYt
'

Yt  (1  B)Yt
'

Yt  (1  B)Yt
'
Second Difference Third Difference

 Yt  Yt  2  (1  B )Yt
3

 Yt  B Yt2

 (1  B )Yt
2
First Order Difference

Yt  Yt  Yt 1
'

Yt  Yt  BYt
'

Yt '  (1  B)Yt
Yt  (Yt  Y )
'' ' '
t 1
Second Order Difference
Yt ''  (Yt  Yt 1 )  (Yt 1  Yt 2 )

Yt  Yt  Yt 1  Yt 1  Yt 2
''

Yt  Yt  2Yt 1  Yt 2
''

Yt ''  Yt  2BYt  B 2Yt

Yt  (1  2B  B )Yt
'' 2

Yt ''  (1  B) 2 Yt
Linear time series models

AR (p)  ARIMA (p,0,0) : Yt  C  1Yt 1  2Yt 2  3Yt 3  ...   pYt  p   t

MA (q)  ARIMA (0,0,q) : Yt  C  1 t 1   2 t 2   3 t 3  ...   q  t q   t

ARMA (p,q) : Yt  C  1Yt 1  2Yt 2  ...   pYt  p    1 t 1   2 t 2  ...   q t q

ARIMA (p,d,q) :  Yt  (1  B)  t
d d

ARIMA (p,1,q) : (1  1 B)(1  B)Yt  C  (1  1 B) t

where B is Back shift notation ( BYt = Y t-1)


ARIMA models for time series data

 The general model introduced by Box and Jenkins (1970) includes


autoregressive as well as moving average parameters, and explicitly
includes differencing in the formulation of the model

 In the notation introduced by Box and Jenkins, models are


summarized as ARIMA (p, d, q)

 Three types of parameters in the model are:


autoregressive parameters (p), number of differencing passes (d), and
moving average parameters (q)

 For example, a model described as (0, 1, 2) means that it contains 0


(zero) autoregressive and 2 moving average which were computed
for the series after it was differenced once
Estimation of parameters

 It is needed to decide on (identify) the specific number and type of


ARIMA parameters to be estimated

 The major tools used in the identification phase are plots of the
series, correlograms of auto correlation (ACF), and partial
autocorrelation (PACF)

 A majority of empirical time series patterns can be sufficiently


approximated using one of the 5 basic models that can be
identified based on the shape of the autocorrelogram (ACF) and
partial auto correlogram (PACF)
Estimation of parameters…
AR(1): ACF - exponential decay; PACF - spike at lag 1, no
correlation for other lags

AR(2): ACF - a sine-wave shape pattern or a set of exponential


decays; PACF - spikes at lags 1 and 2, no correlation for
other lags

MA(1): ACF - spike at lag 1, no correlation for other lags; PACF


- damps out exponentially

MA(2) : ACF - spikes at lags 1 and 2, no correlation for other lags;


PACF - a sine-wave shape pattern or a set of exponential
decays

ARMA(1.1): ACF - exponential decay starting at lag 1; PACF -


exponential decay starting at lag 1
ACF and PACF functions AR (1) models
Autocorrelation Partial autocorrelation

ACF and PACF for AR(1) and  > 0 model

Partial autocorrelation
Autocorrelation

ACF and PACF for AR(1) and  < 0 model


ACF and PACF functions MA (1) model
Autocorrelation Partial autocorrelation

PACF for MA(1) and  < 0 model

Partial autocorrelation
Autocorrelation

ACF and PACF for MA(1) and  > 0 model


Seasonal models

 In addition to the non-seasonal parameters, seasonal parameters


for a specified lag need to be estimated

 Analogous to the simple ARIMA parameters, these are:


seasonal autoregressive (Ps), seasonal differencing (Ds), and
seasonal moving average parameters (Qs) and seasonal models are
summarized as ARIMA (p, d, q) (P, D, Q)

 For example, the model (0,1,2)(0,1,1) describes a model that


includes no autoregressive parameters, 2 regular moving average
parameters and 1 seasonal moving average parameter, and these
parameters were computed for the series after it was differenced
once with lag 1, and once seasonally differenced
Seasonal models…

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

(1  1B)(1  φ1B S )(1  B)(1  B S )Yt  (1  1B)(1  1B S ) t

Non-seasonal Non-seasonal Non-seasonal


AR (1) difference MA (1)

Seasonal Seasonal Seasonal


AR (1) difference MA (1)

The general recommendations concerning the selection of


parameters to be estimated (based on ACF and PACF) also apply to
seasonal models
ACF/PACF

• The seasonal part of an AR or MA model will be seen in the


seasonal lags of the PACF and ACF respectively

• For example, an ARIMA(0,0,0)(0,0,1)12 model will show: a


spike at lag 12 in the ACF but no other significant spikes

• The PACF will show exponential decay in the seasonal lags;


that is, at lags 12, 24, 36, ….

• Similarly, an ARIMA(0,0,0)(1,0,0)12 model will show:


exponential decay in the seasonal lags of the ACF a single
significant spike at lag 12 in the PACF.
Example
Fitting of a time series model for describing the average monthly Sri Lankan
spot price of black pepper 1949 – 1960 in Sri Lankan Rupees per Kg

’49 ‘50 ‘51 ‘52 ‘53 ‘54 ‘55 ‘56 ‘57 ‘58 ‘59 ‘60

Jan. 112 115 145 171 196 204 242 284 315 340 360 417

Feb 118 126 150 180 196 188 233 277 301 318 342 391

Mar 132 141 178 193 236 135 267 317 356 362 406 419

Aprl 129 135 163 181 235 227 269 313 348 348 396 461

May 121 125 172 183 229 234 270 318 355 363 420 472

Jun 135 149 178 218 243 264 315 374 422 435 472 535

July 148 170 199 230 264 302 364 413 465 491 548 622

Aug 148 170 199 242 272 293 347 405 467 505 559 606

Sep 136 158 184 209 237 259 312 355 404 404 463 508

Oct. 119 133 162 191 211 229 274 306 347 359 407 461

Nov 104 114 146 172 180 203 237 271 205 310 362 390

Dec 118 140 166 194 201 229 278 306 336 337 405 432
Time series plot for original data

700

600

500
Value yt

400

300

200

100

13 5 7 9 1 1 1 1 12 2 2 2 2 3 3 3 3 34 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 78 8 8 8 8 9 9 9 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 0 0 0 0 0 1 1 1 1 12 2 2 2 2 3 3 3 3 34 4
135 79 13579 135 79 135 79 13

Case Number
Time series plot for trance formed data

‘49 ‘50 ‘51 ‘52 ‘53 ‘54 ‘55 ‘56 ‘57 ‘58 ‘59 ‘60

4.72 4.74 4.98 5.14 5.28 5.32 5.49 5.65 5.75 5.83 5.89 6.03

4.77 4.84 5.01 5.19 5.28 5.24 5.45 5.62 5.71 5.76 5.83 5.97

4.88 4.95 5.18 5.26 5.46 4.91 5.59 5.76 5.87 5.89 6.01 6.04

4.86 4.91 5.09 5.20 5.46 5.42 5.59 5.75 5.85 5.85 5.98 6.13

4.80 4.83 5.15 5.21 5.43 5.46 5.60 5.76 5.87 5.89 6.04 6.16

4.91 5.00 5.18 5.38 5.49 5.58 5.75 5.92 6.05 6.08 6.16 6.28

5.00 5.14 5.29 5.44 5.58 5.71 5.90 6.02 6.14 6.20 6.31 6.43

5.00 5.14 5.29 5.49 5.61 5.68 5.85 6.00 6.15 6.22 6.33 6.41

4.91 5.06 5.21 5.34 5.47 5.56 5.74 5.87 6.00 6.00 6.14 6.23

4.78 4.89 5.09 5.25 5.35 5.43 5.61 5.72 5.85 5.88 6.01 6.13

4.64 4.74 4.98 5.15 5.19 5.31 5.47 5.60 5.32 5.74 5.89 5.97

4.77 4.94 5.11 5.27 5.30 5.43 5.63 5.72 5.82 5.82 6.00 6.07
Time series plot for trance formed data

6.50

6.00
Value Log_yt

5.50

5.00

4.50

13 5 7 9 1 1 1 1 12 2 2 2 2 3 3 3 3 34 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
13 5 79 13 5 7 9 13 5 7 9 13 5 79 13 5 79 13 5 7 9 13 5 7 9 13 5 7 9 13 5 79 0 0 0 0 0 1 1 1 1 12 2 2 2 2 3 3 3 3 34 4
135 79 13 5 79 13 5 7 9 13 5 7 9 13

Case Number
Time series plots after differencing

150 100

100
50
Value SDIFF(Yt,1,12)

Value DIFF(Yt_D1,1)
50

-50

-50

-100
-100

-150 -150

1 1 1 12 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 0 0 0 0 0 1 1 1 1 12 2 2 2 2 3 3 3 3 3 4 4 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 0 0 0 0 1 1 1 1 12 2 2 2 2 3 3 3 3 3 4 4 4
13 5 7 9 13 5 7 9 13 5 7 9 13 5 7 9 13 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4 6 8 0 2 4

Case Number Case Number

Graph after a seasonal Graph after first difference of first


difference (D=1) seasonal differenced data (d=1)
ACF and PACF plots
DIFF(Yt_D1,1)

1.0 Coefficient
Upper Confidence Limit
Lower Confidence
Limit

0.5

ACF
ACF

0.0

-0.5

-1.0

1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6

Lag Number

DIFF(Yt_D1,1)

1.0 Coefficient
Upper Confidence Limit
Lower Confidence
Limit

0.5

PACF
Partial ACF

0.0

-0.5

-1.0

1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6

Lag Number
Comparison of ARIMA models with AIC

Akaike’s Information Criteria (AIC) = -2 log L + 2m

Where, L = Likelihood
m = p+q+P+Q

σ2 = variance of residual
Comparison of ARIMA models with AIC
S. No. Model AIC
1 ARIMA (1,1,1) (0,1,1)12 1172.362
2 ARIMA (0,1,1) (0,1,1)12 1169.650
3 ARIMA (0,1,2) (0,1,1)12 1171.052
4 ARIMA (0,1,1) (0,1,2)12 1172.295
5 ARIMA (0,1,1) (1,1,1)12 1172.631
6 ARIMA (0,1,3) (0,1,1)12 1172.205
7 ARIMA (1,1,1) (1,1,1)12 1171.065
8 ARIMA (0,1,1) (1,1,0)12 1171.286
9 ARIMA (1,1,1) (1,1,0)12 1170.986
10 ARIMA (1,1,0) (0,1,1)12 1185.438

Akaike’s Information Criteria (AIC) = -2 log L + 2m


Conclusions
 The Moving average methods and single exponential smoothing
emphasizes the short-range perspective, on the condition that
there is no trend no seasonality

 Holt’s linear exponential smoothing captures information about


recent trend

 Hotl’s method was extended by Winters (1960) to capture


seasonality

 The class of ARIMA models are useful for both stationary and
non-stationary time series

 There are numerical indicators for assessing the accuracy of the


forecasting technique, the most widely use approach is use of
several indicators to assess their accuracy
References
Box, G. E. P. and Jenkins G. M. (1970). Time series analysis: forecasting and control, San
Francisco: Holden day.
Box, G. E. P. and Pierce D. A. (1970). Distribution of the residual autocorrelation in
autoregressive-integrated moving-average time series models, Journal American
Statistical Association, 65, 1509-1526.
Gardner, E. S. (1985). Exponential smoothing: the state of the art, Journal of Forecasting, 4, 1-
28.

Holt, C.C. (1957). Forecasting seasonal and trends by exponentially weighed moving average,
Office of Navel Research, Research memorandum No. 52.

Makridakis, S. and Hibon, M. (1979). Accuracy of forecasting an empirical investigation.


Journal of Royal Statistical Society A, 142, 97-145.

Makridakis, S., Steven, C. W. and Rob J. Hyndman (1998). Forecasting Methods and
Applications, 3rd edition, John Wiley & sons, New Yark.

Winters, P. R.(1960). Forecasting sales by exponentially weighted moving averages, seasonal and
trends by exponentially weighed moving average, Management Science, 6, 324-342.

Yar, M and C. Chatfield (1990), Prediction intervals for the Holt-Winters forecasting procedure,
International Journal of Forecasting 6, 127-137.
ARCH Model

• At any point in a series, the error terms will


have a characteristic size or variance.

• In particular ARCH models assume the


variance of the current error term or innovation
to be a function of the actual sizes of the
previous time periods' error terms: often the
variance is related to the squares of the previous
innovations.
ARCH(q) model Specification
19

100
200
300
400
500
600
700

0
49

19
50

19
51

19
52

19
53

19
54

19
55

19
56

19
57

19
58

19
59

19
60

You might also like