Presentation is loading. Please wait.

Presentation is loading. Please wait.

Environmental Data Analysis with MatLab Lecture 17: Covariance and Autocorrelation.

Similar presentations


Presentation on theme: "Environmental Data Analysis with MatLab Lecture 17: Covariance and Autocorrelation."— Presentation transcript:

1 Environmental Data Analysis with MatLab Lecture 17: Covariance and Autocorrelation

2 Lecture 01Using MatLab Lecture 02Looking At Data Lecture 03Probability and Measurement Error Lecture 04Multivariate Distributions Lecture 05Linear Models Lecture 06The Principle of Least Squares Lecture 07Prior Information Lecture 08Solving Generalized Least Squares Problems Lecture 09Fourier Series Lecture 10Complex Fourier Series Lecture 11Lessons Learned from the Fourier Transform Lecture 12Power Spectral Density Lecture 13Filter Theory Lecture 14Applications of Filters Lecture 15Factor Analysis Lecture 16Orthogonal functions Lecture 17Covariance and Autocorrelation Lecture 18Cross-correlation Lecture 19Smoothing, Correlation and Spectra Lecture 20Coherence; Tapering and Spectral Analysis Lecture 21Interpolation Lecture 22 Hypothesis testing Lecture 23 Hypothesis Testing continued; F-Tests Lecture 24 Confidence Limits of Spectra, Bootstraps SYLLABUS

3 purpose of the lecture apply the idea of covariance to time series

4 Part 1 correlations between random variables

5 Atlantic Rock Dataset Scatter plot of TiO 2 and Na 2 O TiO 2 Na 2 O

6 TiO 2 Na 2 O d1d1 d2d2 scatter plot idealization as a p.d.f.

7 d1d1 d2d2 positive correlation d1d1 d2d2 d1d1 d2d2 negative correlation uncorrelated types of correlations

8 the covariance matrix C = σ12σ12 σ22σ22 σ 1,2 σ32σ32 … σ 1,3 σ 2,3 σ 1,2 σ 2,3 σ 1,3 … … … … … …

9 recall the covariance matrix C = σ12σ12 σ22σ22 σ 1,2 σ32σ32 … σ 1,3 σ 2,3 σ 1,2 σ 2,3 σ 1,3 … … … … … … covariance of d 1 and d 2

10 estimating covariance from data

11 didi djdj didi djdj bin, s divide (d i, d j ) plane into bins

12 didi djdj didi djdj 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 /N

13

14 approximate integral with sum and use p(d i, d j ) Δd i Δd j ≈N s /N

15 shrink bins so no more than one data point in each bin

16 “sample” covariance

17 normalize to range ± 1 “sample” correlation coefficient

18 R ij -1 perfect negative correlation 0 no correlation 1 perfect positive correlation

19 SiO 2 TiO 2 Al 2 O 2 FeO MgO CaO Na 2 O K2OK2O SiO 2 TiO 2 Al 2 O 2 FeOMgOCaONa 2 OK2OK2O |R ij | of the Atlantic Rock Dataset

20 SiO 2 TiO 2 Al 2 O 2 FeO MgO CaO Na 2 O K2OK2O SiO 2 TiO 2 Al 2 O 2 FeOMgOCaONa 2 OK2OK2O |R ij | of the Atlantic Rock Dataset 0.73

21 Atlantic Rock Dataset Scatter plot of TiO 2 and Na 2 O TiO 2 Na 2 O

22 Part 2 correlations between samples within a time series

23 A) time series, d(t) time t, days d(t), cfs Neuse River Hydrograph

24 high degree of short-term correlation what ever the river was doing yesterday, its probably doing today, too because water takes time to drain away

25 A) time series, d(t) time t, days d(t), cfs Neuse River Hydrograph

26 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 unpredictable

27 A) time series, d(t) time t, days d(t), cfs Neuse River Hydrograph

28 moderate degree of long-term correlation what ever the river was doing this time last year, its probably doing today, too because seasons repeat

29 A) time series, d(t) time t, days d(t), cfs Neuse River Hydrograph

30 1 day3 days30 days

31 Let’s assume different samples in time series are random variables and calculate their covariance

32 usual formula for the covariance assuming time series has zero mean

33 now assume that the time series is stationary (statistical properties don’t vary with time) so that covariance depends only on time lag between samples

34 time series of length N time lag of (k-1)Δt

35 1 using the same approximation for the sample covariance as before

36 1 autocorrelation at lag (k-1)Δt

37 autocorrelation in MatLab

38 Autocorrelation on Neuse River Hydrograph

39 symmetric about zero a point in a time series correlates equally well with another in the future and another in the past

40 Autocorrelation on Neuse River Hydrograph peak at zero lag a point in time series is perfectly correlated with itself

41 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 days

42 Autocorrelation on Neuse River Hydrograph negative correlation at lag of 182 days points separated by a half year are negatively correlated

43 Autocorrelation on Neuse River Hydrograph positive correlation at lag of 360 days points separated by a year are positively correlated

44 A) B) Autocorrelation on Neuse River Hydrograph repeating pattern the pattern of rainfall approximately repeats annually

45 autocorrelation similar to convolution

46 note difference in sign

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

48

49 integral form of autocorrelation

50 change of variables, t’=-t

51 integral form of autocorrelation change of variables, t’=-t write as convolution

52 Important Relationship #2 Fourier Transform of an autocorrelation is proportional to the Power Spectral Density of time series

53 so since

54 so since

55 so since Fourier Transform of a convolution is product of the transforms

56 so since Fourier Transform of a convolution is product of the transforms Fourier Transform integral

57 so since Fourier Transform of a convolution is product of the transforms Fourier Transform integral transform of variables, t’=-t

58 so since Fourier Transform of a convolution is product of the transforms Fourier Transform integral transform of variables, t’=-t symmetry properties of Fourier Transform

59 Summary time lag 0 frequency0 rapidly fluctuating time series narrow autocorrelation function wide spectrum

60 Summary time lag 0 frequency0 slowly fluctuating time series wide autocorrelation function narrow spectrum


Download ppt "Environmental Data Analysis with MatLab Lecture 17: Covariance and Autocorrelation."

Similar presentations


Ads by Google