Create Presentation
Download Presentation

Download Presentation
## Environmental Data Analysis with MatLab

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Environmental Data Analysis with MatLab**Lecture 18: • Cross-correlation**SYLLABUS**Lecture 01 Using MatLabLecture 02 Looking At DataLecture 03Probability and Measurement ErrorLecture 04 Multivariate DistributionsLecture 05Linear 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**purpose of the lecture**generalize the idea of autocorrelation to multiple time series**Review of last lectureautocorrelationcorrelations between**samples within a time series**high degree of short-term correlationwhat ever the river was**doing yesterday, its probably doing today, toobecause water takes time to drain away**Neuse River Hydrograph**A) time series, d(t) d(t), cfs time t, days**low degree of intermediate-term correlationwhat ever the**river was doing last month, today it could be doing something completely differentbecause storms are so unpredictable**Neuse River Hydrograph**A) time series, d(t) d(t), cfs time t, days**moderate degree of long-term correlationwhat ever the river**was doing this time last year, its probably doing today, toobecause seasons repeat**Neuse River Hydrograph**A) time series, d(t) d(t), cfs time t, days**1 day**3 days 30 days**Autocorrelation Function**1 3 30**formula for autocorrelation**autocorrelation at lag (k-1)Δt**autocorrelation similar to convolution**note difference in sign**Important Relation #1autocorrelation is the convolution of a**time series with its time-reversed self**Important Relationship #2Fourier Transform of an**autocorrelationis proportional to thePower Spectral Density of time series**scenariodischarge correlated with rainbut discharge is**delayed behind rainbecause rain takes time to drain from the land**rain, mm/day**time, days dischagre, m3/s 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 same, either dischagre, m3/s time, days**treat two time series u and v probabilistically**p.d.f. p(ui, vi+k-1) with elements lagged by time (k-1)Δt and compute its covariance**just a generalization of the auto-correlation**different times in different time series different times in the same time series**As with auto-correlationtwo 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**Part 2aligning 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**two similar time-series, with a time shift**(this is simple “test” or “synthetic” dataset) u(t) v(t)**find maximum**maximum time lag**In MatLab**compute cross-correlation**In MatLab**compute cross-correlation find maximum**In MatLab**compute cross-correlation find maximum compute time lag**align time series with measured lag**u(t) v(t+tlag)**solar insolation and ground level ozone**(this is a real dataset from West Point NY) A) B)**solar insolation and ground level ozone**B) note time lag**maximum**C) time lag 3 hours**A)**B) original delagged