Module 8: Time Series Analysis
Module 8: Time Series Analysis
8.2 Components of a Time Series, Detection of Change Points and Trends, Time Series Models
Time Series
Value
4/12/2002
Module 8.2
800
Value
Time Series
4/12/2002
Module 8.2
4/12/2002
Module 8.2
Detection of a Trend
Another common problem is detecting and modeling a trend. With independent data points, use simple least squares regression analysis. After the model is fit, test for autocorrelation in the residuals using the Durbin-Watson statistic If the residuals are autocorrelated, you must use a different method of fitting than least squares or use time series methods
4/12/2002 Module 8.2 8
Detection of a Trend
Straight Line Regression
800
Value
4/12/2002
Module 8.2
Detection of a Trend
Residuals from Regression
200
Residuals
4/12/2002
Module 8.2
10
Detection of Autocorrelation
Durbin-Watson Test
V=
(e e
i =2 i
i 1
)2
e
i =1
where ei to en are the residuals from the regression analysis NOTE: IN THE BOOK, THIS EQUATION IS INCORRECT V will be 2 if there is no autocorrelation, significantly more than 2 if observations are negatively autocorrelated, and less than 2 if positively autocorrelated
4/12/2002 Module 8.2 11
Detection of Autocorrelation
Durbin-Watson Test
Table B5 (Manly p 302) gives the critical values for the Durbin-Watson Test For example, for a regression of Y on X with 20 data points, run the regression, obtain the residuals, and calculate V. If positive autocorrelation exists (most common in environmental data), V would be less than 2. The data are definitely significantly positively autocorrelated if V<1.08.
4/12/2002 Module 8.2 12
V=
4/12/2002 Module 8.2
0.70
13
Detection of a Trend
Its becoming more and more common to use nonparametric tests of trend for environmental data:
Mann-Kendall Test Seasonal Kendall Test Moving averages
These tests do not assume normally distributed errors; However, the first two still assume independent data points Null hypothesis is always no trend exists
4/12/2002 Module 8.2 16
Detection of a Trend
Mann-Kendall Test
Use for data that do not have a seasonal component n i 1
i = 2 j =1
S = sign( xi x j )
where sign(xi- xj) is -1 for xi- xj <0 0 for xi- xj =0 1 for xi- xj >0
4/12/2002 Module 8.2 17
Detection of a Trend
Mann-Kendall Test
If no trend exists, then S is expected to be zero and has variance Var(S) = n(n-1)(2n+5)/18 If n>10, compare the test statistic Z = S/SE(S) against the critical values from the Standard Normal Table
4/12/2002 Module 8.2 18
Detection of a Trend
Mann-Kendall Test Example
5 6 8 7 6 7 8 9 9 10 Sums = 1 1 -1 -1 1 1 1 0 1 4 1 1 -1 0 1 1 1 1 5
1 0 -1 1 1 1 1 4
1 1 0 1 1 1 5
1 1 1 1 1 5
1 1 1 1 4
1 1 1 3
1 1 2
1 1
33
4/12/2002
Module 8.2
19
Detection of a Trend
Mann-Kendall Test Example
S = 33 Var(S) = n(n-1)(2n+5)/18 = 10*9*25/18=125 SE(S) = 11.2 Z = S/SE(S) = 33/11.2 = 2.95 Prob (Z<-2.95 and Z>2.95)=2*0.002 = 0.004 Conclusion: Reject the null, there is a trend
4/12/2002 Module 8.2 20
10
Detection of a Trend
Seasonal Kendall Test
Use for data that do have a seasonal component Calculate S separately for each season
A season could be a month or could be groups of months like Spring, Summer, Fall, Winter Sum all of the Ss to get ST
ST has expected value zero and variance equal to the sum of the variances of the Ss
4/12/2002 Module 8.2 21
Detection of a Trend
compare the test statistic Z = S/SE(ST) against the critical values from the Standard Normal Table
4/12/2002
Module 8.2
22
11
12
4/12/2002
Module 8.2
25
13
Correlation
10
20 Lag
30
40
4/12/2002
Module 8.2
27
Correlation
10
20 Lag
30
40
4/12/2002
Module 8.2
28
14
4/12/2002
Module 8.2
30
15