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

9/2/2009

Time Series
A time series is a sequence of measurements
over time, usually obtained at equally spaced
intervals such as Daily, Monthly, Quarterly,
Yearly.
Yearly
Useful for:

Time Series Analysis

Understanding the past behavior of data


Forecasting future values of the observed series
Observing variables dependency on time

RK Jana

Possible Time Series Patterns

Components of a Time Series

Smooth movement over a long period of time either


in upward or downward direction
Oscillatory movement at some relatively shorter time
interval
Oscillatory
O ill t
movementt att some relatively
l ti l llong and
d
regular interval
Irregular movement over some time interval

Trend (Tt)

Linear
Nonlinear

Seasonal Variation (St)

Patterns of change within a year, typically


repeating themselves

Cyclical Variation (Ct)

Rise or fall over periods longer than a year

Irregular Variation (It)


3

Estimation of Trend

Time Series Models

Method of Freehand Smoothing

Additive Model
Yt = Tt + Ct + St + It

Plot original data & draw freehand smooth curve


which seems to fit the data best

(Four components are independent of one another)

Method of Movingg Average


g
Using arithmetic mean values

Multiplicative Model
Yt = Tt Ct St It
Or, log(Yt) = log(Tt) + log(Ct) + log(St) + log(It)

Method of Mathematical Curve Fitting


Method of least squares
Fitting straight line
Fitting exponential trend

(Four components are interdependent)


5

9/2/2009

Method of Moving Average (MA)

More About MA

MA of period of k is a series of successive


averages of k terms. The first average is the
mean of 1st k terms. The 2nd average is the
mean of k terms from 2nd to (k+1) and so on.
When k is odd, the MA is placed against the
midpoint of the time interval. When k is even,
it is placed between two middle values of the
time interval.
7

Weighted MA may also be considered


MA method is not suitable for forecasting or
predicting future trend
Major drawback: Data loss
The moving average smoothes the
fluctuations in the data.
A moving average works well when the data
have
a fairly linear trend
a definite rhythmic pattern of fluctuations

Fitting a Straight Line Trend using


Method of Least Squares

Choosing Trend Equation

Let et = (Yt Yt )

When the time series values increases or


decreases by equal absolute amount, a
straight line trend is used
used.

For straight line fitting:


Yt = a + b t , b 0

When the time series values increases or


decreases by a constant rate, an exponential
trend is used.

Square sum of errors:


S 2 = t =1 et2 = t =1 (Yt a bt ) 2
n

10

Example 2

Continued
Normal equations:

S 2
= 0,
a

Fit a straight line by the method of least squares


to the following time series data on production of
a sugar factory (in 000 tons) and tabulate the
trend values. Eliminate the trend from observed
series. Also determine the monthlyy increase in
production of sugar & the trend value for the
year 2001.

S 2
=0
b

This implies:

Y = na + b t
t

tY = a t + b t

Year:
Prod:

11

1994 1995 1996 1997 1998 1999 2000


77
88
94
85
91
98
90
12

9/2/2009

Continued

Continued

Prod Yt

t2

tYt

Trend

Series After
Elimination of
Trends

-6

Year

t(=year1997)

1994

-3

77

-231

83

1995

-2

88

-176

85

1996

-1
1

94

-94
94

87

1997

85

89

-4

1998

91

91

91

196

93

1999

98

2000

90

270

95

-5

Sum

623

28

56

--

--

Here n = 7.
From normal equations: a = 89, b = 2
Fitted least square straight line: Yt = 89 + 2t
Rate of growth per year: dYt / dt = b
Rate of growth per month:
(000 tons)
dYt / dt = b /12
For 2001, t = 4
T2001 = 89 + 2 4 = 97 (000 tons)
13

14

Method of Simple Average

Estimating Seasonal Variations

It is used when the time series data consists of seasonal & random
components.
It removes the random component & the resulting average consists
of seasonal components only.
Then the averages are converted to Seasonal Indices.
The Method:

Method of simple average (data contain


seasonal & random components)
Ratiototrend method (data contain trend,
seasonal & random components)
Ratiotomoving average method (data
contain all components)

Arrange the data by years & months or quarters


Compute average for ith month or ith quarter
Obtain grand average:
x=

1 12
xi , where xi is the average for i-th month
12 i =1

15

16

Continued
Seasonal Indices:

( SI )i =

Example 4

xi
100
x

Using the method of simple average obtain the


seasonal indices for the following quarterly
data:

Total seasonal indices for a monthly data: 12(100) = 1200


Total seasonal indices for a quarterly data: 4(100) = 400
If

(SI )i = A is not 1200 for a monthly data then adjust the


i
seasonal indices by multiplying it by (1200/A), known as the
adjustment factor.
Seasonal data are obtained by multiplying the original data by

Year

QI

QII

QIII

QIV

1998
1999
2000
2001
2002

120
105
106
104
89

125
120
110
112
105

90
125
105
102
90

105
100
80
85
100

( SI )i /100
17

18

9/2/2009

RatiotoTrend Method

Continued
Year

QI

QII

QIII

QIV

1998
1999
2000
2001
2002

120
105
106
104
89

125
120
110
112
105

90
125
105
102
90

105
100
80
85
100

Total

524

572

512

470

Average

104.8

114.4

102.4

94

( SI )i

100.87

110.10

98.56

90.47

Suitable for data not having cyclic variations (Ct).


Trend values are eliminated first.
Random variations are eliminated next.
The Method:
Obtain trend values for each month or quarter
Divide the original data values by corresponding trend values
and multiply it by 100 to express it in percentage. So,

Yt
T S I
100 = t t t 100
Tt
Tt

(multiplicative model excluding Ct)

Use simple average to eliminate random components

19

20

Example 5

Continued
Adding values of all quarters of a year, we obtain
yearly totals for each year & then fit a linear trend.

Obtain seasonal indices by using ratiototrend method for


the following data:

Year
Year

QI

QII

QIII

QIV

1998
1999
2000
2001

60
65
71
60

50
61
55
52

55
64
58
50

65
66
52
58

t 1998

t*t

1998
1999
2000
2001

Yt
230
256
236
220

0
1
2
3

0 Yt
256
472
660

0
1
4
9

Total

942

1388

14

Obtained trend equation: Yt = 243 5t


Quarterly trend equation: Yt= 243 / 4 5t /16
(origin is at the middle of 1998 & time unit is 1 quarter)
Origin is at 2nd quarter & time unit is 1 quarter:

Yt= 243 / 4 5(t 1/ 2) /16 = 60.91 0.3125t


21

Continued

Continued

Divide the original data values by corresponding tend


values and obtain the ratiototrend values &
seasonal indices as follows:

Trend value for the &


quarter of 1998
are obtained by putting t = 1 & t = 0,
respectively, in the last trend equation. Other
trend values are obtained similarly by putting
t= 1, 2, , 14
1st

22

2nd

Year

QI

QII

QIII

QIV

1998
1999
2000
2001

61.22
59.97
58.72
57.47

60.91
59.66
58.41
57.16

60.59
59.35
58.08
56.85

60.28
59.03
57.78
56.53

23

Year

QI

QII

QIII

QIV

1998
1999
2000
2001

98.00
108 38
108.38
120.91
104.40

82.09
102 25
102.25
94.16
90.97

90.76
107 84
107.84
99.83
87.95

107.82
111 80
111.80
89.99
102.59

Total

431.69

369.47

386.39

412.20

Average

107.92

92.37

96.60

103.05

Seasonal
Indices

107.93

92.38

96.61

103.08

24

9/2/2009

The Method

Ratiotomoving Average
Applicable if the data contain all four time
series components.
Select the period of moving average equal to
the period of seasonal variations (oscillatory
movements).
For monthly data, centered 12point moving average is
selected
For quarterly data, centered 4point moving average is
selected

Calculate the moving average (MA) with period equal


to seasonal variations to remove seasonal variations.
Now the data contain trend, cyclical & random
variations.
Divide the original values for each month or quarter
by respective MA values and express the ratio as a
Yt
percentage:
100
MA

Yt
T S Ct I t
100 = t t
= St I t''
MA
Tt Ct I t

25

26

Continued

Example 6

Eliminate the random components by the method of


simple averages and obtain St (unadjusted).
If for a monthly data, the sum of St is not 1200 or
for a quarterly data it is not equal to 400, adjust
them as
adjusted St = 1200(unadjusted St /Sum of St )

Obtain seasonal indices by using ratiotoMA method for the


following data:
Year

QI

QII

QIII

QIV

1998
1999
2000
2001

60
65
71
60

50
61
55
52

55
64
58
50

65
66
52
58

adjusted St = 400(unadjusted St /Sum of St)

27

28

Continued
Year/
Quarter
1998

1999

2000

2001

Yt

I
II
III
IV
I
II
III
IV
I
II
III
IV
I
II
III
IV

60
50
55
65
65
61
64
66
71
55
58
52
60
52
50
58

4pt moving
average
(MA)

57.5
58.75
61.5
63.75
64.0
65.5
64.0
62.5
59.0
56.25
55.5
53.5
55.0

Continued

2pt cent.
MA

RatiotoMA
=100*Yt /MA

58.125
60.125
62.625
63 875
63.875
64.75
64.75
63.25
60.75
57.62
55.87
54.5
54.25

94.62
108.10
103.79
95 50
95.50
98.84
101.93
112.25
90.53
100.66
93.07
110.09
95.85

29

Year

QI

QII

QIII

QIV

1998
1999
2000
2001

103.79
112.25
110 09
110.09

95.50
90.53
95 85
95.85

94.62
98.84
100.66

108.10
101.93
93.07

Total

326.13

281.88

294.12

303.10

Average

108.71

93.96

98.04

101.03

Seasonal
Indices

108.24

93.55

97.62

100.59

30

9/2/2009

Estimating Cyclical Variation

Exponential Smoothing (ES)

Cyclical variations is measured by eliminating trends


(Tt) and seasonal variations (St) from the data. This is
done by following the steps below:
Compute Tt by appropriate method.
Compute
p
St byy appropriate
pp p
method.
Compute Yt /(Tt St ). The resulting ratio will contain cyclical
& random components.
Remove the random components, if any, by applying
moving average method.

ES is a method of forecasting based on weighted


moving average of the preceding observations. This
method allows more recent observations to have
more influence on the forecast. It is used for
forecasting future values if the time series does not
contain any trend or seasonality.

31

32

Continued

The Method

Forecast for period t is


Ft = Ft1 (Yt1 Ft1) = (Yt1) + (1 ) Ft1

Observations: Y0 , Y1 , Y2 , ..
Time period: t
Forecasts: Ft , Ft1
t 1 , Ft2
t 2 , ..
Smoothing coefficient: , (0 < < 1)
Forecast errors: et = Yt Ft

Rewrite,
Ft = (Yt1) + (1 ) Ft1
= (Yt1) + (1 ) { (Yt2) + (1 ) Ft2}
= (Yt1) + (1 ) (Yt2) + (1 )2 Ft2
= .
Ft = (Yt1) + (1 ) (Yt2) + (1 )2 (Yt3) + ..
+ (1 )t1 (Y0) + (1 )t (F0)
33

34

Example: ES

Errors in ES

The monthly sales (Rs 000) of a newly launched product for


last eight months are given below:
Month
Sales

180

168

159

175

190

205

180

182

Mean Square Error (MSE)

MSE =

The initial forecast for the sale was Rs 175000.00.


Fi d
Find:

1 n 1 2 1 n 1
et = n t =0 (Yt Ft )2
n t =0

Mean Absolute Deviation (MAD)

(i)

Forecast of sale for the next month by taking


smoothing coefficient = 0.1.
(ii) Forecast error for each month.
(iii) MSE & MAD.

MAD =

1 n 1
1 n 1
| et | = n t =0 | Yt Ft |
n t =0

Forecast for next month = 178.60


MSE = 190.82, MAD = 10.31
35

36

You might also like