0% found this document useful (0 votes)
293 views56 pages

Time Series Analysis: 1 Contributed by National Academy of Statistical Administration

The document introduces time series analysis, explaining that a time series is a sequence of numerical data obtained at regular time intervals that can be analyzed to describe patterns, fit models, and make forecasts. It describes the key components of time series, including trends, seasonal variations, cyclical variations, and irregular or random variations. The goal of time series analysis is to decompose a time series into these underlying components to better understand and predict the behavior of the data over time.

Uploaded by

K khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
293 views56 pages

Time Series Analysis: 1 Contributed by National Academy of Statistical Administration

The document introduces time series analysis, explaining that a time series is a sequence of numerical data obtained at regular time intervals that can be analyzed to describe patterns, fit models, and make forecasts. It describes the key components of time series, including trends, seasonal variations, cyclical variations, and irregular or random variations. The goal of time series analysis is to decompose a time series into these underlying components to better understand and predict the behavior of the data over time.

Uploaded by

K khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 56

Time Series Analysis

Contributed by National Academy


of Statistical Administration 1
Module objectives

Introduce time series


Components of time series
Deseasonalising a time series

Contributed by National Academy


of Statistical Administration 2
What is a time series?
Essentially, Time Series is a sequence of numerical
data obtained at regular time intervals.

Occurs in many areas: economics, finance,


environment, medicine

The aims of time series analysis are


 to describe and summarize time series data,
 fit models, and make forecasts

Contributed by National Academy


of Statistical Administration 3
Why are time series data different
from other data?
Data are not independent
 Much of the statistical theory relies on the data
being independent and identically distributed
Large samples sizes are good, but long time
series are not always the best
 Series often change with time, so bigger isn’t
always better

Contributed by National Academy


of Statistical Administration 4
What Are Users Looking for in an
Economic Time Series?
Important features of economic
indicator series include
 Direction
 Turning points
 In addition, we want to see if the
series is increasing/decreasing more
slowly/faster than it was before

Contributed by National Academy


of Statistical Administration 5
When should time series analysis
best be used?
We do not assume the existence of deterministic model
governing the behaviour of the system considered.

Instances where deterministic factors are not readily available


and the accuracy of the estimate can be compromised on the
need..(be careful!)

We will only consider univariate time series

Contributed by National Academy


of Statistical Administration 6
Forecasting Horizons
Long Term
 5+ years into the future

 R&D, plant location, product planning

 Principally judgement-based

Medium Term
 1 season to 2 years

 Aggregate planning, capacity planning, sales forecasts

 Mixture of quantitative methods and judgement

Short Term
 1 day to 1 year, less than 1 season

 Demand forecasting, staffing levels, purchasing, inventory

levels
 Quantitative methods

Contributed by National Academy


of Statistical Administration 7
Examples of Time series data

Number of babies born in each hour


Daily closing price of a stock.
The monthly trade balance of Japan
for each year.
GDP of the country, measured each
year.

Contributed by National Academy


of Statistical Administration 8
Time Series example
Exports, 1989-1998
How the data t Year x=Value
(x) and time 1 1989 44,320
(t) is recorded 2 1990 52,865
and presented 3 1991 53,092
4 1992 39,424
5 1993 34,444
6 1994 47,870
7 1995 49,805
8 1996 59,404
9 1997 70,214
10 1998 74,626
Contributed by National Academy
of Statistical Administration 9
Time Series
Exports

Coordinates 80,000

(t,x) is 75,000

established in
70,000
65,000
the 2 axis 60,000
55,000
(1, 44,320) 50,000

(2, 52,865) 45,000


40,000

(3, 53,092) 35,000


30,000
etc.. 1988 1990 1992 1994 1996 1998 2000

Contributed by National Academy


of Statistical Administration 10
Time Series

A graphical Exports
representation
of time series.
80,000
75,000

We use x as a 70,000

function of t: 65,000
60,000
x= f(t) 55,000

Data points 50,000


45,000
connected by a 40,000
curve 35,000
30,000
1988 1990 1992 1994 1996 1998 2000

Contributed by National Academy


of Statistical Administration 11
Importance of time series analysis

 Understand the past.


What happened over the last years,
months?
 Forecast the future.
Government wants to know future of
unemployment rate, percentage increase in
cost of living etc.
For companies to predict the demand for
their product etc.

Contributed by National Academy


of Statistical Administration 12
Time-Series Components

Trend Cyclical

Time-Series

Seasonal Random

Contributed by National Academy


of Statistical Administration 13
Components of Time Series

Trend (Tt )
Seasonal variation (St )
Cyclical variation ( Ct )
Random variation (Rt )
or irregular

Contributed by National Academy


of Statistical Administration 14
Components of Time Series
Trend (Tt )
Trend: the long-term patterns or
movements in the data.
Overall or persistent, long-term upward
or downward pattern of movement.
The trend of a time series is not always
linear.

Contributed by National Academy


of Statistical Administration 15
Components of Time Series
Seasonal variation (St )
Regular periodic fluctuations that occur
within year.
Examples:
Consumption of heating oil, which is
high in winter, and low in other seasons
of year.
Gasoline consumption, which is high in
summer when most people go on
vacation.
Contributed by National Academy
of Statistical Administration 16
Components of Time Series
Seasonal variation (St )

Summer Summer
30
25
20
15
10
5
0
-5
-10 Winter Winter

Contributed by National Academy


of Statistical Administration 17
Example
Quarterly with Seasonal Components

25

20

15
Sales

10

0
0 5 10 15 20 25 30 35

Time
Contributed by National Academy
of Statistical Administration 18
Seasonal Components Removed
Quarterly without Seasonal Com ponents

25

20

15
Sales

Y(t)

10

0
0 5 10 15 20 25 30 35
Tim e

Contributed by National Academy


of Statistical Administration 19
Why Do Users Want Seasonally
Adjusted Data?

Seasonal movements can make features


difficult or impossible to see

Contributed by National Academy


of Statistical Administration 20
Causes of Seasonal Effects

Possible causes are


 Natural factors
 Administrative or legal measures
 Social/cultural/religious traditions
(e.g., fixed holidays, timing of
vacations)

Contributed by National Academy


of Statistical Administration 21
Components of Time Series
Cyclical variation ( Ct )
• Cyclical variations are similar to seasonal
variations. Cycles are often irregular both in
height of peak and duration.
• Examples:
• Long-term product demand cycles.
• Cycles in the monetary and financial
sectors. (Important for economists!)

Contributed by National Academy


of Statistical Administration 22
Cyclical Component
Long-term wave-like patterns
Regularly occur but may vary in length
Often measured peak to peak or trough
to trough 1 Cycle
Sales

Contributed by National Academy


of Statistical Administration
Year 23
Irregular Component

Unpredictable, random, “residual”


fluctuations
Due to random variations of
 Nature
 Accidents or unusual events
“Noise” in the time series

Contributed by National Academy


of Statistical Administration 24
Causes of Irregular Effects

Possible causes
 Unseasonable weather/natural disasters
 Strikes
 Sampling error
 Nonsampling error

Contributed by National Academy


of Statistical Administration 25
Classical Decomposition
One method of describing a time series
Decompose the series into various components
 Trend – long term movements in the level of the series
 Seasonal effects – cyclical fluctuations reasonably stable in
terms of annual timing (including moving holidays and
working day effects)
 Cycles – cyclical fluctuations longer than a year
 Irregular – other random or short-term unpredictable
fluctuations

Contributed by National Academy


of Statistical Administration 26
Not easy to understand the pattern!

Contributed by National Academy


of Statistical Administration 27
Our aim
is to understand and identify different
variations so that we can easily predict
the future variations separately and
combine together
Look how the above complicated series
could be understood as follows
separately

Contributed by National Academy


of Statistical Administration 28
Contributed by National Academy
of Statistical Administration 29
Contributed by National Academy
of Statistical Administration 30
Contributed by National Academy
of Statistical Administration 31
Contributed by National Academy
of Statistical Administration 32
Few variations separately

Contributed by National Academy


of Statistical Administration 33
Can you imagine how all components aggregate
together to form this?

Contributed by National Academy


of Statistical Administration 34
Multiplicative Time-Series Model for
Annual Data

Used primarily for forecasting


Observed value in time series is the
product of components
Yi  Ti  Ci  Ii
where Ti = Trend value at year i
Ci = Cyclical value at year i
Ii = Irregular (random) value at year i

Contributed by National Academy


of Statistical Administration 35
Multiplicative Time-Series Model with
a Seasonal Component

Used primarily for forecasting


Allows consideration of seasonal
variation
Yi  Ti  Si  Ci  Ii
where Ti = Trend value at time i
Si = Seasonal value at time i
Ci = Cyclical value at time i
Ii = Irregular (random) value at time i
Contributed by National Academy
of Statistical Administration 36
Smoothing techniques

Smoothing helps to see overall patterns


in time series data.
Smoothing techniques smooth or “iron”
out variation to get the overall picture.
There are several smoothing techniques
of time series.

Contributed by National Academy


of Statistical Administration 37
Smoothing techniques

We will study :
Moving average.
Exponential smoothing

Contributed by National Academy


of Statistical Administration 38
Smoothing the
Annual Time Series

Calculate moving averages to get an


overall impression of the pattern of
movement over time

Moving Average: averages of consecutive


time series values for a
chosen period of length L

Contributed by National Academy


of Statistical Administration 39
Moving Averages

Used for smoothing


A series of arithmetic means over time
Result dependent upon choice of L
(length of period for computing means)
Examples:
 For a 3 year moving average, L = 3
 For a 5 year moving average, L = 5
 Etc.
Contributed by National Academy
of Statistical Administration 40
Smoothing techniques:
Moving Average (MA)

 Odd number of points. Points (k) – length


for computing MA
 k=3
y1  y2  y3
MA1 
3
y2  y3  y4
MA2 
3
and so on.
Contributed by National Academy
of Statistical Administration 41
Smoothing techniques:
Moving Average (MA) k=3
Year Series 3 Point MA
1990 5
1991 6 6 MA1
1992 7
1993 8 MA2
1994 10
1995 11
1996 12
1997 12
1998 12 12.0
1999 12 12.3
2000 13 12.7
2001 13
Contributed by National Academy
of Statistical Administration 42
Smoothing techniques:
Moving Average (MA)
Moving Average (3)

Actual Forecast
14
13
12
11
10
9
8
7
6
5
4
3
1 2 3 4 5 6 7 8 9 10 11 12

Contributed by National Academy


of Statistical Administration 43
Smoothing techniques:
Moving Average (MA) k=5
Year Series 5 Point MA
1990 5
1991 6
1992 7 7.2
1993 8
1994 10
1995 11
1996 12
1997 12
1998 12
1999 12 12.4
2000 13
2001 13

Contributed by National Academy


of Statistical Administration 44
Smoothing techniques:
Moving Average (MA)
Moving Average (5)
Actual Forecast
14
12
10
8
6
4
2
0
1 2 3 4 5 6 7 8 9 10 11

Contributed by National Academy


of Statistical Administration 45
Smoothing techniques:
Moving Average (MA)

We need even numbered MA s for


seasonal adjustments
 eg: 4 – quarterly data
 12 – monthly data

Contributed by National Academy


of Statistical Administration 46
Smoothing techniques:
Moving Average (MA)
Even number of points.
Two stages:
1. Obtain MA, centered halfway
between t and t-1.
2. To get a trend take the average of
two successive estimates. Estimate
centered halfway between t and t-1.

Contributed by National Academy


of Statistical Administration 47
Smoothing techniques:
Moving Average (MA)

for k=4.
Stage 1. ( y1  y2  y3  y4 )
MA1,1 
4
( y 2  y3  y 4  y5 )
MA1, 2 
Stage 2. 4
MA1,1  MA1, 2
MA1 
2
and so on.
Contributed by National Academy
of Statistical Administration 48
Smoothing techniques:
Moving Average (MA)
MA stage 1 MA stage 2:
Observation Series
MA Centered
1 5 MA1,1 #NA
MA1,2
2 6 #NA MA1
6.5
3 7 7.1

4 8
9.0
5 10
10.3
6 11 #NA
7 12 #NA
Contributed by National Academy
of Statistical Administration 49
Measuring the seasonal effect

To measure seasonal effect construct


seasonal indices.
Seasonal indices is a degree to which
the seasons differ from one another.
Requirement: time series should be
sufficiently long to allow to observe
seasonal fluctuations.

Contributed by National Academy


of Statistical Administration 50
Measuring the seasonal effect
Computation:
 Calculating MA.
 Set the number of periods equal to the
number of types of season.
 Use multiplicative model:

Yt  Tt  Ct  St  Rt
 MA remove St and Rt

Contributed by National Academy


of Statistical Administration 51
Measuring the seasonal effect
Calculate MAt (step 1)
Compute the ratio (step 2):
Yt Tt  Ct  St  Rt
  St  Rt
MAt Tt  Ct
For each type of season calculate the
average of the ratios (step 3).
The seasonal indices are the average
ratios from ratios step 3 adjusted.

Contributed by National Academy


of Statistical Administration 52
Measuring seasonal effect
Hotel
Centered Ratio Seasonal
Year Quarter Occupan
MA Yt/MA Index Si
cy Yt
1997 1 0.527 0.895
2 0.660 1.098
3 0.752 0.642 1.171 1.144

Step 1
4 0.534 0.658 0.811 0.864
1998 1 0.541 0.635 0.852 0.895
2 0.694 0.632 1.098 1.098
3 0.816 0.657 1.241 1.144
Step 2 4 0.569 0.658 0.864 0.864
1999 1 0.558 0.628 0.889 0.895
2 0.694 0.617 1.124 1.098
Step 3 3 0.685 0.642 1.068 1.144
(calculation 2000
4
1
0.564
0.585
0.650
0.637
0.867
0.918
0.864
0.895
see next slide) 2 0.666 0.650 1.023 1.098
3 0.758 0.688 1.101 1.144
4 0.594 0.705 0.843 0.864
2001 1 0.625 0.696 0.898 0.895
2 0.785 0.703 1.116 1.098
3 0.821 1.144
4 by National
Contributed 0.630
Academy 0.864
of Statistical Administration 53
Calculating seasonal index

Quarterly ratios
Year 1 2 3 4 Total
1997 1.171 0.811
1998 0.852 1.098 1.241 0.864
1999 0.889 1.124 1.068 0.867
2000 0.918 1.023 1.101 0.843
2001 0.898 1.116
Average 0.889 1.090 1.137 0.858 3.974
Seasonal
index 0.895 1.098 1.144 0.864 4.000
Example:
Seasonal index for Quarter 1 = 0.889/3.974*4.000=0.895
Contributed by National Academy
of Statistical Administration 54
Negative trend is also a trend..
unemployed

1200000

1000000

800000

600000

400000

200000

0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35

Contributed by National Academy


of Statistical Administration 55
Exercise
Plot the time series in
unemployment.xls
Compute quarterly (seasonal) indices. .
Plot components separately and show
them in one graph

Contributed by National Academy


of Statistical Administration 56

You might also like