0% found this document useful (0 votes)
53 views

Module 8: Time Series Analysis

This document summarizes key aspects of time series analysis discussed in Module 8. It outlines the various components that can make up a time series, including trends, seasonality, cycles, excursions, and random error. It also describes techniques for detecting changes and trends in time series data, such as the Mann-Kendall test and Durbin-Watson test. Finally, it provides a brief overview of time series models, including autoregressive, moving average, and autoregressive moving average models.

Uploaded by

Wisdom Torgby
Copyright
© Attribution Non-Commercial (BY-NC)
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)
53 views

Module 8: Time Series Analysis

This document summarizes key aspects of time series analysis discussed in Module 8. It outlines the various components that can make up a time series, including trends, seasonality, cycles, excursions, and random error. It also describes techniques for detecting changes and trends in time series data, such as the Mann-Kendall test and Durbin-Watson test. Finally, it provides a brief overview of time series models, including autoregressive, moving average, and autoregressive moving average models.

Uploaded by

Wisdom Torgby
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 15

Module 8: Time Series Analysis

8.2 Components of a Time Series, Detection of Change Points and Trends, Time Series Models

Components of a Time Series


There can be several things happening simultaneously in a time series:
A trend in the mean A seasonal component that shows a regular pattern repeating on a set cycle (yearly or daily temperatures for example) A cyclic component that is separate from seasonality (19 year tidal cycle) Excursions due to an outside influence (may be temporary or permanent) A random error component
4/12/2002 Module 8.2 2

Components of a Time Series


800

Time Series

Value

600 400 200 0 Jan-95 Jan-96 Dec-96 Time Dec-97 Dec-98

4/12/2002

Module 8.2

Components of a Time Series


This series has a linear trend and a 12 month seasonal component and some sort up upset at 37 months and random error
4

800
Value

Time Series

600 400 200 0 Jan-95 Jan-96 Dec-96 Time Dec-97 Dec-98

4/12/2002

Module 8.2

Components of a Time Series


Any given time series may have a combination of these sort of characteristics. The main thing about time series analysis is that it is needed when the data are autocorrelated - thats when the standard techniques fail.
4/12/2002 Module 8.2 5

Detection of Change Points


Detecting a change point means finding an upset or shift in the mean. If it happened at a known time (a known release occurred) then it involves testing for a change in the mean before and after the event. Note that you must use techniques that do not assume independence if significant autocorrelation exists.
4/12/2002 Module 8.2 6

Detection of Change Points


Nonparametric techniques will work in this case. If the change occurred at an unknown time, it is a very difficult problem. Consult an expert.

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

600 400 200 0 0 10 20 30 Time 40 50 60

4/12/2002

Module 8.2

Detection of a Trend
Residuals from Regression
200

Residuals

100 0 -100 0 10 20 Time 30 40 50

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

Detection of Autocorrelation Durbin-Watson Test Example


Time 1 2 3 4 5 6 7 8 9 10 11 12 13 14 and so on Predicted Y Residuals 8.02 15.44 18.51 3.87 29.01 69.90 39.50 74.11 49.99 40.23 60.48 -20.48 70.97 -33.38 81.46 -16.43 91.95 -77.01 102.44 -42.07 112.94 -59.35 123.43 23.27 133.92 6.43 144.41 30.59 and so on and so on Square of Square of Residuals Differences Differences 238.52 14.99 -11.57 133.93 4885.66 66.03 4359.46 5492.77 4.22 17.77 1618.31 -33.88 1148.19 419.41 -60.71 3685.44 1114.54 -12.91 166.54 269.80 16.96 287.61 5930.29 -60.58 3670.28 1770.22 34.93 1220.41 3521.98 -17.27 298.33 541.37 82.61 6825.03 41.41 -16.83 283.34 935.79 24.16 583.50 and so on and so on and so on 155675.64 108745.6353

V=
4/12/2002 Module 8.2

0.70
13

Detection of Autocorrelation Durbin-Watson Test Example


V=0.70 n=48 p=1 (regression on one variable) d1 = 1.42 (for n=50) d2 = 1.50 (for n=50) The test is significant since V is less than 1.42
4/12/2002 Module 8.2 14

Detection of Autocorrelation Durbin-Watson Test Example


Conclusion: The data are significantly positively autocorrelated. The use of regression analysis is inappropriate since regression analysis assumes independent data (Note on Durbin-Watson test: If the test had been close, use linear interpolation to calculate the values for d1 and d2 in between the values given in the table)
4/12/2002 Module 8.2 15

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

Time Series Models


Throughout this module, I have referred to time series analysis but havent described what it is exactly. Much of that is because time series analysis is complex and its details are beyond the scope of this course However, I will give a brief overview of time series analysis
4/12/2002 Module 8.2 23

Time Series Models


A time series model involves explicitly modeling the residuals as autocorrelated For example:
t = t-1 + ut or t = 1t-1 + 2t-2 + ut and so on where ut are normally distributed random errors
4/12/2002 Module 8.2 24

12

Time Series Models


There are several types of models for the errors:
Autoregressive (AR) Moving average (MA) Autoregressive moving average (ARMA) Integrated autoregressive moving average (ARIMA)

4/12/2002

Module 8.2

25

Time Series Models


Special software is needed to help determine which of these models is best for a series Two correlograms are used: the autocorrelation function (ACF) and the partial autocorrelation function (PACF) Together they can help the modeler determine if the best error model is AR, MA or a mixed model
4/12/2002 Module 8.2 26

13

Time Series Models


Autocorrelation Plot
1.0 0.5 0.0 -0.5 -1.0 0

Correlation

10

20 Lag

30

40

4/12/2002

Module 8.2

27

Time Series Models


Partial Autocorrelation Plot
1.0 0.5 0.0 -0.5 -1.0 0

Correlation

10

20 Lag

30

40

4/12/2002

Module 8.2

28

14

Time Series Models


Time Series Steps:
Differencing to remove trend Seasonal differencing to remove seasonality Re-do ACF and PACF plots Determine order of AR and MA portions of series Use to forecast
4/12/2002 Module 8.2 29

Time Series Analysis


The main point of module 8 is to be aware that autocorrelation can exist when data points are close together in time and that the presence of autocorrelation can make the use of standard techniques such as regression analysis inappropriate. Alternative techniques include nonparametric analysis and time series analysis

4/12/2002

Module 8.2

30

15

You might also like