Top Banner
Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions
66

Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

Dec 17, 2015

Download

Documents

Martina Bridges
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

Environmental Data Analysis with MatLab

Lecture 16:

Orthogonal Functions

Page 2: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

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 TransformLecture 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

SYLLABUS

Page 3: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

purpose of the lecture

further develop Factor Analysis

and introduce

Empirical Orthogonal Functions

Page 4: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

review of the last lecture

Page 5: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

example

Atlantic Rock Datasetchemical composition for several thousand rocks

Page 6: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

Rocks are a mix of minerals, and …

mineral 1mineral 2mineral 3

rock 1 rock 2rock 3

rock 4

rock 5 rock 6 rock 7

…minerals have a well-defined composition

Page 7: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

rocks contain elements

rocks contain minerals

and

minerals contain elements

simpler

Page 8: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

rocks contain elements

rocks contain minerals

and

minerals contain elements

simpler

samples

samples factors

factors

Page 9: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 10: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the sample matrix, SN samples by M elements

e.g.sediment samples

rock samples

word element is used in the abstract sense and may not refer to actual chemical elements

Page 11: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the factor matrix, FP factors by M elements

e.g.sediment sources

minerals

note that there are P factorsa simplification if P<M

Page 12: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the loading matrix, CN samples by P factors

specifies the mix of factors for each sample

Page 13: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the key question

how many factors are needed to represent the samples?

and what are these factors?

Page 14: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

singular value decomposition

the methodology foranswer these questions

Page 15: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the matrix of P mutually-perpendicular vectors, each of length M

diagonal matrix Σ,of P singular values

the matrix of P mutually-

perpendicular vectors, each of

length N

sample matrix

Page 16: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the matrix of loadings, C.

the matrix of factors, F

since C depends on Σ,the samples contains more of the factors with large singular values than of the factors with

the small singular values

Page 17: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

in MatLab

Page 18: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

1 2 3 4 5 6 7 80

1000

2000

3000

4000

5000singular values, s(i)

index, i

s(i)

sing

ular

val

ues,

Sii

index, i

plot of M singular values, sorted by size

Page 19: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

1 2 3 4 5 6 7 80

1000

2000

3000

4000

5000singular values, s(i)

index, i

s(i)

sing

ular

val

ues,

Sii

index, i

discard, since close to zero

use it to discard near-zero singular values

Page 20: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

1 2 3 4 5 6 7 80

1000

2000

3000

4000

5000singular values, s(i)

index, i

s(i)

sing

ular

val

ues,

Sii

index, i

and to determine the number P of factors

P=5

Page 21: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

f2 f3 f4 f5

f2p f3p f4p f5p

graphical representation of factors 2 through 5

f5f2 f3 f4

SiO2

TiO2

Al2O3

FeOtotal

MgO

CaO

Na2O

K2O

Atlantic Rock Dataset

Page 22: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

C2

C3

C4

factor loadings C2 through C4 plotted in 3D

factors 2 through 4 capture most of the variability of the rocks

Page 23: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

end of review

Page 24: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

Part 1: Creating Spiky Factors

Page 25: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

can we find “better” factors

that those returned by svd()

?

Page 26: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

mathematically

S = CF = C’ F’with F’ = M F and C’ = M-1 Cwhere M is any P×P matrix with an inverse

must rely on prior information to choose M

Page 27: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

one possible type of prior information

factors should contain mainly just a few elements

Page 28: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

example of minerals

Mineral Composition

Quartz SiO2

Rutile TiO2

Anorthite CaAl2Si2O8

Fosterite Mg2SiO4

Page 29: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

spiky factors

factors containing mostly just a few elements

Page 30: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

How to quantify spikiness?

Page 31: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

variance as a measure of spikiness

Page 32: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

modification for factor analysis

Page 33: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

modification for factor analysis

depends on the square, so positive and negative values are treated the same

Page 34: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

f(1)= [1, 0, 1, 0, 1, 0]T

is much spikier than

f(2)= [1, 1, 1, 1, 1, 1]T

Page 35: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

f(2)=[1, 1, 1, 1, 1, 1]T

is just as spiky as

f(3)= [1, -1, 1, -1, -1, 1]T

Page 36: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

“varimax” procedure

find spiky factors without changing P

start with P svd() factors

rotate pairs of them in their plane by angle θto maximize the overall spikiness

Page 37: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

fB fA

f’B

f’A

q

Page 38: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

determine θ by maximizing

Page 39: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

after tedious trig the solution can be shown to be

Page 40: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

and the new factors are

in this example A=3 and B=5

Page 41: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

now one repeats for every pair of factors

and then iterates the whole process several times

until the whole set of factors is as spiky as possible

Page 42: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

f2 f3 f4 f5

f2p f3p f4p f5p

A) B)

f5f2 f3 f4 f’5f’2f’3 f’4

SiO2

TiO2

Al2O3

FeOtotal

MgO

CaO

Na2O

K2O

example: Atlantic Rock dataset

Page 43: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

Part 2: Empirical Orthogonal Functions

Page 44: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

row number in the sample matrix could be meaningful

example: samples collected at a succession of times

time

Page 45: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

column number in the sample matrix could be meaningful

example: concentration of the same chemical element at a sequence of positions

distance

Page 46: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

S = CFbecomes

Page 47: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

S = CFbecomes

distance dependence time dependence

Page 48: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

S = CFbecomes

each loading: a temporal pattern of variability of the corresponding factor

each factor:a spatial pattern of variability of the element

Page 49: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

S = CFbecomes

there are P patterns and they are sorted into order of importance

Page 50: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

S = CFbecomes

factors now called EOF’s (empirical orthogonal functions)

Page 51: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

example

sea surface temperature in the Pacific Ocean

Page 52: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

29S

29N

124E 290E

latitude

longitude

equatorial Pacific Ocean

sea surface temperature (black = warm)

CAC Sea Surface Temperature

Page 53: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 54: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

the image is 30 by 84 pixels in size, or 2520 pixels total

to use svd(), the image must be unwrapped into a vector of length 2520

Page 55: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

2520 positions in the equatorial Pacific ocean

399

tim

es

“element” means temperature

Page 56: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

sing

ular

val

ues,

Sii

index, i

singular values

Page 57: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

sing

ular

val

ues,

Sii

index, i

singular values

no clear cutoff for P, but the first 10 singular values are considerably larger than the rest

Page 58: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 59: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 60: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 61: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 62: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 63: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.
Page 64: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

using SVD to approximate data

Page 65: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

S=CMFM

S=CPFP

S≈CP’FP’

With M EOF’s, the data is fit exactly

With P chosen to exclude only zero singular values, the data is fit exactly

With P’<P, small non-zero singular values are excluded too, and the data is fit only approximately

Page 66: Environmental Data Analysis with MatLab Lecture 16: Orthogonal Functions.

A) Original B) Based on first 5 EOF’s