Φασματικη...

57
Μοντέλα Παλινδρόμησης και Επεξεργασία Γνώσης ΧΕΙΜΕΡΙΝΟ ΕΞΑΜΗΝΟ Regression Models and Knowledge Processing WINTER SEMESTER Τμημα Μαθηματικων Αριστοτελειο Πανεπιστημιο Θεσσαλονικης 54124 School of Mathematics Aristotle University of Thessaloniki 54124 Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis Singular Value Decomposition Iωαννης Αντωνιου Χαραλαμπος Μπρατσας [email protected] [email protected]

Transcript of Φασματικη...

Page 1: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Μοντέλα Παλινδρόμησης και

Επεξεργασία Γνώσης

ΧΕΙΜΕΡΙΝΟ ΕΞΑΜΗΝΟ

Regression Models and

Knowledge Processing

WINTER SEMESTER

Τμημα Μαθηματικων

Αριστοτελειο Πανεπιστημιο

Θεσσαλονικης

54124

School of Mathematics

Aristotle University

of Thessaloniki

54124

Φασματικη Αναλυση Συνδιασπορας

Principal Components Analysis

Singular Value Decomposition

Iωαννης Αντωνιου Χαραλαμπος Μπρατσας

[email protected] [email protected]

Page 2: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Συνδιασπορα (Covariance)

cov(X,Y) = 𝛔𝑿𝒀 = 𝐄[(𝐗 − 𝐦𝐗)(𝐘 − 𝐦𝐘)] = 𝐄[𝐗𝐘] − 𝐄[𝐗]𝐄[𝐘] = 𝐄[𝐗𝐘] −𝒎𝑿𝒎𝒀 𝛔𝑿𝒀 = ∑ (𝒙𝝂 −𝒎𝑿)(𝒚𝝂 −𝒎𝒀)𝝆𝜿𝝀𝜿,𝝀 Διακριτες Μεταβλητες

𝛔𝑿𝒀 = ∫ 𝒅𝒙𝒅𝒚(𝒙 −𝒎𝑿)(𝒚 −𝒎𝒀)𝝆(𝒙. 𝒚) +∞

−∞ Συνεχεις Μεταβλητες

𝛔𝑿𝑿 =cov[X,X] = var[X] = Ε[(Χ−Ε[Χ])2 ] = E[X2] − E[X]2 = cor[X,X] − E[X]2 = 𝝈𝜲𝟐

Page 3: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Λημμα 1) cov(X,Y) = E[XY] − E[X]E[Y] = E[XY] −𝒎𝑿𝒎𝒀 2) Covariance is not a SP οf the variables X,Y. Covariance is a SP of the centered Variables (X − 𝑚𝑋), (Y − 𝑚𝑌)

(1) Covariance is a bilinear Form: α,β real numbers

cov[ α1 X1 + α2 X2 , Υ] = α1 cov[X1 , Υ] + α1 cov[X2 , Υ] cov[ X , β1Υ1 + β2Υ2] = β1 cov[X , Υ1] + β2 cov[X , Υ2]

cov[α1 X1 + α2 X2 , β1 Υ1 + β2 Υ2] =

= α1 β1 cov[X1 , Υ1] + α1 β2 cov[X1 , Υ2] + α2 β1 cov[X2 , Υ1] + α2 β2 cov[X2 , Υ2]

(2) cov(A,B) = cov(B,A)

(3) cov[X,X] = var[X] = Ε[(Χ−Ε[Χ])2 ] = E[X2] − E[X]2 = σ2≥ 0

(4) cov[X,X] = 0 ⟺ σ2= 0 ⟺ X is a constant random variable , ae

3) 𝑐𝑜𝑣 (𝑋−𝑚𝑋

𝜎𝑋,𝑌−𝑚𝑌

𝜎𝑌) =

1

𝜎𝑋𝜎𝑌cov(X, Y) = r(X, Y), Αλλαγη σε Τυποποιημενες Μεταβλητες

Page 4: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Θεωρημα For random variables with finite variance:

1) |𝒄𝒐𝒗(𝑿, 𝒀)| ≤ √𝒗𝒂𝒓(𝑿)√𝒗𝒂𝒓(𝒀)

⟺ |𝒄𝒐𝒗(𝑿,𝒀)|

√𝒗𝒂𝒓(𝑿)√𝒗𝒂𝒓(𝒀) ≤ 1

⟺ −1 ≤𝒄𝒐𝒗(𝑿,𝒀)

√𝒗𝒂𝒓(𝑿)√𝒗𝒂𝒓(𝒀) ≤ 1

𝒄𝒐𝒗(𝑿,𝒀)

√𝒗𝒂𝒓(𝑿)√𝒗𝒂𝒓(𝒀) = Pearson’s Coefficient

2) |𝒄𝒐𝒗(𝑿, 𝒀)| = √𝒗𝒂𝒓(𝑿)√𝒗𝒂𝒓(𝒀) ⟺𝑌−𝑚𝑌

𝑋−𝑚𝑋=𝒄𝒐𝒗(𝑿,𝒀)

𝒗𝒂𝒓(𝑿)= ±

√𝒗𝒂𝒓(𝑿)

√𝒗𝒂𝒓(𝒀)

Page 5: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Proof:

H Ανισοτης Cauchy–Schwarz: |⟨𝑥|𝑦⟩|2 ≤ ⟨𝑥|𝑥⟩⟨𝑦|𝑦⟩ Οπου:

⟨𝑥|𝑦⟩ = ∑ 𝑥𝜈∗𝑦𝜈𝜈 το Βαθμωτο Γινομενο των διανυσματων 𝑥 = (

𝑥1𝑥2⋮) , 𝑦 = (

𝑦1𝑦2⋮)

Είναι: |⟨𝑥|𝑦⟩|2 = ⟨𝑥|𝑥⟩⟨𝑦|𝑦⟩ ⟺ y = −⟨𝑥|𝑦⟩⟨𝑥|𝑥⟩

𝑥 = ±√⟨𝑥|𝑥⟩

√⟨𝑦|𝑦⟩𝑥

𝑥 = 𝑋 −𝑚𝑋

𝑦 = 𝑌 −𝑚𝑌

⟨𝑥|𝑦⟩ = 𝐸[𝑥𝑦] = 𝑐𝑜𝑣(𝑋, 𝑌)

⟨𝑥|𝑥⟩ = 𝑣𝑎𝑟(𝑋)

⟨𝑦|𝑦⟩ = 𝑣𝑎𝑟(𝑌)

Η Συνδιασπορα ως Εκτιμηση της Γραμμικης Αλληλεξαρτησης των Χ, Υ

Page 6: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Pearson's coefficient (Συντελεστης Συνδιασπορας Pearson)

𝓇(X, Y) = 𝓇𝑋𝑌 =𝒄𝒐𝒗(𝑿, 𝒀)

√𝒗𝒂𝒓(𝑿)√𝒗𝒂𝒓(𝒀)=σ𝑋𝑌𝝈𝜲𝝈𝜰

= 𝑐𝑜𝑣 (𝑋 −𝑚𝑋𝜎𝑋

,𝑌 − 𝑚𝑌𝜎𝑌

)

mX = E(X), mY = E(Y),

𝜎𝛸2 = E[(X − mX

)2] = 𝐸[𝑋2] − 𝑚𝑋2 , σY

2 = E[(X – mY )2] = 𝐸[𝑌2] − 𝑚𝑌

2

𝜎𝛸 = √∑ (x𝜈 − 𝑚𝑋)2𝑝𝜈𝜈

𝜎𝛸 = √∫ 𝑑𝑥(𝑥 − 𝑚𝑋)2𝜌(𝑥)

+∞

−∞

Page 7: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Δειγμα Μ Μετρησεων των Μεταβλητων Χ,Υ

Variable X Variable Y

Observation 1 𝜒1 𝓎1

Observation 2 𝜒2 𝓎2

⋮ ⋮ ⋮

Observation M 𝜒𝛭 𝓎𝛭

Συνδιασπορα (Covariance) Δείγματος

�̃�𝑿𝒀 =∑ (𝝌𝝂 − �̃�𝜲)(𝓎𝜈 − �̃�𝜰)𝜧𝝂=𝟏

𝜧

Αμεροληπτη Συνδιασπορα Δείγματος:

𝑠𝑋𝑌 =∑ (𝝌𝝂−�̃�𝜲)(𝓎𝜈−�̃�𝜰)𝜧𝝂=𝟏

𝛭−1=

𝛭

𝛭−1�̃�𝑋𝑌

Διορθωση Bessel s𝑋 = √∑ (𝜒𝜈−�̃�)

2𝑀𝜈=1

𝑀−1= √

𝑀

𝑀−1√∑ (𝜒𝜈−�̃�)

2𝑀𝜈=1

𝑀= √

𝑀

𝑀−1�̃�𝑋

Page 8: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Τυποποιημενη Συνδιασπορα Δείγματος

= Συνδιασπορα (Pearson) Δείγματος

= Συσχετιση (Pearson) Δείγματος

= Aμεροληπτη Τυποποιημενη Συνδιασπορα Δείγματος:

�̃�𝜲𝜰 =1

𝑀∑ (

𝜒𝜈−�̃�𝛸

�̃�𝛸) (

𝔂𝜈−�̃�𝛶

�̃�𝛶)𝛭

𝜈=1 =𝟏

𝑴−𝟏∑ (

𝝌𝝂−�̃�𝑿

𝑠𝑋) (

𝔂𝝂−�̃�𝒀

𝑠𝑌)𝜧

𝝂=𝟏 = �̂�𝜲𝜰

ενσωματωνει την Διορθωση Bessel

Page 9: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Αποδειξη

�̃�𝑋𝑌 = �̃�𝑋𝑌�̃�𝛸�̃�𝛶

=

∑ (𝜒𝜈− �̃�𝛸)(𝓎𝜈 − �̃�𝛶)

𝑀𝜈=1

𝛭�̃�𝛸�̃�𝛶

=∑ (

𝜒𝜈− �̃�𝛸�̃�𝛸

) (𝓎𝜈− �̃�𝛶

�̃�𝛶)𝛭

𝜈=1

𝛭

=

∑ (𝜒𝜈− �̃�𝛸)(𝓎𝜈 − �̃�𝛶)

𝑀𝜈=1

𝑀

√∑ (𝜒𝜈 − �̃�𝛸)2𝑀

𝜈=1

𝑀 √∑ (𝓎𝜈 − �̃�𝛶)

2𝑀𝜈=1

𝑀

=∑ (𝜒

𝜈− �̃�𝛸)(𝓎𝜈 − �̃�𝛶)

𝑀𝜈=1

√∑ (𝜒𝜈 − �̃�𝛸)2𝑀

𝜈=1 √∑ (𝓎𝜈 − �̃�𝛶)2𝑀

𝜈=1

r̂(X, Y) = s𝑋𝑌𝑠𝛸𝑠𝛶

=

∑ (𝜒𝜈− �̃�𝛸)(𝓎𝜈 − �̃�𝛶)

𝑀𝜈=1

𝑀 − 1

√∑ (𝜒𝜈 − �̃�𝛸)2𝑀

𝜈=1

𝑀 − 1 √∑ (𝓎

𝜈− �̃�𝛶)

2𝑀𝜈=1

𝑀 − 1

=

=∑ (𝜒𝜈 − �̃�𝛸)(𝓎𝜈 − �̃�𝛶)𝑀𝜈=1

√∑ (𝜒𝜈 − �̃�𝛸)2𝑀

𝜈=1 √∑ (𝓎𝜈 − �̃�𝛶)2𝑀

𝜈=1

Page 10: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Συνδιασπορα Ν Μεταβλητων 𝚾𝟏, 𝚾𝟐, … , 𝚾𝑵

𝝈𝜿𝝀 = 𝐜𝐨𝐯(𝚾𝜿, 𝚾𝝀) = 𝐄[(𝚾𝜿 − 𝐦𝜿) (𝚾𝝀 − 𝐦𝝀)]

𝝈𝜿𝝀 = 𝐜𝐨𝐯(𝚾𝜿, 𝚾𝝀) = 𝐄[𝚾𝜿𝚾𝝀] − 𝐦𝜿 𝐦𝝀

𝐦𝜿 = 𝐄[𝚾𝜿] η Μεση Τιμη της 𝚾𝜿

Ο Πινακας Συνδιασπορας των Ν Μεταβλητων 𝚾𝟏, 𝚾𝟐, … , 𝚾𝑵

𝝈 = (

𝝈𝟏𝟏 ⋯ 𝝈𝟏𝜨⋮ ⋱ ⋮𝝈𝜨𝟏 ⋯ 𝝈𝜨𝜨

)

𝝈 Μη Αρνητικος Συμμετρικος Πινακας, αρα Διαγωνιοποιησιμος

Page 11: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Ο Πιναξ Συσχετισεων των Ν Μεταβλητων 𝚾𝟏, 𝚾𝟐, … , 𝚾𝑵

𝑟 = (

𝑟11 ⋯ 𝑟1𝛮⋮ ⋱ ⋮𝑟𝛮1 ⋯ 𝑟𝛮𝛮

)

𝑟𝜅𝜆 =𝜎𝜅𝜆𝝈𝜿𝝈𝝀

= 𝑐𝑜𝑣 (𝑋𝜅 −𝑚𝜅𝜎𝜅

,𝑌 − 𝑚𝑌𝜎𝑌

) = 𝑐𝑜𝑣 (𝑋𝜅𝜎𝜅,𝑋𝜆𝜎𝜆) =

1

𝜎𝜅𝜎𝜆cov(𝑋𝜅 , 𝑋𝜆)

Η Συσχετιση (Pearson) των Μεταβλητων Χ𝜅 , Χ𝜆

Page 12: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Δειγμα Μ Μετρησεων των N Μεταβλητων 𝚾𝟏, 𝚾𝟐, … , 𝚾𝑵

Data Matrix Μ× Ν

Variables

𝑿𝟏 𝑿𝟐 … 𝑿𝝂 … 𝑿𝑵

Observation 1 𝜒11 𝜒12 … 𝜒1𝜈 … 𝜒1𝑁

Observation 2 𝜒21 𝜒22 … 𝜒2𝜈 … 𝜒2𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

Observation μ 𝜒𝜇1 𝜒𝜇2 … 𝜒𝜇𝜈 … 𝜒𝜇𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

Observation M 𝜒𝑀1 𝜒𝑀2 … 𝜒𝑀𝜈 … 𝜒𝑀𝑁

Page 13: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Πιναξ Μετρησεων (Data Matrix):

Χ = (

𝜒11 ⋯ 𝑥1𝑁⋮ ⋱ ⋮𝜒𝑀1 ⋯ 𝑥𝑀𝑁

) = (𝜒1, … , 𝜒𝛮)

Διανυσμα των Παρατηρησεων της Μεταβλητης 𝑿𝝂, ν=1,2,…,Ν:

(

𝜒1𝜈⋮𝜒𝑀𝜈

) = 𝜒𝑣 = η στηλη ν του Πινακα Μετρησεων

Διανυσμα της Παρατηρησης μ (των Ν Μεταβλητων 𝑿𝝂, ν=1,2,…,Ν):

(

𝜒𝜇1⋮𝜒𝜇𝛮

) = (𝜒𝜇1, 𝜒𝜇2, … , 𝜒𝜇𝛮)𝛵

(𝜒𝜇1, 𝜒𝜇2, … , 𝜒𝜇𝛮) = η γραμμη μ του Πινακα Μετρησεων

Page 14: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Relational Data Base Μ×Ν

Attributes Γνωρισματα, Iδιοτητες

𝑿𝟏 𝑿𝟐 … 𝑿𝝂 … 𝑿𝑵

Instances Πραγματοποιησεις Περιπτωσεις Περιστατικα Records, Registrations Καταγραφες

1 𝜒11 𝜒12 … 𝜒1𝜈 … 𝜒1𝑁

2 𝜒21 𝜒22 … 𝜒2𝜈 … 𝜒2𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

μ 𝜒𝜇1 𝜒𝜇2 … 𝜒𝜇𝜈 … 𝜒𝜇𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

M 𝜒𝑀1 𝜒𝑀2 … 𝜒𝑀𝜈 … 𝜒𝑀𝑁

(

𝜒1𝜈⋮𝜒𝑀𝜈

) = 𝜒𝑣 = Instance Profile of the Attribute 𝚾𝛎

(𝜒𝜇1, 𝜒𝜇2, … , 𝜒𝜇𝛮) = Αttribute Profile of the μ-Instance

Page 15: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Gene Expression Matrix Μ× Ν

Genes Γονιδια

𝑿𝟏 𝑿𝟐 … 𝑿𝝂 … 𝑿𝑵

Expressions Εκφρασεις Περιπτωσεις Περιστατικα

Expression 1 𝜒11 𝜒12 … 𝜒1𝜈 … 𝜒1𝑁

Expression 2 𝜒21 𝜒22 … 𝜒2𝜈 … 𝜒2𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

Expression μ 𝜒𝜇1 𝜒𝜇2 … 𝜒𝜇𝜈 … 𝜒𝜇𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

Expression M 𝜒𝑀1 𝜒𝑀2 … 𝜒𝑀𝜈 … 𝜒𝑀𝑁

(

𝜒1𝜈⋮𝜒𝑀𝜈

) = 𝜒𝑣 = Expression Profile of the Gene 𝚾𝛎

(𝜒𝜇1, 𝜒𝜇2, … , 𝜒𝜇𝛮) = Expression Profile of the μ-Instance

Στην Βιολογια συνηθως εργαζονται με τον Συζυγη Πινακα Ν×M Alter O., Brown P., Botstein D. 2000, Singular value decomposition for genome-wide expression data processing and modeling, Proc Natl Acad Sci USA 97:10101-06.

Page 16: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Neural Net Matrix Μ× Ν

Inputs

𝑿𝟏 𝑿𝟐 … 𝑿𝝂 … 𝑿𝑵

Outputs

Expression 1 𝜒11 𝜒12 … 𝜒1𝜈 … 𝜒1𝑁

Expression 2 𝜒21 𝜒22 … 𝜒2𝜈 … 𝜒2𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

Expression μ 𝜒𝜇1 𝜒𝜇2 … 𝜒𝜇𝜈 … 𝜒𝜇𝑁

⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮

Expression M 𝜒𝑀1 𝜒𝑀2 … 𝜒𝑀𝜈 … 𝜒𝑀𝑁

(

𝜒1𝜈⋮𝜒𝑀𝜈

) = 𝜒𝑣 = Expression Profile of Input 𝚾𝛎

(𝜒𝜇1, 𝜒𝜇2, … , 𝜒𝜇𝛮) = Expression Profile of the μ-Output

Page 17: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

�̃�𝜿𝝀 =∑ (𝝌𝝂𝜿−�̃�𝜿)(𝝌𝝂𝝀−�̃�𝝀)𝜧𝝂=𝟏

𝜧

οπου 𝝌𝝂𝜶 η τιμη της ν-μετρησης της Μεταβλητης 𝑋𝛼

�̃�𝜶 η Δειγματικη Μεση Τιμη της Μεταβλητης 𝑋𝛼

Αμεροληπτη Συνδιασπορα Δειγματος

𝑠𝜿𝝀 =1

𝜧−𝟏∑ (𝝌𝝂𝜿 − �̃�𝝂)(𝝌𝝂𝝀 − �̃�𝝀)𝜧𝝂=𝟏 Διορθωση Bessel

Page 18: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Συσχετιση (Pearson) Δείγματος

= Τυποποιημενη Συνδιασπορα Δείγματος

= Aμεροληπτη Τυποποιημενη Συνδιασπορα Δείγματος:

�̃�𝜿𝝀 =1

𝑀∑(

𝜒𝜈𝜅 − �̃�𝜅�̃�𝜅

) (𝜒𝜈𝜆 − �̃�𝜆�̃�𝜆

)

𝛭

𝜈=1

=1

𝑀 − 1∑(

𝜒𝜈𝜅 − �̃�𝜅𝑠𝜅

) (𝜒𝜈𝜆 − �̃�𝜆

𝑠𝜆) = �̂�𝜿𝝀

𝑀

𝜈=1

ενσωματωνει την Διορθωση Bessel

Page 19: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Λημμα:

�̃� = (�̃�11 ⋯ �̃�1𝑁⋮ ⋱ ⋮�̃�𝛮1 ⋯ �̃�𝑀𝑁

) =1

𝜧𝛹𝑻Ψ

𝒔 = (

𝑠11 ⋯ 𝑠1𝑁⋮ ⋱ ⋮𝑠𝛮1 ⋯ 𝑠𝑀𝑁

) =1

𝜧−𝟏Ψ𝑻Ψ

�̂� = (�̂�11 ⋯ �̂�1𝑁⋮ ⋱ ⋮�̂�𝛮1 ⋯ �̂�𝑀𝑁

) =1

𝜧Ζ𝑻Ζ

Data Matrices

Ψ = (𝜓11 ⋯ 𝜓1𝑁⋮ ⋱ ⋮𝜓𝑀1 ⋯ 𝜓𝑀𝑁

), 𝜓𝜅𝜆 = 𝜒𝜅𝜆 − �̃�𝜆,

Z = (

𝑧11 ⋯ 𝑧1𝑁⋮ ⋱ ⋮𝑧𝑀1 ⋯ 𝑧𝑀𝑁

), 𝑧𝜅𝜆 =𝜒𝜅𝜆−�̃�𝜆

�̃�𝜆

Page 20: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

ΠΑΡΑΔΕΙΓΜΑ:

Ο Πιναξ Συσχετισεων Ν Ανεξαρτητων ανα 2 Μεταβλητων είναι Διαγωνιος :

𝜎𝜿𝝀 = 𝝈𝜲𝜿𝜲𝝀 = 0

Συμβαση

Αναδιατασσουμε τις Ν Μεταβλητες ώστε οι αντιστοιχες Διασπορες

Να διατασσονται κατά φθινουσα σειρα: 𝜎1> 𝜎2>⋯>𝜎𝛮

𝜎 =

(

σ12 0

0 σ22 ⋯ 0

⋮ ⋱ ⋮0 ⋯ σ𝛮

2)

(Ορθες μοναδες μετρησης)

Για 2 Ανεξαρτητες Μεταβλητες Χ,Υ: 𝝈𝜲𝜰 = 0

𝝈 = (𝛔𝟏𝟐 0

0 𝛔𝟐𝟐) 𝜎1 = max(𝝈𝜲, 𝝈𝜰) , 𝜎2 = min(𝝈𝜲, 𝝈𝜰)

Page 21: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Μπορω να Μετασχηματισω τις Μεταβλητες 𝚿𝟏, 𝚿𝟐, … ,𝚿𝑵 σε Ν Ανεξαρτητες

μεταβλητες 𝚼𝟏, 𝚼𝟐, … , 𝚼𝑵 με τις ιδιες Διασπορες 𝝈𝜲𝜿 = 𝝈𝜰𝜿 = 𝝈𝜿?

Bεβαιως!

Μεσω της Διαγωνιοποιησης του Πινακα Συνδιασπορας σ

(Μη Αρνητικος Συμμετρικος, αρα Διαγωνιοποιησιμος).

𝑼𝑻�̃�𝑼 =

(

σ12 0

0 σ22 ⋯ 0

⋮ ⋱ ⋮0 ⋯ σ𝛮

2)

= 𝑈𝑇(𝛹𝑇Ψ)𝑈

𝑈 = (

𝑢11𝑢21

𝑢12𝑢22

⋯𝑢1𝛮𝑢2𝛮

⋮ ⋱ ⋮𝑢𝛮1 𝑢𝛮2 ⋯ 𝑢𝛮𝛮

) = (𝑢1 𝑢2 … 𝑢𝑁)

Page 22: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

U ο Πιναξ N×N με στηλες τα ιδιοανυσματα 𝒖𝝂, ν=1,2,…,Ν του Πινακα σ

𝒖𝝂 = (

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝜨𝝂

) : 𝝈𝒖𝝂 = 𝝀𝝂𝒖𝝂

𝑼𝑻𝝈𝑼 = 𝑈𝑇(𝛹𝑇Ψ)𝑈 = 𝛶𝑇Υ

Υ = (

𝑦11 ⋯ 𝑦1𝑁⋮ ⋱ ⋮𝑦𝑀1 ⋯ 𝑦𝑀𝑁

) o Πιναξ Δεδομενων των Μεταβλητων Υ1, Υ2, … , Υ𝑁

που οριζονται από τον Γραμμικο Μετασχηματισμο

(

𝛶1𝛶2⋮𝛶𝛮

) = 𝑈(

𝛹1𝛹2⋮𝛹𝛮

) = (

𝑢11𝑢21

𝑢12𝑢22

⋯𝑢1𝛮𝑢2𝛮

⋮ ⋱ ⋮𝑢𝛮1 𝑢𝛮2 ⋯ 𝑢𝛮𝛮

)(

𝛹1𝛹2⋮𝛹𝛮

)

Page 23: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Ορισμος

Κυριες Συνιστωσες (Principal Components) του Πινακα Συνδιασπορας = Οι Φασματικες Συνιστωσες που οριζονται απο τα ιδιοανυσματα

Του N x N Πινακα Συνδιακυμανσης

Για κάθε Διανυσμα Μετρησης 𝝌 των Ν Μεταβλητων:

𝜒 = (

𝜒1⋮𝜒𝛮)

Οριζω

Αναπτυγμα σε Κυριες Συνιστωσες του 𝜒

= Το Φασματικο Αναπτυγμα του του χ ως τους αξονες των ιδιανυσματων

του N x N Πινακα Συνδιακυμανσης

Page 24: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Κυριες Συνιστωσες. Σημασια

1) Τα ιδιοανυσματα προκυπτουν απο (Ν-διαστατη) στροφη

2) Οι Πρωτες Κυριες Συνιστωσες φερουν την μεγαλυτερη και σημαντικοτερη

Πληροφορια

3) Οι Μεταβλητες Υ1, Υ2, … , Υ𝑁 οριζουν τις συντεταγμενες των Μετρησεων

στις Κυριες Συνιστωσες

Page 25: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Παραδειγμα: Πιναξ Συνδιασπορας 2 Μεταβλητων (2 dim Covariance Matrix)

𝝈 = (𝝈𝜲𝜲 𝝈𝜲𝜰𝝈𝜲𝜰 𝝈𝜰𝜰

) = (𝛔𝜲𝟐 𝝈𝜲𝜰

𝝈𝜲𝜰 𝛔𝜰𝟐 ) = (

𝛔𝜲𝟐 𝒄𝒐𝒗[𝚾𝚼]

𝒄𝒐𝒗[𝚾𝚼] 𝛔𝜰𝟐 )

𝝈 = (𝐄[𝚾𝚾] −𝐦𝜲 𝐦𝜲 𝐄[𝚾𝚼] −𝐦𝜲 𝐦𝜰

𝐄[𝚼𝚾] −𝐦𝜰 𝐦𝜲 𝐄[𝚼𝚼] −𝐦𝜰 𝐦𝜰)

𝒅𝒆𝒕 (𝝈) = 𝛔𝜲𝟐𝛔𝜰

𝟐 − 𝝈𝜲𝜰𝟐

𝝈−𝟏 =1

det (𝛴)(𝝈𝜰𝜰 −𝝈𝜲𝜰−𝝈𝜲𝜰 𝝈𝜲𝜲

) =1

𝛔𝜲𝟐𝛔𝜰

𝟐 − 𝝈𝜲𝜰𝟐(𝛔𝒀𝟐 −𝝈𝜲𝜰

−𝝈𝜲𝜰 𝛔𝜲𝟐)

Page 26: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Προβλημα Ιδιοτιμων του Πινακα Συνδιασπορας :

Eigenvalues Eigenvectors

σ12 =

𝛔𝜲𝟐 + 𝛔𝜰

𝟐 + √(𝛔𝜲𝟐 − 𝛔𝜰

𝟐)2 − 4𝛔𝜲𝜰𝟐

𝟐 𝐮𝟏 = 𝒏𝟏 (

𝛔𝜲𝟐 + 𝝈𝜲𝜰 − σ2

2

𝛔𝜰𝟐 + 𝝈𝜲𝜰 − σ2

2)

σ22 =

𝛔𝜲𝟐 + 𝛔𝜰

𝟐 − √(𝛔𝜲𝟐 − 𝛔𝜰

𝟐)2 − 4𝛔𝜲𝜰𝟐

𝟐 𝐮𝟐 = 𝒏𝟐 (

𝛔𝜲𝟐 + 𝝈𝜲𝜰 − σ1

2

𝛔𝜰𝟐 + 𝝈𝜲𝜰 − σ1

2)

Page 27: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

𝝈 = 𝑼(σ12 0

0 σ22)𝑼

𝑻

𝑼 = (𝐮𝟏 𝐮𝟐)

Τα ορθογωνια ιδιοανυσματα 𝐮𝟏και 𝐮𝟐 οριζουν

τις Κατευθυνσεις μεγιστης και ελαχιστης συνδιασπορας

Oι προβολες ενός διανυσματος μετρησης 𝜒 = (𝜒1𝜒2)

στις κατευθυνσεις των ιδιοανυσματων 𝐮𝟏και 𝐮𝟐 ειναι

Οι Κυριες Συνιστωσες (Principal Components) του 𝜒

Page 28: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Λημμα

Φασματικη Αναλυση Διαγωνισιμων Πινακων

𝐴 = 𝑈(

α10

0α2

⋯00

⋮ ⋱ ⋮0 0 ⋯

)𝑈−1 =∑𝑎𝜈 (

𝑢1𝜈𝑢2𝜈⋮𝑢𝑁𝜈

)(𝜂𝜈1, 𝜂𝜈2, … , 𝜂𝜈𝑁)

𝛮

𝜈=1

𝐀uν = ανuν

Συμβαση: Οι ιδιοτιμες διατασσονται κατά φθινουσα σειρα: |α1| > |α2| > ⋯

U = (u1 u2 … uN) = (

𝑢11𝑢21

𝑢12𝑢22

⋯𝑢1𝛮𝑢2𝛮

⋮ ⋱ ⋮𝑢𝛮1 𝑢𝛮2 ⋯ 𝑢𝛮𝛮

) = Ο Modal Matrix του Α

U ο Πιναξ N×N με στηλες τα ιδιοανυσματα 𝒖𝝂 = (

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝜨𝝂

), ν=1,2,…,Ν του Πινακα Α

𝑈−1 = (

𝜂11𝜂21

𝜂12𝜂22

⋯𝜂1𝛮𝜂2𝛮

⋮ ⋱ ⋮𝜂𝛮1 𝜂𝛮2 ⋯ 𝜂𝛮𝛮

) ο Αντιστροφος του 𝑈

Page 29: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Φασματικη Αναλυση (της Δρασης) του Πινακα Α

Spectral Decomposition of the Action of A

Α(

𝝌𝟏𝝌𝟐⋮𝝌𝑵

) = ∑ 𝒂𝝂(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝑵𝝂

)(𝜼𝝂𝟏, 𝜼𝝂𝟐, … , 𝜼𝝂𝑵)(

𝝌𝟏𝝌𝟐⋮𝝌𝑵

) = ∑ 𝒂𝝂(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝑵𝝂

)𝜨𝝂=𝟏 (∑ 𝜼𝝂𝜿𝝌𝜿

𝛮𝜅=1 ) 𝜨

𝝂=𝟏

Φασματικες Συνιστωσες Διανυσματων

Decomposition of Vectors in Spectral Components

(

𝝌𝟏𝝌𝟐⋮𝝌𝑵

) =∑(∑𝜼𝝂𝜿𝝌𝜿

𝛮

𝜅=1

)(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝑵𝝂

)

𝜨

𝝂=𝟏

=∑(∑𝜼𝝂𝜿𝝌𝜿

𝛮

𝜅=1

)𝒖𝝂

𝜨

𝝂=𝟏

(∑ 𝜼𝝂𝜿𝝌𝜿𝛮𝜅=1 )𝒖𝝂 η ν-Φασματικη Συνιστωσα του Διανυσματος (

𝝌𝟏𝝌𝟐⋮𝝌𝑵

)

Page 30: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Normal Matrices: 𝐴†𝐴 = 𝐴𝐴†

The Eigenvector basis is Orthogonal

𝐴 = 𝑈(

α10

0α2

⋯00

⋮ ⋱ ⋮0 0 ⋯

)𝑈†

U is Unitary Matrix 𝑼−𝟏 = 𝑼†

Unitary (Normal) Matrices: 𝑨† = 𝑨−1

Eigenvalues on the complex unit circle

Hermitian (Normal) Matrices: 𝐴† = 𝐴

Eigenvalues Real

Real Symmetric (Normal) Matrices: 𝐴𝑇 = 𝐴

Eigenvalues Real

𝐴 = 𝑈(

α10

0α2

⋯00

⋮ ⋱ ⋮0 0 ⋯

)𝑈𝑇

Q is Orthogonal Matrix 𝑈−1 = 𝑈𝑇

Page 31: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

ΠΑΡΑΔΕΙΓΜΑ Συμμετρικος Πιναξ

A=(−4 33 4

)

Προβλημα Ιδιοτιμων, Aψ=αψ:

Ιδιοτιμη Ιδιοδιανυσμα

α1 = 5 e1= (𝟏𝟑) (

−4 33 4

) (𝟏𝟑) = 𝟓 (

𝟏𝟑)

α2 = -5 e2= (−𝟑𝟏) (

−4 33 4

) (−𝟑𝟏) = (−𝟓) (

−𝟑𝟏)

Page 32: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

⟨𝒆𝟏|𝒆𝟐⟩ = ⟨(𝟏𝟑) | (

−𝟑𝟏)⟩ = −𝟑 + 3 = 0

‖𝒆𝟏‖ = √𝟏𝟐 + 𝟑𝟐 = √𝟏𝟎

‖𝒆𝟐‖ = √(−𝟑)𝟐+𝟏𝟐 = √𝟏𝟎

Κανονικοποιηση:

𝑢1 =1

‖𝒆𝟏‖(𝟏𝟑) =

1

√𝟏𝟎(𝟏𝟑)

𝑢2 =1

‖𝒆𝟐‖(𝟏𝟑) =

1

√𝟏𝟎(−𝟑𝟏)

Page 33: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Diagonalizing Matrix:

𝐔 = (𝐮𝟏 𝐮𝟐) =𝟏

√𝟏𝟎(1 −33 1

)

𝐔−𝟏 = 𝑈𝑇 =𝟏

√𝟏𝟎(1 3−3 1

)

Diagonalization

𝐔−𝟏𝑨 𝐔 =𝟏

𝟏𝟎[(1 3−3 1

) ∙ (−4 33 4

) ∙ (1 −33 1

)] = (5 00 −5

)

𝐔−𝟏𝑨 𝐔 =𝟏

𝟏𝟎[5 ∙ (

1 33 −1

) ∙ (1 −33 1

)]

𝐔−𝟏𝑨 𝐔 =𝟏

𝟐[(1 33 −1

) ∙ (1 −33 1

)]

𝐔−𝟏𝑨 𝐔 =𝟏

𝟐[2 (

5 00 −5

)] = (5 00 −5

)

(1 3−3 1

) (−4 33 4

) = (5 1515 −5

) = 5 (1 33 −1

)

(1 33 −1

) (1 −33 1

) = (10 00 −10

) = 2 (5 00 −5

)

Page 34: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

ΠΑΡΑΔΕΙΓΜΑ Πραγματικος Διαγωνιοποιησιμος Πιναξ

𝑨 = (𝟏 𝟐 𝟎𝟎 𝟑 𝟎𝟐 −𝟒 𝟐

)

Eigenvalues Eigenvectors

𝒂𝟏 = 𝟑 𝐞𝟏 = (

−𝟏−𝟏𝟐)

𝒂𝟐 = 𝟐 𝐞𝟐 = (

𝟎𝟎𝟏)

𝒂𝟐 = 𝟏 𝐞𝟑 = (

−𝟏𝟎𝟐)

Page 35: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Μηκη 𝐞𝟏, 𝐞𝟐, 𝐞𝟑:

|| e1|| =√(−𝟏)𝟐 + (−𝟏)𝟐+(𝟐)𝟐 = √𝟔

|| e2|| =√𝟎𝟐 + 𝟎𝟐+(𝟏)𝟐 = 1

|| e3|| =√(−𝟏)𝟐 + 𝟎𝟐+(𝟐)𝟐 = √𝟓

Τα 𝐞𝟏, 𝐞𝟐, 𝐞𝟑 δεν είναι ορθοκανονικα:

⟨𝒆𝟏|𝒆𝟐⟩ = (−𝟏−𝟏𝟐) ∙ (

𝟎𝟎𝟏) = 𝟐

⟨𝒆𝟏|𝒆𝟑⟩ = (−𝟏−𝟏𝟐) ∙ (

−𝟏𝟎𝟐) = 𝟓

⟨𝒆𝟐|𝒆𝟑⟩ = (𝟎𝟎𝟏) ∙ (

−𝟏𝟎𝟐) = 𝟐

Page 36: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Diagonalizing Matrix:

𝐔 = (𝒆𝟏 𝐞𝟐 𝐞𝟑) = (−𝟏 𝟎 −𝟏−𝟏 𝟎 𝟎𝟐 𝟏 𝟐

)

𝐔−𝟏 = (𝟎 −𝟏 𝟎𝟐 𝟎 𝟏−𝟏 𝟏 𝟎

)

Diagonalization

𝐔−𝟏𝑨 𝐔 = (𝟎 −𝟏 𝟎𝟐 𝟎 𝟏−𝟏 𝟏 𝟎

)(𝟏 𝟐 𝟎𝟎 𝟑 𝟎𝟐 −𝟒 𝟐

)(−𝟏 𝟎 −𝟏−𝟏 𝟎 𝟎𝟐 𝟏 𝟐

) = (𝟑 𝟎 𝟎𝟎 𝟐 𝟎𝟎 𝟎 𝟏

)

Page 37: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Spectral Decomposition οf Α

𝐴 = 𝑈(3 0 00 2 00 0 1

)𝑈−1 = (−1 0 −1−1 0 02 1 2

)(3 0 00 2 00 0 1

)(0 −1 02 0 1−1 1 0

) =

𝐴 = 3(−𝟏−𝟏𝟐) (0, −1, 0) + 2(

𝟎𝟎𝟏) (2,0,1) + 1(

−𝟏𝟎𝟐) (−1,1,0)

Spectral Decomposition of the Action of A

Α(

𝝌𝟏𝝌𝟐𝝌𝟑) = 3(

−𝟏−𝟏𝟐) (0,−1, 0) (

𝝌𝟏𝝌𝟐𝝌𝟑) + 2(

𝟎𝟎𝟏) (2,0,1) (

𝝌𝟏𝝌𝟐𝝌𝟑) + 1(

−𝟏𝟎𝟐) (−1,1,0) (

𝝌𝟏𝝌𝟐𝝌𝟑)

Α(

𝝌𝟏𝝌𝟐𝝌𝟑) = 3(−𝝌𝟐) (

−𝟏−𝟏𝟐) + 2(2𝝌𝟏 + 𝝌𝟑) (

𝟎𝟎𝟏) + (−𝝌𝟏 + 𝝌𝟐) (

−𝟏𝟎𝟐)

Α(

𝝌𝟏𝝌𝟐𝝌𝟑) = 3(

𝝌𝟐𝝌𝟐−𝟐𝝌𝟐

) + 2(𝟎𝟎

2𝝌𝟏 + 𝝌𝟑

) + (

𝝌𝟏 − 𝝌𝟐𝟎

−𝟐𝝌𝟏 + 2𝝌𝟐)

Page 38: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Decomposition of Vectors in Spectral Components

(

𝝌𝟏𝝌𝟐𝝌𝟑) = (

𝝌𝟐

𝝌𝟐

−𝟐𝝌𝟐

) + (

𝟎

𝟎

2𝝌𝟏+ 𝝌

𝟑

) + (

𝝌𝟏− 𝝌

𝟐

𝟎

−𝟐𝝌𝟏+ 2𝝌

𝟐

)

(

𝝌𝟐𝝌𝟐−𝟐𝝌𝟐

) η 1η -φασματικη συνιστωσα (Spectral component) του διανυσματος (

𝝌𝟏𝝌𝟐𝝌𝟑)

(𝟎𝟎

2𝝌𝟏 + 𝝌𝟑

) η 2η -φασματικη συνιστωσα (Spectral component) του διανυσματος (

𝝌𝟏𝝌𝟐𝝌𝟑)

(

𝝌𝟏 − 𝝌𝟐𝟎

−𝟐𝝌𝟏 + 2𝝌𝟐) η 3η -φασματικη συνιστωσα (Spectral component) του διανυσματος (

𝝌𝟏𝝌𝟐𝝌𝟑)

Page 39: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

ΠΑΡΑΔΕΙΓΜΑ Markov Matrix

A=(0.9 0.30.1 0.7

)

Προβλημα Ιδιοτιμων, Aψ=αψ:

Ιδιοτιμη Ιδιοδιανυσμα

α1 = 1 e1= (𝟎. 𝟕𝟓𝟎. 𝟐𝟓

) (0.9 0.30.1 0.7

) (𝟎. 𝟕𝟓𝟎. 𝟐𝟓

) = 𝟏 (𝟎. 𝟕𝟓𝟎. 𝟐𝟓

)

α2 = 0.6 e2= (𝟏−𝟏) (

𝟎. 9 0.30.1 𝟎. 7

) (𝟏−𝟏) = 𝟎. 𝟔 (

𝟏−𝟏)

Page 40: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Τα διανυσματα e1 , e2 δεν είναι μοναδιαια

|| e1|| =√(𝟎. 𝟕𝟓)𝟐 + (𝟎. 𝟐𝟓)𝟐 ≃ 0.791

|| e2|| =√2

Τα διανυσματα e1 , e2 δεν είναι ορθογωνια

⟨e1|e2⟩ = 𝟎. 𝟕𝟓 − 𝟎. 𝟐𝟓 = 𝟎. 𝟓 ≠ 𝟎

Page 41: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Diagonalizing Matrix

U = (e1 e2) = (0.75 10.1 −1

)

𝑈−1 = (1 10.25 −0.75

) , A Non-Symmetric Non-Normal στον 𝓗= ℝ2

Diagonalization

U−1𝐴 U = (1 10.25 −0.75

) (0.9 0.30.1 0.7

) (0.75 10.1 −1

) = (1 00 0.6

)

Page 42: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Spectral Decomposition οf Α

𝐴 = 𝑈 (1 00 0.6

)𝑈−1 = (0.75 10.1 −1

) (1 00 0.6

) ( 1 10.25 −0.75

) =

𝐴 = 1(𝟎. 𝟕𝟓𝟎. 𝟐𝟓

) (1,1) + 𝟎. 𝟔 (𝟏−𝟏) (0.25, −0,75)

Spectral Decomposition of the Action of A

Α(𝝌𝟏𝝌𝟐) = (𝟎.𝟕𝟓

𝟎.𝟐𝟓) (1,1) (

𝝌𝟏𝝌𝟐) + 𝟎.𝟔 ( 𝟏

−𝟏) (0.25,−0,75) (

𝝌𝟏𝝌𝟐)

Α(𝝌𝟏𝝌𝟐) = (𝟎.𝟕𝟓

𝟎.𝟐𝟓) (𝝌𝟏+ 𝝌𝟐) + 𝟎.𝟔 (

𝟏−𝟏

) (0.25𝝌𝟏−0,75𝝌𝟐)

Α(𝝌𝟏𝝌𝟐) = (

𝟎. 𝟕𝟓𝝌𝟏 + 𝟎. 𝟕𝟓𝝌𝟐𝟎. 𝟐𝟓𝝌𝟏 + 𝟎. 𝟐𝟓𝝌𝟐

) + 𝟎. 𝟔 (0.25𝝌𝟏 − 0,75𝝌𝟐−0.25𝝌

𝟏+ 0,75𝝌

𝟐

)

Page 43: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Decomposition of Vectors in Spectral Components

(𝝌𝟏𝝌𝟐) = (

𝟎. 𝟕𝟓𝝌𝟏 + 𝟎. 𝟕𝟓𝝌𝟐𝟎. 𝟐𝟓𝝌𝟏 + 𝟎. 𝟐𝟓𝝌𝟐

) + (0.25𝝌𝟏 − 0,75𝝌𝟐−0.25𝝌

𝟏+ 0,75𝝌

𝟐

)

(𝟎. 𝟕𝟓𝝌𝟏 + 𝟎. 𝟕𝟓𝝌𝟐𝟎. 𝟐𝟓𝝌𝟏 + 𝟎. 𝟐𝟓𝝌𝟐

) η 1η -φασματικη συνιστωσα (Spectral component) του διανυσματος (𝝌𝟏𝝌𝟐)

(0.25𝝌𝟏 − 0,75𝝌𝟐−0.25𝝌

𝟏+ 0,75𝝌

𝟐

) η 2η -φασματικη συνιστωσα (Spectral component) του διανυσματος (𝝌𝟏𝝌𝟐)

Page 44: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Mπορω να αναλυσω εναν Μ × Ν Πινακα Δεδομενων, όπως τον Πινακα:

Χ = (

𝜒11 ⋯ 𝜒1𝑁⋮ ⋱ ⋮𝜒𝑀1 ⋯ 𝜒𝑀𝑁

)

σε Συνιστωσες για περαιτερω επεξεργασια ?

Θεωρημα Αναλυσης Πινακων (Μ × Ν) σε Ιδιαζουσες Τιμες

Singular Value Decomposition (SVD) Theorem

Γενικευση Φασματικης Αναλυσης Τετραγωνικων Πινακων

Page 45: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Theorem (SVD)

Singular Value Decomposition of the Μ × Ν matrix X

𝜲 = 𝑼 𝜮 𝑽𝑻 = 𝐔 (

𝒔𝟏 𝟎 𝟎𝟎 ⋱ 𝟎𝟎 𝟎 𝒔𝒓

𝜪𝒓×(𝑵−𝒓)

𝜪(𝑴−𝒓)×𝒓 𝜪(𝑴−𝒓)×(𝑵−𝒓)

)

𝜧×𝜨

𝐕𝐓

Οπου:

𝑠1, 𝑠2, … , 𝑠𝑟 the singular values of the M x N Matrix X

𝑟 = 𝑟𝑎𝑛𝑘 (X𝑻𝑋) = 𝑟𝑎𝑛𝑘 (𝑋X𝑻)

𝒔𝝂 = √𝜻𝝂, 𝜈 = 1, 2, … , 𝑟

𝜻𝝂, 𝜈 = 1, 2, … , 𝑟 the (positive) eigenvalues of the 𝑀 ×𝑀 Matrix 𝑋X𝑻: (𝑿𝐗𝑻)𝒖𝝂 = 𝜻𝝂𝒖𝝂

Identical with the (positive) eigenvalues of the 𝑁 × 𝑁 Matrix X𝑻𝑋: (𝐗𝑻𝑿)𝒗𝝂 = 𝜻𝝂𝒗𝝂

Page 46: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

U is the 𝛭 ×𝛭 Orthogonal Modal Matrix of the 𝛭 ×𝛭 Symmetric Matrix 𝚾𝚾𝐓

The columns of U are the orthonormal Eigenvectors 𝒖𝜿 = (

𝒖𝟏𝜿𝒖𝟐𝜿⋮𝒖𝜧𝜿

) of 𝚾𝚾𝐓, 𝜅 = 1,2, … ,𝑀

𝜲𝜲𝑻 = 𝑼((𝒔𝟏)

𝟐 𝟎 𝟎

𝟎 (𝒔𝟐)𝟐 𝟎

𝟎 𝟎 ⋱

)

𝛭×𝛭

𝑼𝜯

(𝜲𝜲𝑻)𝒖𝜿 = (𝒔𝜿)𝟐⟦𝜅 ≤ 𝑟⟧𝒖𝜿 , r≤M, , 𝜅 = 1,2, … ,𝑀

V is the 𝑁 × 𝑁 Οrthogonal Modal Matrix of the 𝑁 × 𝑁 Symmetric Matrix 𝚾𝚻𝚾

The columns of V are the orthonormal Eigenvectors 𝒗𝝀 = (

𝒗𝟏𝝀𝒗𝟐𝝀⋮𝒗𝜨𝝀

) of 𝚾𝚻𝚾, 𝜆 = 1,2, … , 𝛮

𝜲𝜯𝜲 = 𝑽((𝒔𝟏)

𝟐 𝟎 𝟎

𝟎 (𝒔𝟐)𝟐 𝟎

𝟎 𝟎 ⋱

)

𝑁×𝑁

𝑽𝑻

(𝜲𝑻𝜲)𝒗𝝀 = (𝒔𝝂)𝟐⟦𝜈 ≤ 𝑟⟧𝒖𝝀 , 𝑟 ≤ 𝛮, 𝜆 = 1,2, … , 𝛮

Page 47: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Ορισμος

Iverson Bracket

⟦𝑄⟧ = {1, 𝛼𝜈 𝑄 𝛢𝜆𝜂𝜃𝜂𝜍0, 𝛼𝜈 𝑄 𝛹휀𝜐𝛿𝜂𝜍

}

converts Boolean values to 0,1

Iverson K. 1962, A Programming Language, New York: Wiley, p. 11

Graham R., Knuth D., Patashnik O. Concrete Mathematics, Section 2.2: Sums and Recurrences.

Knuth D. 1992, "Two Notes on Notation", American Mathematical Monthly, Volume 99, Number 5, May

1992, pp. 403–422. (TEX, arXiv:math/9205211)

Page 48: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

𝜲 = 𝑼(

𝒔𝟏 𝟎 𝟎𝟎 ⋱ 𝟎𝟎 𝟎 𝒔𝒓

𝛰𝑟×(𝑁−𝑟)

𝛰(𝑀−𝑟)×𝑟 𝛰(𝑀−𝑟)×(𝑁−𝑟)

)𝐕𝐓

𝜲 = (

𝑢11𝑢21

𝑢12𝑢22

⋯𝑢1𝑀𝑢2𝑀

⋮ ⋱ ⋮𝑢𝑀1 𝑢𝑀2 ⋯ 𝑢𝑀𝑀

)(

𝒔𝟏 𝟎 𝟎𝟎 ⋱ 𝟎𝟎 𝟎 𝒔𝒓

𝛰𝑟×(𝑁−𝑟)

𝛰(𝑀−𝑟)×𝑟 𝛰(𝑀−𝑟)×(𝑁−𝑟)

)(

𝑣11𝑣12

𝑣21𝑣22

⋯𝑣𝑁1𝑣𝑁2

⋮ ⋱ ⋮𝑣1𝑁 𝑣2𝑁 ⋯ 𝑣𝑁𝑁

)

𝛸 = ∑𝒔𝝂(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝜧𝝂

)(𝒗𝟏𝝂, 𝒗𝟐𝝂, … , 𝒗𝑵𝝂)

𝒓

𝝂=𝟏

𝜲 = 𝒔𝟏(

𝒖𝟏𝟏𝒗𝟏𝟏𝒖𝟐𝟏𝒗𝟏𝟏

𝒖𝟏𝟏𝒗𝟐𝟏𝒖𝟐𝟏𝒗𝟐𝟏

⋯𝒖𝟏𝟏𝒗𝑵𝟏𝒖𝟐𝟏𝒗𝑵𝟏

⋮ ⋱ ⋮𝒖𝑴𝟏𝒗𝟏𝟏 𝒖𝑴𝟏𝒗𝟐𝟏 ⋯ 𝒖𝑴𝟏𝒗𝑵𝟏

)+⋯+ 𝒔𝒓(

𝒖𝟏𝒓𝒗𝟏𝒓𝒖𝟐𝒓𝒗𝟏𝒓

𝒖𝟏𝒓𝒗𝟐𝒓𝒖𝟐𝒓𝒗𝟐𝒓

⋯𝒖𝟏𝒓𝒗𝑵𝒓𝒖𝟐𝜨𝒗𝑵𝒓

⋮ ⋱ ⋮𝒖𝜧𝒓𝒗𝟏𝒓 𝒖𝑴𝒓𝒗𝟐𝒓 ⋯ 𝒖𝑴𝒓𝒗𝑵𝒓

)

Page 49: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

SVD of the Action of A on (Measurement) Vectors

𝜲(

𝝌𝟏𝝌𝟐⋮𝝌𝑴

) =∑𝒔𝝂(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝜧𝝂

)(𝒗𝟏𝝂, 𝒗𝟐𝝂, … , 𝒗𝑵𝝂)(

𝝌𝟏𝝌𝟐⋮𝝌𝑴

) =∑𝒔𝝂(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝑵𝝂

)

𝒓

𝝂=𝟏

(∑𝒗𝜿𝝂𝝌𝜿

𝛮

𝜅=1

)

𝒓

𝝂=𝟏

Ιδιαζουσες Συνιστωσες Διανυσματων

Decomposition of Vectors in Spectral Components

SV Decomposition of the Action of Z

Page 50: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Decomposition of Vectors in Spectral Components

(

𝝌𝟏𝝌𝟐⋮𝝌𝑵

) =∑(∑ 𝒗𝜿𝝂𝝌𝜿

𝛮

𝜅=1

)(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝑵𝝂

)

𝒓

𝝂=𝟏

Το Διανυσμα (∑ 𝒗𝜿𝝂𝝌𝜿𝛮𝜅=1 )(

𝒖𝟏𝝂𝒖𝟐𝝂⋮𝒖𝑵𝝂

) καλειται

η ν-ιδιαζουσα συνιστωσα (Singular component) του διανυσματος (

𝝌𝟏𝝌𝟐⋮𝝌𝑵

)

Page 51: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

ΠΑΡΑΔΕΙΓΜΑ SVD

𝜲 = (𝟑 𝟏 𝟏−𝟏 𝟑 𝟏

), Πιναξ 2x3

𝜲𝑻 = (𝟑 −𝟏𝟏 𝟑𝟏 𝟏

) , Πιναξ 3x2

Page 52: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

𝛸𝜲𝑻 = (𝟑 𝟏 𝟏−𝟏 𝟑 𝟏

)(𝟑 −𝟏𝟏 𝟑𝟏 𝟏

) = (𝟏𝟏 𝟏𝟏 𝟏𝟏

) , Πιναξ 2x2

Eigenvalue problem of the Symmetric Real Matrix 𝜲𝜲𝑻 = (𝟏𝟏 𝟏𝟏 𝟏𝟏

):

Eigenvalues Singular Values Eigenvectors Orthonormal Eigenvectors

𝜻𝟏 = 𝟏𝟐 𝒔𝟏 = √𝟏𝟐 (𝟏𝟏)

(

𝟏

√𝟐𝟏

√𝟐)

𝜻𝟐 = 𝟏𝟎 𝒔𝟏 = √𝟏𝟎 (𝟏−𝟏)

(

𝟏

√𝟐

−𝟏

√𝟐)

𝑼 = (

𝟏

√𝟐

𝟏

√𝟐𝟏

√𝟐−

𝟏

√𝟐

) 2x2

Page 53: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

𝜲𝑻𝜲 = (𝟑 −𝟏𝟏 𝟑𝟏 𝟏

) (𝟑 𝟏 𝟏−𝟏 𝟑 𝟏

) = (𝟏𝟎 𝟎 𝟐𝟎 𝟏𝟎 𝟒𝟐 𝟒 𝟐

) Πιναξ 3x3

Eigenvalue problem of the Symmetric Real Matrix 𝜲𝑻𝜲:

Eigenvalues Singular Values Eigenvectors Orthonormal Eigenvectors

𝜻𝟏 = 𝟏𝟐 𝒔𝟏 = √𝟏𝟐 (𝟏𝟐𝟏)

(

𝟏

√𝟔𝟐

√𝟔𝟏

√𝟔)

𝜻𝟐 = 𝟏𝟎 𝒔𝟐 = √𝟏𝟎 (𝟐−𝟏𝟎)

(

𝟐

√𝟓𝟏

√𝟓𝟎 )

𝜻𝟑 = 𝟎 𝒔𝟑 = 𝟎 (𝟏𝟐−𝟓)

(

𝟏

√𝟑𝟎𝟐

√𝟑𝟎

−𝟓

√𝟑𝟎)

Page 54: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

𝑽 =

(

𝟏

√𝟔

𝟐

√𝟓

𝟏

√𝟑𝟎𝟐

√𝟔

−𝟏

√𝟓

𝟐

√𝟑𝟎𝟏

√𝟔𝟎

−𝟓

√𝟑𝟎)

𝑽𝑻 =

(

𝟏

√𝟔

𝟐

√𝟔

𝟏

√𝟔𝟐

√𝟓

−𝟏

√𝟓𝟎

𝟏

√𝟑𝟎

𝟐

√𝟑𝟎

−𝟓

√𝟑𝟎)

3x3

Page 55: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

𝜮 = (√𝟏𝟐 𝟎 𝟎

𝟎 √𝟏𝟎 𝟎) 2x3

𝑿 = 𝑼𝜮𝑽𝑻

(𝟑 𝟏 𝟏−𝟏 𝟑 𝟏

) =

(

𝟏

√𝟐

𝟏

√𝟐𝟏

√𝟐−𝟏

√𝟐)

(√𝟏𝟐 𝟎 𝟎

𝟎 √𝟏𝟎 𝟎)

(

𝟏

√𝟔

𝟐

√𝟔

𝟏

√𝟔𝟐

√𝟓

−𝟏

√𝟓𝟎

𝟏

√𝟑𝟎

𝟐

√𝟑𝟎

−𝟓

√𝟑𝟎)

Page 56: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Εφαρμογες SVD

data reduction

data association

exploratory data analysis

constructing predictive models.

Data compression, data reconstruction

Quantum Computing. Entanglement

Page 57: Φασματικη Αναλυσηcosal.auth.gr/iantonio/sites/default/files/Lessons2015/A3...Φασματικη Αναλυση Συνδιασπορας Principal Components Analysis

Aναφορες Ιστορικες Galton F.1889, Natural Inheritance. MacMillan and Co, London

Pearson, K. 1901, "On Lines and Planes of Closest Fit to Systems of Points in Space,

Philosophical Magazine 2 (11): 559–572. doi:10.1080/14786440109462720.

Hotelling, H. 1933, Analysis of a complex of statistical variables into principal components,

Journal of Educational Psychology, 24, 417-441, and 498-520.

Hotelling, H. 1936, Relations between two sets of variates. Biometrika, 27, 321-77

Aναφορες Συγχρονες Qin S.J., Dunia R. 2000, “Determining the number of principal components for best reconstruction”,

Journal of Process Control, vol. 10, pp 245–250.

Alter O., Brown P., Botstein D. 2000, Singular Value Decomposition for genome-wide expression,

data processing and modeling, PNAS vol. 97 no. 18, 10101–10106

Jolliffe I.T. 2002, "Principal Component Analysis", Second Edition, Springer.

Jackson, J. E. 2003, “A User's Guide to Principal Components”, A Wiley-Interscience, New York

Tapani Raiko, Alexander Ilin and Juha Karhunen 2008,

Principal Component Analysis for Sparse High-Dimensional Data,

Neural Information Processing Lecture Notes in Computer Science, Vol. 4984/2008, 566-575.

Miszczak J. 2011, Singular Value Decomposition and Matrix Reorderings in Quantum Information Theory,

International Journal of Modern Physics C, Vol. 22, No. 9, 897-918

Shlens J. 2014, A Tutorial on Principal Component Analysis, http://www.cs.cmu.edu/~elaw/papers/pca.pdf