Upload
siusan
View
32
Download
0
Tags:
Embed Size (px)
DESCRIPTION
autocorrelation correlations between samples within a single time series. Neuse River Hydrograph. A) time series, d(t). d(t), cfs. time t, days. - PowerPoint PPT Presentation
Citation preview
autocorrelation
correlations between samples within a single time series
0 500 1000 1500 2000 2500 3000 3500 40000
1
2x 10
4
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
8x 10
9
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
high degree of short-term correlation
whatever the river was doing yesterday, its probably doing today, too
because water takes time to drain away
0 500 1000 1500 2000 2500 3000 3500 40000
1
2x 10
4
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
8x 10
9
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
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
0 500 1000 1500 2000 2500 3000 3500 40000
1
2x 10
4
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
8x 10
9
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
moderate degree of year-lagged correlation
what ever the river was doing this time last year, its probably doing today, too
because seasons repeat
0 500 1000 1500 2000 2500 3000 3500 40000
1
2x 10
4
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
8x 10
9
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
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
autocorrelation in MatLab
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
Autocovariance = Autocorrelation x sdev^2
31 30
CFS2
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
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.
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
symmetric about zero
corr(x,y) = corr(y,x)
Autocovariance of Neuse River Hydrograph
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
peak at zero lag
a point in time series is perfectly correlated with itself
Autocovariance of Neuse River Hydrograph
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
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
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
negative correlation at lag of 182 days
points separated by a half year are negatively correlated
Autocovariance of Neuse River Hydrograph
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
positive correlation at lag of 360 days
points separated by a year are positively correlated
Autocovariance of Neuse River Hydrograph
-30 -20 -10 0 10 20 300
5
x 106
lag, days
auto
corre
latio
n
-3000 -2000 -1000 0 1000 2000 3000
-505
x 106
lag, days
auto
corre
latio
n
A)
B)
repeating pattern
the pattern of rainfall approximately repeats annually
Autocovariance of Neuse River Hydrograph
autocorrelation in MatLab
autocovariance related to convolution
Important Relation #1autocorrelation is the convolution of a time series with its time-reversed self.
This is symmetric of course.
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)
Summary
time
lag
0
frequency0
rapidly fluctuating time series
narrow autocorrelation function
wide spectrum
Summary
time
lag
0
frequency0
slowly fluctuating time series
wide autocorrelation function
narrow spectrum
End of Review
Part 1
correlations between time-series
scenario
discharge correlated with rain
but discharge is delayed behind rain
because rain takes time to drain from the land
time, days
time, days
rain
, mm
/day
disc
hagr
e, m
3 /s
time, days
time, days
rain
, mm
/day
disc
hagr
e, m
3 /s
rain ahead ofdischarge
time, days
time, days
rain
, mm
/day
disc
hagr
e, m
3 /s
shape not exactly the same, either
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
this defines the cross-covariance
cross-correlation in MatLab
just a generalization of the auto-covariance
different times in the same time series
different times in different time series
like autocorrelation, it is similar to a convolution
As with auto-correlation,two important properties
#1: relationship to convolution
#2: relationship to Fourier Transform
As with auto-correlationtwo important properties
#1: relationship to convolution
#2: relationship to Fourier Transform
cross-spectral density
Example
aligning time-seriesa simple application of cross-correlation
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
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)
-20 -10 0 10 20
-5
0
5
time
cros
s-co
rrela
tion
cross-correlation
-20 -10 0 10 20
-5
0
5
time
cros
s-co
rrela
tion
maximum
time lag
find maximum
In MatLab
In MatLab
compute cross-correlation
In MatLab
compute cross-correlation
find maximum
In MatLab
compute cross-correlation
find maximum
compute time lag
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
A)
B)
2 4 6 8 10 12 140
500
time, days
solar,
W/m
2
2 4 6 8 10 12 140
50100
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
50100
time, days
ozon
e, p
pbsolar insolation and ground level ozone
(this is a real dataset from West Point NY)
B)
2 4 6 8 10 12 140
500
time, days
solar,
W/m
2
2 4 6 8 10 12 140
50100
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
50100
time, days
ozon
e, p
pbsolar insolation and ground level ozone
note time lag
-10 -5 0 5 100
1
2
3
4x 10
6
time, hours
cros
s-co
rrela
tion
C)maximum
time lag3 hours
Coherence
a way to quantifyfrequency-dependent correlation
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
time, years
time, years
1 2 3
1 2 3
win
d sp
eed
tem
pera
ture
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
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
in this casetimes series correlated at long periods
but not at short periods
Scenario B
in a hypothetical region
plankton growth rate and precipitation correlate at periods of a few weeks
but they do not correlate seasonally
time, years
time, years
1 2 3
1 2 3
grow
th ra
tepr
ecip
itatio
n
time, years
time, years
1 2 3
1 2 3
plan
t gro
wth
rate
prec
ipita
tion
summer drier than winter
growth rate has no seasonal signal
time, years
time, years
1 2 3
1 2 3
plan
t gro
wth
rate
prec
ipita
tion
growth rate high at times of peak precipitation
in this casetimes series correlated at short periods
but not at long periods
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)
Fourier transform route toCoherence
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
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.