Professional Documents
Culture Documents
Lecture 18:
Cross-correlation
SYLLABUS
Lecture 01 Using MatLab
Lecture 02 Looking At Data
Lecture 03 Probability and Measurement Error
Lecture 04 Multivariate Distributions
Lecture 05 Linear Models
Lecture 06 The Principle of Least Squares
Lecture 07 Prior Information
Lecture 08 Solving Generalized Least Squares Problems
Lecture 09 Fourier Series
Lecture 10 Complex Fourier Series
Lecture 11 Lessons Learned from the Fourier Transform
Lecture 12 Power Spectral Density
Lecture 13 Filter Theory
Lecture 14 Applications of Filters
Lecture 15 Factor Analysis
Lecture 16 Orthogonal functions
Lecture 17 Covariance and Autocorrelation
Lecture 18 Cross-correlation
Lecture 19 Smoothing, Correlation and Spectra
Lecture 20 Coherence; Tapering and Spectral Analysis
Lecture 21 Interpolation
Lecture 22 Hypothesis testing
Lecture 23 Hypothesis Testing continued; F-Tests
Lecture 24 Confidence Limits of Spectra, Bootstraps
purpose of the lecture
autocorrelation
correlations between samples within a
time series
high degree of short-term correlation
0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
9
x 10
d(t), cfs
8
6
4
2
2
0
0 0.005 0.01 0.015
time0.02
t, days 0.025 0.03 0.035 0.04 0.045 0.05
frequency, cycles per day
low degree of intermediate-term correlation
what ever the river was doing last month, today it could
be doing something completely different
0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
9
x 10
d(t), cfs
8
6
4
2
2
0
0 0.005 0.01 0.015
time0.02
t, days 0.025 0.03 0.035 0.04 0.045 0.05
frequency, cycles per day
moderate degree of long-term correlation
what ever the river was doing this time last year, its
probably doing today, too
0
0 500 1000 1500 2000 2500 3000 3500 4000
time, days
9
x 10
d(t), cfs
8
6
4
2
2
0
0 0.005 0.01 0.015
time0.02
t, days 0.025 0.03 0.035 0.04 0.045 0.05
frequency, cycles per day
1 day 3 days 30 days
4 4 4
x 10 x 10 x 10
2.5 2.5 2.5
2 2 2
1 1 1
0 0 0
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
discharge 4 discharge 4 discharge 4
x 10 x 10 x 10
a u t o c o r r e l a t ioa nu t o c o r r e l a t i o n
Autocorrelation Function
6
x 10
0
-30 -20 -10 0 10 20 30
lag, days
6
x 10
5
0
-5
1 3 30
formula for covariance
formula for autocorrelation
autocorrelation
at lag (k-1)Δt
autocorrelation similar to convolution
autocorrelation similar to convolution
time, days
time, days
rain, mm/day
time, days
rain ahead of
discharge
dischagre, m3/s
time, days
rain, mm/day
time, days
shape not
exactly the
dischagre, m3/s
same, either
time, days
treat two time series u and v probabilistically
p.d.f.
p(ui, vi+k-1)
cross-spectral density
cross-correlation in MatLab
Part 2
aligning time-series
a simple application of cross-correlation
central idea
u(t)
-1
10 20 30 40 50 60 70 80 90 100
1
v(t)
0
-1
10 20 30 40 50 60 70 80 90 100
cross-correlate
5
cross-correlation
-5
-20 -10 0 10 20
time
find maximum
maximum
5
cross-correlation
-5
-20 -10 0 10 20
time
time lag
In MatLab
In MatLab
compute cross-
correlation
In MatLab
compute cross-
correlation
find maximum
In MatLab
compute cross-
correlation
find maximum
u(t)
0
-1
10 20 30 40 50 60 70 80 90 100
v(t+tlag)
1
-1
10 20 30 40 50 60 70 80 90 100
solar insolation and ground level ozone
(this is a real dataset from West Point NY)
A)
o z o n e , p p bs o la r, W / m 2o z o n e , p p bs o la r, W / m 2
500
0
2 4 6 8 10 12 14
time, days
100
50
0
2 4 6 8 10 12 14
B) time, days
500
0
2 4 6 8 10 12 14
time, days
100
50
0
2 4 6 8 10 12 14
time, days
solar insolation and ground level ozone
o z o n e , p p bs o la r, W / m 2o z o n e , p p bs o la r, W / m 2
500
0
2 4 6 8 10 12 14
time, days
100
50
0
2 4 6 8 10 12 14
B) time, days
500
0
2 4 6 8 10 12 14
time, days
100
50
0
2 4 6 8 10 12 14
time, days
3
cross-correlation
0
-10 -5 0 5 10
time, hours
time lag
3 hours
A)
solar radiation, W/m2
500
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time, days
B)
3.00 hour lag original
100 delagged
ozone, ppb
50
0
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time, days