0% found this document useful (0 votes)
22 views19 pages

Lecture 9 Time Series Data Analysis

Uploaded by

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

Lecture 9 Time Series Data Analysis

Uploaded by

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

Environmental Data analysis

Lecture 9

Dr. Zhi NING


Agenda

• Pivot table in excel


• Time series
• Identify the trends
• Analysis of seasonality
• Case study
Pivot table application for time series data

• If a long time series data are given, how to


quickly analyze the data and classify the data
by different time resolution?
• Use
– MINUTE(CELL)
– HOUR(CELL)
– DAY(CELL)
– MONTH(CELL)
• Select Pivot Table tab and apply column/row
selection + Statistical method (average/total
etc)
Time series

• Two objectives
– (a) identifying the nature of the phenomenon
represented by the sequence of observations, and
– (b) forecasting (predicting future values of the time
series variable).
Identify the time series

• Trend
– A general systematic linear or nonlinear
component that changes over time and doesn’t
repeat in the time range.
• Seasonality
– Pattern repeats in systematic intervals over time.
Trend analysis

• No “automatic” tool to identify trend but not


difficult.
• Smoothing data first
– Moving average
– Fitting a function
• Analysis of seasonality
– Autocorrelation correlogram
– Examining the correlograms
Smoothing data

• Moving average (MA)


– Replace each element of the series by simple or
weighted average of surrounding elements.
– Mean of the most recent k data points:

– 30 days moving average


is different from monthly
average!
Smoothing data

• Moving average (MA)


– Medians can be used instead of means.
– Results are less biased by outliers
– More "reliable" curves than moving average
• Examples
• http://www.esrl.noaa.gov/gmd/ccgg/trends/

Single Moving Average


Centered Moving Average?
Smoothing data

• Centered Moving Average


– Odd time or even time average
Smoothing data

• Exponential Smoothing
– In Single Moving Averages, the past observations
are weighted equally, Exponential Smoothing
assigns exponentially decreasing weights as the
observation get older.
– recent observations are given relatively more
weight in forecasting than the older observations.
– Single, double and triple Exponential Smoothing
Smoothing data

• Single exponential smoothing


– Begins by setting S2 to y1, where Si stands for
smoothed observation, y stands for the original
observation.
– For the third period, S3 =  y2 + (1-) S2;

– basic equation of exponential smoothing


Univariate Time Series Models

• Stationarity
– A stationary process has the property that the
mean, variance and autocorrelation structure do
not change over time.
– a flat looking series, without trend, constant
variance over time, a constant autocorrelation
structure over time and no periodic fluctuations
Analysis of Seasonality

• Autocorrelation function (ACF) is collection of


rk’s for k=0,1, 2, …, m (m is not larger than
about n/4, 4 seasons a year).

• (a) and (b) have different


ACF: (a) >0 while (b) is
oscillating between +/-.
• Why?
Analysis of Seasonality

• Autocorrelation function
– Diagnose the structure of time series data;
– Correlation between x and y:

– In time series, adjacent observations can be


correlated: zt and zt-k. (k is the lag distance.)

– n is the total number of observations in the time series.


– K is lag. Lag=2, z1 and z3, z2 and z4.
Autocorrelation function

• Be careful of the equations here

Take z1 to z4 as an example
Note sheet. ACF1.
Using correlogram to identify seasonality

• A correlogram displays correlation


coefficients in graphic form, one for each lag
in a time series.

https://www.itl.nist.gov/div898/handbook/
eda/section3/autocopl.htm
Autocorrelation Plot: Random Data

• We can make the following conclusions from


this plot.
– There are no significant autocorrelations.
– The data are random.
Autocorrelation Plot: Moderate
Autocorrelation
• The data come from an underlying
autoregressive model with moderate positive
autocorrelation.
• Starts with a moderately high autocorrelation
at lag 1 (approximately 0.75) that gradually
decreases.
• Signature of
"moderate autocorrelation"

You might also like