MatLab Lecture 17 Covariance and Autocorrelation Lecture 01 Using MatLab Lecture 02 Looking At Data Lecture 03 Probability and Measurement Error Lecture 04 Multivariate Distributions ID: 728896
Download Presentation The PPT/PDF document "Environmental Data Analysis with" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Environmental Data Analysis with MatLab
Lecture 17:
Covariance and AutocorrelationSlide2
Lecture 01
Using
MatLabLecture 02 Looking At DataLecture 03 Probability and Measurement Error Lecture 04 Multivariate DistributionsLecture 05 Linear ModelsLecture 06 The Principle of Least SquaresLecture 07 Prior InformationLecture 08 Solving Generalized Least Squares ProblemsLecture 09 Fourier SeriesLecture 10 Complex Fourier SeriesLecture 11 Lessons Learned from the Fourier Transform Lecture 12 Power Spectral DensityLecture 13 Filter Theory Lecture 14 Applications of Filters Lecture 15 Factor Analysis Lecture 16 Orthogonal functions Lecture 17 Covariance and AutocorrelationLecture 18 Cross-correlationLecture 19 Smoothing, Correlation and SpectraLecture 20 Coherence; Tapering and Spectral Analysis Lecture 21 InterpolationLecture 22 Hypothesis testing Lecture 23 Hypothesis Testing continued; F-TestsLecture 24 Confidence Limits of Spectra, Bootstraps
SYLLABUSSlide3
purpose of the lecture
apply the idea of covariance
to time seriesSlide4
Part 1
correlations between random variablesSlide5
Atlantic Rock DatasetScatter plot of TiO2
and Na
2OTiO2Na2OSlide6
TiO
2
Na2Od1d2scatter plotidealization as a p.d.f.Slide7
d
1
d2positive correlationd1d2d1d2negative correlationuncorrelatedtypes of correlationsSlide8
the covariance matrix
C =
σ12σ22σ1,2σ32…σ
1,3
σ
2,3
σ
1,2
σ
2,3
σ
1,3
…
…
…
…
…
…Slide9
recall the covariance matrix
C =
σ12σ22σ1,2σ32…σ
1,3
σ
2,3
σ
1,2
σ
2,3
σ
1,3
…
…
…
…
…
…
covariance of
d
1
and
d
2Slide10
estimating covariance from dataSlide11
d
i
djDdiDdj
bin, s
divide
(
d
i
,
d
j
)
plane into binsSlide12
d
i
djDdiDdj
bin, s with N
s
data
estimate total probability in bin from the data:
P
s
= p(
d
i
,
d
j
)
Δ
d
i
Δ
d
j
≈ N
s
/NSlide13Slide14
approximate integral with sum and use p(
d
i, dj) Δdi Δdj≈Ns/NSlide15
approximate integral with sum and use p(
d
i, dj) Δdi Δdj≈Ns/Nshrink bins so no more than one data point in each binSlide16
“sample” covarianceSlide17
normalize to range ±1
“sample” correlation coefficientSlide18
Rij
-1
perfect negative correlation0no correlation1perfect positive correlation Slide19
SiO
2
TiO2Al2O2FeOMgOCaONa2OK2OSiO2TiO2Al2O2FeOMgOCaONa2O
K
2
O
|
R
ij
|
of the Atlantic Rock DatasetSlide20
SiO
2
TiO2Al2O2FeOMgOCaONa2OK2OSiO2TiO2Al2O2FeOMgOCaONa2O
K
2
O
|
R
ij
|
of the Atlantic Rock Dataset
0.73Slide21
Atlantic Rock DatasetScatter plot of TiO2
and Na
2OTiO2Na2OSlide22
Part 2
correlations between samples within a time seriesSlide23
A) time series,
d(t)
time t, daysd(t), cfsNeuse River HydrographSlide24
high degree of short-term correlation
what ever the river was doing yesterday, its probably doing today, too
because water takes time to drain awaySlide25
A) time series,
d(t)
time t, daysd(t), cfsNeuse River HydrographSlide26
low degree of intermediate-term correlation
what ever the river was doing last month, today it could be doing something completely different
because storms are so unpredictableSlide27
A) time series,
d(t)
time t, daysd(t), cfsNeuse River HydrographSlide28
moderate degree of long-term correlation
what ever the river was doing this time last year, its probably doing today, too
because seasons repeatSlide29
A) time series,
d(t)
time t, daysd(t), cfsNeuse River HydrographSlide30
1 day
3 days
30 daysSlide31
Let’s assume different samples in time series are random variables and calculate their covarianceSlide32
usual formula for the covariance
assuming time series has zero meanSlide33
now assume that the time series is stationary
(statistical properties don’t vary with time)
so that covariance depends only ontime lag between samplesSlide34
time series of length N
time lag of
(k-1)ΔtSlide35
1
using the same approximation for the sample covariance as beforeSlide36
1
using the same approximation for the sample covariance as before
autocorrelationat lag (k-1)Δt Slide37
autocorrelation in MatLabSlide38
Autocorrelation on Neuse River HydrographSlide39
Autocorrelation on Neuse River Hydrograph
symmetric about zero
a point in a time series correlates equally well with another in the future and another in the pastSlide40
Autocorrelation on Neuse River Hydrograph
peak at zero lag
a point in time series is perfectly correlated with itselfSlide41
Autocorrelation on Neuse River Hydrograph
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 daysSlide42
Autocorrelation on Neuse River Hydrograph
negative correlation at lag of 182 days
points separated by a half year are negatively correlatedSlide43
Autocorrelation on Neuse River Hydrograph
positive correlation at lag of 360 days
points separated by a year are positively correlatedSlide44
A)
B)
Autocorrelation on Neuse River Hydrographrepeating patternthe pattern of rainfall approximately repeats annuallySlide45
autocorrelation similar to convolutionSlide46
autocorrelation similar to convolution
note difference in signSlide47
Important Relation #1autocorrelation is the convolution of a time series with its time-reversed selfSlide48Slide49
integral form of autocorrelationSlide50
integral form of autocorrelation
change of variables,
t’=-tSlide51
integral form of autocorrelation
change of variables,
t’=-twrite as convolutionSlide52
Important Relationship #2Fourier Transform of an autocorrelation
is proportional to the
Power Spectral Density of time seriesSlide53
so
sinceSlide54
so
sinceSlide55
so
since
Fourier Transform of a convolution is product of the transformsSlide56
so
since
Fourier Transform of a convolution is product of the transformsFourier Transform integralSlide57
so
since
Fourier Transform of a convolution is product of the transformsFourier Transform integraltransform of variables, t’=-tSlide58
so
since
Fourier Transform of a convolution is product of the transformsFourier Transform integraltransform of variables, t’=-tsymmetry properties of Fourier TransformSlide59
Summary
time
lag
0
frequency
0
rapidly fluctuating
time series
narrow autocorrelation function
wide spectrumSlide60
Summary
time
lag
0
frequency
0
slowly fluctuating
time series
wide autocorrelation function
narrow spectrum