Professional Documents
Culture Documents
Time Series
Time Series
1 Dr Madhusudhan Zalki
Components of time series
1. Secular trend
2. Cyclical variation
3. Seasonal variation
Short term fluctuations
4. Irregular variation
2 Dr Madhusudhan Zalki
Mathematical model
Additive model
Y=T+S+C+I
3 Dr Madhusudhan Zalki
Multiplicative model
Mixed Model
4 Dr Madhusudhan Zalki
Trend: trend is also called as secular trend or long
term trend, basic tendency of a series to grow or
decline over a period of time.
5 Dr Madhusudhan Zalki
Time Series
Secular Trend:
The value of the variable tends to increase or
decrease over a long period of time.
6 Dr Madhusudhan Zalki
7 Dr Madhusudhan Zalki
8 Dr Madhusudhan Zalki
Measurement of trend
1. Graphic method
2. Method of semi-averages
3. Method of curve fitting (method of least squares)
4. Method of moving averages
9 Dr Madhusudhan Zalki
Method of semi-averages
years 1993 1994 1995 1996 1997 1998
Sales (‘000) 20 24 22 30 28 32
Semi- 22 30
average
10 Dr Madhusudhan Zalki
Least square method: linear trend
y a bx
b
xy n x y
b 2
x nx 2 a
a y nx
11 Dr Madhusudhan Zalki
t AM (t )
x if n is odd
interval
t AM (t )
x if n is even
1 / 2 interval
12 Dr Madhusudhan Zalki
a
y
n
b
xy
x 0
x 2
13 Dr Madhusudhan Zalki
Fit a linear trend for the following data.
year Production
1990 18
1992 21
1994 23
1996 27
1998 16
14 Dr Madhusudhan Zalki
Exponential Trend
15 Dr Madhusudhan Zalki
Method of moving average
This is simple and flexible method of measuring trend. It
consists in obtaining series of moving averages of
successive overlapping groups and sections of time
series.
The average process smoothens out fluctuations in the
given data.
The moving average of period m overlapping the values
starting from 1st ,2nd and 3rd …..are given by the
following formula
16 Dr Madhusudhan Zalki
For the time series
The MA of time period m is
17 Dr Madhusudhan Zalki
t y 3year MA
t1 y1 _
t2 y2 ma1=(y1+y2+y3)/3
t3 y3 ma2=(y2+y3+y4)/3
t4 y4 ma3=(y3+y4+y5)/3
t5 y5 Ma3=(y4+y5+y6)/3
t6 y6 Ma4=(y5+y6+y7)/3
t7 y7 _
18 Dr Madhusudhan Zalki
Cyclical Fluctuations
19 Dr Madhusudhan Zalki
Cyclical Variation
Percent of trend
y y yest
100 100
yest
yest
20 Dr Madhusudhan Zalki
Seasonal Variation
21 Dr Madhusudhan Zalki
Stationary time series
Stationary time series is one whose properties
do not depend on the time at which the series is
observed.
Thus, time series with trends, or with seasonality,
are not stationary
the trend and seasonality will affect the value of
the time series at different times. On the other
hand, a white noise series is stationary
it does not matter when you observe it, it should
look much the same at any point in time.
22 Dr Madhusudhan Zalki
{Xt} is a strictly stationary time series
if (X1,...,Xn)’ (X1+h,...,Xn+h)’ for all all integers
h and n ≥ 1. (Here is used to indicate that the
two random vectors have the same joint
distribution function.)
23 Dr Madhusudhan Zalki
Properties
Properties of a Strictly Stationary Time Series {Xt}:
a) The random variables Xt are identically
distributed.
b). (Xt, Xt+h)’ (X1, X1+h)’ for all integers t and h.
c. {Xt} is weakly stationary if E(X2t ) < ∞ for all t.
d. Weak stationarity does not imply strict
stationarity.
e. An iid sequence is strictly stationary.
24 Dr Madhusudhan Zalki
25 Dr Madhusudhan Zalki
differencing
One way to make a non-stationary time series
stationary
Compute the differences between consecutive
observations. This is known as differencing.
26 Dr Madhusudhan Zalki
Random walk model
The differenced series is the change between
consecutive observations in the original series,
and can be written as
y′t=yt−yt−1.
The differenced series will have only T−1 values,
since it is not possible to calculate a difference y′1
for the first observation.
27 Dr Madhusudhan Zalki
When the differenced series is white noise, the
model for the original series can be written as
yt−yt−1=εt, where εt denotes white noise.
yt=yt−1+εt.
28 Dr Madhusudhan Zalki
29 Dr Madhusudhan Zalki
Autocovarince function(AVCF)
we introduced the concept of stationarity
and defined the autocovariance function
(ACVF) of a stationary time series {Xt} as
γ (h) = Cov(Xt+h, Xt), h= 0, ±1, ±2,...
30 Dr Madhusudhan Zalki
Autocorrelation function
The autocorrelation function (ACF) reveals how
the correlation between any two values of the
signal changes as their separation changes. It is
a time domain measure of the stochastic process
memory, and does not reveal any information
about the frequency content of the process.
Generally, for an error signal, et, the ACF is
defined as,
31 Dr Madhusudhan Zalki
For a stationary stochastic process of variance
σ2, the previous expression for the ACF reduces
to
32 Dr Madhusudhan Zalki
Test for stationarity
Augmented Dickey-Fuller Test
33 Dr Madhusudhan Zalki
If p<=0.05 Ho rejected
If > 0.05 Ho accepted
34 Dr Madhusudhan Zalki
# dickey fuller test
library(tseries)
data=c(3,4,4,5,6,7,6,6,7,8,9,10,12)
plot(data,type='l')
adf.test(data)
35 Dr Madhusudhan Zalki
Properties of the Sample Mean and
Autocorrelation Function
A stationary process {Xt} is characterized, at least
from a second-order point of view, by its mean µ and
its auto covariance function γ (·).
The estimation of µ, γ (·), and the autocorrelation
function ρ(·)= γ (·)/γ (0) from observations X1,...,Xn
therefore plays a crucial role in problems of
inference and in particular in the problem of
constructing an appropriate model for the data. In
this section we examine some of the properties of
the sample estimates and of µ and ρ(·),
respectively.
36 Dr Madhusudhan Zalki
Estimation of µ
is unbiased estimate of since
37 Dr Madhusudhan Zalki
Now if the RHS of equation A converges to 0
If
38 Dr Madhusudhan Zalki
To make inferences about µ using the sample mean , it is
necessary to know the distribution or an approximation
to the distribution of . If the time series is Gaussian
39 Dr Madhusudhan Zalki
An approximate 95% Confidence interval for mean µ
is
Where
40 Dr Madhusudhan Zalki
Estimation of and
and
41 Dr Madhusudhan Zalki
The sample k dimensional covariance matrix is
If is nonnagative definite
42 Dr Madhusudhan Zalki
For systematic inference concerning ρ(h), we need the
sampling distribution of the estimator . Although the
distribution of is intractable for samples from even the
simplest time series models, it can usually be well
approximated by a normal distribution for large sample
sizes. For linear models and in particular for ARMA
models
43 Dr Madhusudhan Zalki
wij =
44 Dr Madhusudhan Zalki
MA(q) process
The MA(q) Process: {Xt} is a moving-average
process of order q if
Xt = Zt + θ1Zt−1 +···+ θqZt−q ,
where
{Zt} ∼ WN(0, σ2)
45 Dr Madhusudhan Zalki
46 Dr Madhusudhan Zalki
Linear Process
The time series {Xt} is a linear process if it has the
representation
47 Dr Madhusudhan Zalki
ARMA process
48 Dr Madhusudhan Zalki