0% found this document useful (0 votes)
43 views11 pages

Chap1 Introduction - pt1 Student

The document discusses time series analysis and summarizes key concepts. It defines a time series as a set of observations collected over fixed time intervals. The purpose of time series analysis is to understand the stochastic process generating the data and to forecast future values. Key steps include plotting the data to identify trends, seasonality and outliers. Methods for describing trends include global and local curve fitting as well as linear filtering to smooth the data. Differencing can also be used to remove trends and achieve stationarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views11 pages

Chap1 Introduction - pt1 Student

The document discusses time series analysis and summarizes key concepts. It defines a time series as a set of observations collected over fixed time intervals. The purpose of time series analysis is to understand the stochastic process generating the data and to forecast future values. Key steps include plotting the data to identify trends, seasonality and outliers. Methods for describing trends include global and local curve fitting as well as linear filtering to smooth the data. Differencing can also be used to remove trends and achieve stationarity.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1

1. INTRODUCTION
Data obtained from observations collected sequentially over time are extremely
common. For example:
In business, we observe weekly interest rates, daily closing stock prices,
monthly price indices, yearly sales figures.
In meteorology, we observe daily high and low temperatures, annual
precipitation and drought indices, hourly wind speeds.
In agriculture, we record annual figures for crop and livestock production, soil
erosion and export sales.
In biological sciences, we observe the electrical activity of the heart at
millisecond intervals.
In ecology, we record the abundance of animal species

The purpose of time series analysis is generally twofold: to understand or model the
stochastic mechanism that gives rise to an observed series and to predict or forecast
the future values of a series based on the history of that series and, possibly, other
related series or factors.

When a variable is measured sequentially in time order or at a fixed interval, known as
the sampling interval, the resulting data form a time series.

A time series is a set of observations that have been collected over fixed sampling
intervals. The sampling interval is usually equally spaced, ie, daily, quarterly, monthly,
annually.
Thus,
1 2
, ,......,
n
y y y or { } : 1, 2,....,
t
y t n = is an observed series and may be taken to
be a realisation of the underlying random process { } : 1, 2,....,
t
Y t n = or
{ } : 1, 2,...
t
Y t =

The ' y s are not random sample; ' y s will be related to one another, and it is this
relationship or serial dependence that is of interest.

Time series can be discrete or continuous in time,
t
y or ( ) y t respectively.
2

The following are examples of time series data.



In practice an observed time series can be:
(i) Inherently discrete:- closing stock price on trading day
(ii) Sampled:- a continuous series
(iii) Aggregated:- no instantaneous value but accumulated over time

We consider only univariate series. Multivariate series exist also.


Time
P
a
s
s
e
n
g
e
r
s

(
1
0
0
0
'
s
)
1950 1954 1958
1
0
0
4
0
0
Intl air passenger in USA-period 1949 to 1960
Year
I
n
c
h
e
s
1880 1900 1920 1940 1960 1980
1
0
3
0
LA annual rainfall
Year
A
b
u
n
d
a
n
c
e
1905 1915 1925 1935
0
4
0
8
0
Abundance of Canadian Hare
Time
T
e
m
p
e
r
a
t
u
r
e

F
1964 1968 1972 1976
1
0
4
0
7
0
Monthly average temperature in Dubuque, Iowa
Time
r
a
t
e

(
%
)
1996 1998 2000 2002 2004 2006
4
.
0
5
.
0
6
.
0
US monthly unemployment rate-Jan 1996 to Oct 2006
Year

D
a
i
l
y

C
l
o
s
i
n
g

v
a
l
u
e
s
(
J
M
D
$
)
1980 1990 2000 2010
0
4
0
8
0
USD$/JMD$ exchange rate-period 1972 to 2010
Figure 1: Time series plots
3

1.2 Testing Randomness
We may wish to test whether an observed series ( )
1 2
, ,.....,
n
y y y have occurred in
this order at random, or be white noise or a more complicated model is required.
There are several traditional test:- turning point test, runs, difference, records and
rank correlation test to mention a few.

(i). Turning Point Test
This is a very simple diagnostic, which examines a series { }
t
Y to test whether
it is purely random. The idea is that if { }
t
Y is purely random then three
successive values are equally likely to occur in any of the six possible orders.



In four cases, there is a turning point in the middle. Thus, in a series of ' ' n
points we might expect ( )
2
3
2 n turning points.


Idea:
i
y is a turning point (TP) if
1 1
1 1
and
and
i i i
i i i
y y y
y y y
+
+
>

<




Using an indicator variable
1 if is a TP
0 if not
i
i
y
X








TP
TP
4

Test statistic: P is the number of TPs, i.e.
1
2
n
i
i
P X

=
=



It can be shown that, for large n;
( ) 2 2 16 29
,
3 90
n n
P N
(
(


Under
0
: ' are random H y s


Derivation
Consider 3 values: 1, 2, 3 for convenience
There are 3! 6 = possible orderings
If series is random, these are equally-likely


1,2,3 0
1, 3, 2 1
2,1, 3 1
2,3,1 1
3,1, 2 1
3, 2,1 0
i
i
i
i
i
i
X
X
X
X
X
X
=
=
=
=
=
=


Consider what the series may be like when
P is large rough with many fluctuations
P is small smooth with few fluctuations

( ) ( ) ( )
1 2 1
2 2 1
2 ,
n n n
i i j
i i j i
Var P Var X Cov X X

= = = +
= +



( ) ( ) ( ) ( ) ( ) ( )
1 2
2 2 3 , 2 4 ,
i i i i i
n Var X n Cov X X n Cov X X
+ +
= + +




4 of the 6 give TPs
So,


5


Hence,

( )
2
2
3
i
E X = ( )
1
5
,
12
i i
E X X
+
= ( )
2
9
,
20
i i
E X X
+
=

So ( )
16 29
90
n
Var P

=


(ii). Run Test
A run is defined as a series of increasing values or a series of decreasing
values. The number of increasing, or decreasing, values is the length of the
run. In a random data set the probability that the ( ) 1 i th + value is larger or
smaller that the
th
i value follows a binomial distribution.

(iii). Differences
Signs of first differences

(iv). Rank correlation test



1.3 Time Plot
The first step in any time-series analysis is to plot the observations against time. This
will show up important features of the series, such as trend, seasonality, outliers and
discontinuities. The plot is important, both to describe the data and to help in
formulating a sensible model, and seen in figure 1 on page 2.
Plotting is not easy as it sounds. The choice of scales, the size of the intercept and the
way that the points are plotted (e.g. as a continuous line or as separate dots or
crosses) may substantially affect the way the plot looks and so the analyst must
exercise care and judgement.


6

1.4 Trend Component
Here we consider describing(estimating) the trend-also called smoothing. Recall
that trend is a smooth long-term movement. We wish to estimate the trend
component and perhaps remove it to explore other components.

A. Global Fitting
We could fit a suitable function, example, linear, polynomial, or others; to the
whole series using least squares. But there are drawbacks:
Rarely appropriately that a single function fits for the entire series
Impractical for updating


B. Local Fitting
A possibility is to fit a piecewise linear model where the trend line is locally
linear but with change points where the slope and intercept change (abruptly).
It is often seems more sensible to look at models that allow a smooth
transition between the different submodels.

Other general approach to describing trend:


1.4.1 Filtering
A second procedure for dealing with a trend is to use a linear filter, which converts
one time series, { }
t
y into another { }
t
x by linear operation


s
t i t i
i k
x w y
+
+
=
=




0
.... ...
k t k t s t s
w y w y w y
+
= + + + +




7

Remarks

t
x is the smoothed or filtered series

{ }
i
w is a set of weights

In order to smooth out local fluctuations and estimate the local mean, we
should choose the weights so that 1
i
w =

, then the operation is often


referred to as a moving average.
The simple moving average is not generally recommended by itself for
measuring trend, although it can be useful for removing seasonal variation.


i
w s are symmetric about middle value. Moving average are often symmetric
with s k = and
j j
w w

= .
The simplest example, of a symmetric smoothing filter is simple moving
average, for which
1
2 1
i
k
w
+
= for ,......, i k k = + and the smoothed value is
given by

1
2 1
k
t t i
i k
x y
k
+
+
=
=
+





i
w s are the same for fitting polynomials of degree 2 p k = as for 2 1 p k = +
for fixed k

For a filter with a central weight and k weights to either side, the filter length
is 2 1 p k = +

Spencers 15-point moving average was developed by an actuary in 1904 for
smoothing mortality statistics to get life tables. This covers 15 consecutive
points with 7 k = , and symmetric weights are
[ ]
1
3, 6, 5, 3, 21, 46, 67, 74,...........
320

8

Henderson moving average, is widely used for example, in the 11 X and
12 X seasonal packages. This moving average aims to follow a cubic
polynomial trend without distortion, and the choice of k depends on the
degree of irregularity

Whenever a symmetric filter is chosen, there is likely to be an end-effects
problem



1.4.2 Differencing
This procedure is useful for removing a trend, it is simply to difference the series
until it becomes stationary. For non-seasonal data, first-order differencing is usually
sufficient to attain apparent stationarity.
Thus, a new series { }
2
,....,
n
x x is formed from the original observed series,
{ }
1
,....,
n
y y by

1 t t t t
x y y y

= = for 2, 3,..., t n =

Example 1.4.2
Consider the expression
1 t t t
y y y

=
Now
( )
2
t t
y y =
( )
1 t t
y y

=

1 t t
y y

=
( ) ( )
1 1 2 t t t t
y y y y

=

1 2
2
t t t
y y y

= +

Alternatively: since 1 D B
Then: ( )
2
2
1
t t
D y B y =

( )
2
1 2
1 2 2
t t t t
B B y y y y

+ = +

9

1.4.3 Filters in series
Useful filters can be built up by applying simple filters one after another.
Suppose filter 1, with weights { }
r
a acts on { }
t
x to produce { }
t
y
Then filter 2 with weights
{ }
j
b acts on { }
t
y to produce { }
t
z
Now

t j t j
j
z b y
+
=




j r t j r
j r
b a x
+ +
=




k t k
k
c x
+
=



where
k r k r
r
c a b

=

are the weights for the overall filter. The weights { }
k
c are
obtained by convolution, i.e.,
{ } { } { }
*
k r j
c a b = where the symbol * represents the
convolution operator.

Example:

{ } { } { }
1 1 1 1 1 1 1
4 2 4 2 2 2 2
, , , * , =




1.4.4 Worked Illustration 1: Derivation of Moving Average
For convenience, consider the ( ) 2 1 k + values
1 0 1
,...., , , ,.....,
k k
y y y y y



And fit
2
0 1 2
....
p
t p
y a a t a t a t = + + + + polynomial of degree p


10

Using least squares:

2
0
p k
i
t i
t k i
S y a t
= =
| |
=
|
\



Set up equations 0 : 0,1, 2,...,
i
S
i p
a

= =

and solve for


i
a


1
0 1
0 ...
k k k k
i i i p i
p t
t k t k t k t k i
S
a t a t a t y t
a
+ +
= = = =

= + + + =





In fact we need only
0
a .

We seek
0
m , the trend value at 0 t = which is simply
0
a (thats the convenience)

Comments

0
a turns out to be a weighted average of the ' y s

0 0

k
t t
t k
m a w y
=
= =



'
t
w s are functions of k and p only and are the same for any set of ( ) 2 1 k +
consecutive observations



In general for
1 1
,...., , , ,.....,
t k t t t t k
y y y y y
+ +


k
t i t i
i k
m w y
+
=
=





11


Example 1.1
Consider a 7-point least squares cubic:-
1 2 3 4 5 6 7 8 9
, , , , , , , , ,...... y y y y y y y y y




Example 1.2
Derive the 7-point quintic/quartic least squares moving average formula

[ ]
1
5, 30, 75,131
231

And show that it can be written
[ ]
6
3
1 5
5, 30, 75,131
231 231
t t t
y y D y
+
= +



Example 1.3
(i) Show that the -point k linear formula is the simple average;
[ ] [ ]
1 1
1,1,1,1,...,1,1
k k
k
(ii) Why is the formula for 2 p r = the same as that for 2 1 p r = + ?

You might also like