autocorrelation correlations between samples within a single time series

65
autocorrelation correlations between samples within a single time series

Upload: cornelius-ross

Post on 31-Dec-2015

226 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Autocorrelation correlations between samples within a single time series

autocorrelation

correlations between samples within a single time series

Page 2: Autocorrelation correlations between samples within a single time series

0 500 1000 1500 2000 2500 3000 3500 40000

1

2

x 104

time, days

disc

harg

e, c

fs

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050

2

4

6

8

x 109

frequency, cycles per dayPS

D,

(cfs

)2 per

cyc

le/d

ay

A) time series, d(t)

time t, days

d(t)

, cfs

Neuse River Hydrograph

Page 3: Autocorrelation correlations between samples within a single time series

high degree of short-term correlation

whatever the river was doing yesterday, its probably doing today, too

because water takes time to drain away

Page 4: Autocorrelation correlations between samples within a single time series

0 500 1000 1500 2000 2500 3000 3500 40000

1

2

x 104

time, days

disc

harg

e, c

fs

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050

2

4

6

8

x 109

frequency, cycles per dayPS

D,

(cfs

)2 per

cyc

le/d

ay

A) time series, d(t)

time t, days

d(t)

, cfs

Neuse River Hydrograph

Page 5: Autocorrelation correlations between samples within a single time series

low degree of intermediate-term correlation

whatever the river was doing last month, today it could be doing something completely different

because storms are so unpredictable

Page 6: Autocorrelation correlations between samples within a single time series

0 500 1000 1500 2000 2500 3000 3500 40000

1

2

x 104

time, days

disc

harg

e, c

fs

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050

2

4

6

8

x 109

frequency, cycles per dayPS

D,

(cfs

)2 per

cyc

le/d

ay

A) time series, d(t)

time t, days

d(t)

, cfs

Neuse River Hydrograph

Page 7: Autocorrelation correlations between samples within a single time series

moderate degree of year-lagged correlation

what ever the river was doing this time last year, its probably doing today, too

because seasons repeat

Page 8: Autocorrelation correlations between samples within a single time series

0 500 1000 1500 2000 2500 3000 3500 40000

1

2

x 104

time, days

disc

harg

e, c

fs

0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.050

2

4

6

8

x 109

frequency, cycles per dayPS

D,

(cfs

)2 per

cyc

le/d

ay

A) time series, d(t)

time t, days

d(t)

, cfs

Neuse River Hydrograph

Page 9: Autocorrelation correlations between samples within a single time series

0 0.5 1 1.5 2 2.5

x 104

0

0.5

1

1.5

2

2.5x 10

4

discharge

disc

harg

e la

gged

by

1 da

ys

0 0.5 1 1.5 2 2.5

x 104

0

0.5

1

1.5

2

2.5x 10

4

discharge

disc

harg

e la

gged

by

3 da

ys

0 0.5 1 1.5 2 2.5

x 104

0

0.5

1

1.5

2

2.5x 10

4

discharge

disc

harg

e la

gged

by

30 d

ays

1 day 3 days 30 days

Page 10: Autocorrelation correlations between samples within a single time series

autocorrelation in MatLab

Page 11: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

Autocovariance = Autocorrelation x sdev^2

31 30

CFS2

Page 12: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

Autocovariance of Neuse River Hydrograph

The decay around 0 lag is like a composite or typical feature of the time series (a blend of the positive and negative excursions).

Periodicities show up as repeating long-range autocorrelations.

Page 13: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

symmetric about zero

corr(x,y) = corr(y,x)

Autocovariance of Neuse River Hydrograph

Page 14: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

peak at zero lag

a point in time series is perfectly correlated with itself

Autocovariance of Neuse River Hydrograph

Page 15: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

falls off rapidly in the first few days

lags of a few days are highly correlated because the river drains the land over the course of a few days

Autocovariance of Neuse River Hydrograph

Page 16: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

negative correlation at lag of 182 days

points separated by a half year are negatively correlated

Autocovariance of Neuse River Hydrograph

Page 17: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

positive correlation at lag of 360 days

points separated by a year are positively correlated

Autocovariance of Neuse River Hydrograph

Page 18: Autocorrelation correlations between samples within a single time series

-30 -20 -10 0 10 20 300

5

x 106

lag, days

auto

corr

elat

ion

-3000 -2000 -1000 0 1000 2000 3000

-505

x 106

lag, days

auto

corr

elat

ion

A)

B)

repeating pattern

the pattern of rainfall approximately repeats annually

Autocovariance of Neuse River Hydrograph

Page 19: Autocorrelation correlations between samples within a single time series

autocorrelation in MatLab

Page 20: Autocorrelation correlations between samples within a single time series

autocovariance related to convolution

Page 21: Autocorrelation correlations between samples within a single time series

Important Relation #1autocorrelation is the convolution of a time series with its time-reversed self.

This is symmetric of course.

Page 22: Autocorrelation correlations between samples within a single time series

Important Relation #2Fourier Transform of an autocorrelation

is proportional to thePower Spectral Density of time series

Recall FT(a*b) = FT(a) x FT(b)

Page 23: Autocorrelation correlations between samples within a single time series

Summary

time

lag

0

frequency0

rapidly fluctuating time series

narrow autocorrelation

function

wide spectrum

Page 24: Autocorrelation correlations between samples within a single time series

Summary

time

lag

0

frequency0

slowly fluctuating time series

wide autocorrelation function

narrow spectrum

Page 25: Autocorrelation correlations between samples within a single time series

End of Review

Page 26: Autocorrelation correlations between samples within a single time series

Part 1

correlations between time-series

Page 27: Autocorrelation correlations between samples within a single time series

scenario

discharge correlated with rain

but discharge is delayed behind rain

because rain takes time to drain from the land

Page 28: Autocorrelation correlations between samples within a single time series

time, days

time, days

rain

, mm

/day

disc

hagr

e, m

3 /s

Page 29: Autocorrelation correlations between samples within a single time series

time, days

time, days

rain

, mm

/day

disc

hagr

e, m

3 /s

rain ahead ofdischarge

Page 30: Autocorrelation correlations between samples within a single time series

time, days

time, days

rain

, mm

/day

disc

hagr

e, m

3 /s

shape not exactly the same, either

Page 31: Autocorrelation correlations between samples within a single time series

treat two time series u and v probabilistically

p.d.f. p(ui, vi+k-1)with elements lagged by time(k-1)Δtand compute its covariance

Page 32: Autocorrelation correlations between samples within a single time series

this defines the cross-covariance

Page 33: Autocorrelation correlations between samples within a single time series

cross-correlation in MatLab

Page 34: Autocorrelation correlations between samples within a single time series

just a generalization of the auto-covariance

different times in the same time series

different times in different time series

Page 35: Autocorrelation correlations between samples within a single time series

like autocorrelation, it is similar to a convolution

Page 36: Autocorrelation correlations between samples within a single time series

As with auto-correlation,two important properties

#1: relationship to convolution

#2: relationship to Fourier Transform

Page 37: Autocorrelation correlations between samples within a single time series

As with auto-correlationtwo important properties

#1: relationship to convolution

#2: relationship to Fourier Transform

cross-spectral density

Page 38: Autocorrelation correlations between samples within a single time series

Example

aligning time-seriesa simple application of cross-correlation

Page 39: Autocorrelation correlations between samples within a single time series

central idea

two time series are best alignedat the lag at which they are most correlated,

which is

the lag at which their cross-correlation is maximum

Page 40: Autocorrelation correlations between samples within a single time series

10 20 30 40 50 60 70 80 90 100-1

0

1

10 20 30 40 50 60 70 80 90 100-1

0

1

u(t)

v(t)

two similar time-series, with a time shift

(this is simple “test” or “synthetic” dataset)

Page 41: Autocorrelation correlations between samples within a single time series

-20 -10 0 10 20

-5

0

5

time

cros

s-co

rrel

atio

n

cross-correlation

Page 42: Autocorrelation correlations between samples within a single time series

-20 -10 0 10 20

-5

0

5

time

cros

s-co

rrel

atio

n

maximum

time lag

find maximum

Page 43: Autocorrelation correlations between samples within a single time series

In MatLab

Page 44: Autocorrelation correlations between samples within a single time series

In MatLab

compute cross-correlation

Page 45: Autocorrelation correlations between samples within a single time series

In MatLab

compute cross-correlation

find maximum

Page 46: Autocorrelation correlations between samples within a single time series

In MatLab

compute cross-correlation

find maximum

compute time lag

Page 47: Autocorrelation correlations between samples within a single time series

10 20 30 40 50 60 70 80 90 100-1

0

1

10 20 30 40 50 60 70 80 90 100-1

0

1

u(t)

v(t+tlag)

align time series with measured lag

Page 48: Autocorrelation correlations between samples within a single time series

A)

B)

2 4 6 8 10 12 140

500

time, days

solar

, W/m

2

2 4 6 8 10 12 140

50

100

time, days

ozon

e, p

pb

2 4 6 8 10 12 140

500

time, days

solar

, W/m

2

2 4 6 8 10 12 140

50

100

time, days

ozon

e, p

pbsolar insolation and ground level ozone(this is a real dataset from West Point NY)

Page 49: Autocorrelation correlations between samples within a single time series

B)

2 4 6 8 10 12 140

500

time, days

solar

, W/m

2

2 4 6 8 10 12 140

50

100

time, days

ozon

e, p

pb

2 4 6 8 10 12 140

500

time, days

solar

, W/m

2

2 4 6 8 10 12 140

50

100

time, days

ozon

e, p

pbsolar insolation and ground level ozone

note time lag

Page 50: Autocorrelation correlations between samples within a single time series

-10 -5 0 5 100

1

2

3

4x 10

6

time, hours

cros

s-co

rrel

atio

n

C)maximum

time lag3 hours

Page 51: Autocorrelation correlations between samples within a single time series

Coherence

a way to quantifyfrequency-dependent correlation

Page 52: Autocorrelation correlations between samples within a single time series

Scenario A

in a hypothetical region

windiness and temperature correlate at periods of a year, because of large scale climate patterns

but they do not correlate at periods of a few days

Page 53: Autocorrelation correlations between samples within a single time series

time, years

time, years

1 2 3

1 2 3

win

d sp

eed

tem

pera

ture

Page 54: Autocorrelation correlations between samples within a single time series

time, years

time, years

1 2 3

1 2 3

win

d sp

eed

tem

pera

ture

summer hot and windy

winters cool and calm

Page 55: Autocorrelation correlations between samples within a single time series

time, years

time, years

1 2 3

1 2 3

win

d sp

eed

tem

pera

ture

heat wave not especially

windy cold snap not especially calm

Page 56: Autocorrelation correlations between samples within a single time series

in this casetimes series correlated at long periods

but not at short periods

Page 57: Autocorrelation correlations between samples within a single time series

Scenario B

in a hypothetical region

plankton growth rate and precipitation correlate at periods of a few weeks

but they do not correlate seasonally

Page 58: Autocorrelation correlations between samples within a single time series

time, years

time, years

1 2 3

1 2 3

grow

th r

ate

prec

ipit

atio

n

Page 59: Autocorrelation correlations between samples within a single time series

time, years

time, years

1 2 3

1 2 3

plan

t gro

wth

rat

epr

ecip

itat

ion

summer drier than winter

growth rate has no seasonal signal

Page 60: Autocorrelation correlations between samples within a single time series

time, years

time, years

1 2 3

1 2 3

plan

t gro

wth

rat

epr

ecip

itat

ion

growth rate high at times of peak precipitation

Page 61: Autocorrelation correlations between samples within a single time series

in this casetimes series correlated at short periods

but not at long periods

Page 62: Autocorrelation correlations between samples within a single time series

Brute force way to get the in-phase part of coherence

band pass filter the two time series, u(t) and v(t)around frequency, ω0

compute their cross correlation(large when the time series are similar in shape)

repeat for many ω0’s to create a function c(ω0)

Page 63: Autocorrelation correlations between samples within a single time series

Fourier transform route toCoherence

Page 64: Autocorrelation correlations between samples within a single time series

The "cross-spectrum"

has 2 parts

“Squared Coherence”

frequency-dependent power (squared covariance)

between two time series

(possibly in a lagged sense)

"Phase difference"

frequency-dependent lag between time series

Page 65: Autocorrelation correlations between samples within a single time series

A subtle point• A single pure sinusoid, a single Fourier component of u(t), is

by definition perfectly correlated (at some lag) with the same-period Fourier component of v(t). Monochromatic cross-spectral coherence is always 1!

• But if u and v are meaningfully, physically connected (with some lag) on some time scale, all the Fourier components with periods near that time scale will exhibit a similar lag.

• Alternately, if there is such a physical relationship, a single given Fourier component (frequency) will exhibit a similar lag between u and v in many realizations (such as segments of a long time series).

• You need to combine several degrees of freedom (Fourier components or realizations) to get meaningful cross-spectral coherence tests for a relationship.