ΣΤΑΤΙΣΤΙΚΗ ΓΝΩΣΗΣ Φαζμαηικη Αναλςζη Σςνδιαζποπαρ Principal Components Analysis Singular Value Decomposition Iωαννηρ Ανηωνιος Φαπαλαμπορ Μππαηζαρ Mathematics Department Aristotle University 54124,Thessaloniki,Greece iantonio@math.auth.gr cbratsas@math.auth.gr
Σσνδιαζπορα (Covariance) cov(x,y) = ς [( )( )] [ ] [ ] [ ] [ ] ς ( )( ) Διακριηες Μεηαβληηες ς ( )( ) ( ) Σσνετεις Μεηαβληηες ς cov[x,x] = var[x] = Ε[(Φ Ε[Φ]) 2 ] = E[X 2 ] E[X] 2 = cor[x,x] E[X] 2 =
Λημμα 1) cov(x,y) [ ] [ ] [ ] [ ] 2) Covariance is not a SP οf the variables X,Y. Covariance is a SP of the centered Variables ( ) ( ) (1) Covariance is a bilinear Form: α,β real numbers cov[ α 1 X 1 + α 2 X 2, Υ] = α 1 cov[x 1, Υ] + α 1 cov[x 2, Υ] cov[ X, β 1 Υ 1 + β 2 Υ 2 ] = β 1 cov[x, Υ 1 ] + β 2 cov[x, Υ 2 ] cov[α 1 X 1 + α 2 X 2, β 1 Υ 1 + β 2 Υ 2 ] = = α 1 β 1 cov[x 1, Υ 1 ] + α 1 β 2 cov[x 1, Υ 2 ] + α 2 β 1 cov[x 2, Υ 1 ] + α 2 β 2 cov[x 2, Υ 2 ] (2) cov(a,b) = cov(b,a) (3) cov[x,x] = var[x] = Ε[(Φ Ε[Φ]) 2 ] = E[X 2 ] E[X] 2 = ζ 2 0 (4) cov[x,x] = 0 ζ 2 = 0 X is a constant random variable, ae 3) ( ) ( ), Αλλαγη ζε Τσποποιημενες Μεηαβληηες
Theorem For random variables with finite variance: 1) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) = Pearson s Coefficient 2) ( ) ( ) ( ) ( ) ( ) ( ) ( )
Proof: From Cauchy Schwarz inequality: [ ] ( ) ( ) ( ) Η Σςνδιαζποπα ωρ Εκηιμηζη ηηρ Γπαμμικηρ Αλληλεξαπηηζηρ ηων Φ, Υ
Pearson's coefficient (Σςνηελεζηηρ Σςνδιαζποπαρ Pearson) ( ) ( ) ( ) ( ) ς ( * m X = E(X), m Y = E(Y), = E[(X m X ) 2 ] = [ ], σ Y 2 = E[(X m Y ) 2 ] = [ ] ( ) ( ) ( )
Δειγμα Μ Μεηπηζεων ηων Μεηαβληηων Φ,Υ Observation 1 Observation 2 Variable Variable Observation M Σςνδιαζποπα (Covariance) Δείγμαηορ ( )( ) Αμεποληπηη Σςνδιαζποπα Δείγμαηορ: Διοπθωζη Bessel Τςποποιημενη (Αμεποληπηη) Σςνδιαζποπα (Pearson) Δείγμαηορ: ( ),
Σςνδιαζποπα Ν Μεηαβληηων ( ) [( ) ( )] ( ) [ ] [ ] η Μεςη Σιμη τησ Ο Πινακαρ Σςνδιαζποπαρ ηων Ν Μεηαβληηων ( + Μη Αρνητικοσ υμμετρικοσ Πινακασ αρα Διαγωνιοποιηςιμοσ
Δειγμα Μ Μεηπηζεων ηων N Μεηαβληηων Observation 1 Observation 2 Variable Variable Variable Observation M
Πιναξ Μεηπηζεων (Data Matrix): ( + ( ) ( ) Διανςζμα Μ Μεηπηζεων (Attribute Vector) ηηρ Μεηαβληηηρ, ν=1,2,,ν: ( + Διανςζμα ηηρ Μεηπηζηρ μ ηων Ν Μεηαβληηων, ν=1,2,,ν: ( + ( )
Σςνδιαζποπα Δειγμαηορ ( )( ), οποσ η ηιμη ηης κ-μεηρηζης ηης Μεηαβληηης η Δειγμαηικη Μεζη Τιμη ηης Μεηαβληηης Αμεποληπηη Σςνδιαζποπα Δειγμαηορ Διοπθωζη Bessel Τςποποιημενη Σςνδιαζποπα (Pearson) Δείγμαηορ:, ενζωμαηωνει ηην Διοπθωζη Bessel η ηιμη ηης Τσποποιημενης μεηαβληηης
Λημμα: ( + Χ ( + Χ Χ ( + Ζ Ζ Data Matrices Χ ( +,, ( +,
ΠΑΡΑΔΕΙΓΜΑ: Ο Πιναξ υνδιαςπορασ Ν Ανεξαρτητων ανα 2 Μεταβλητων είναι Διαγωνιοσ : υμβαςη Αναδιαταςςουμε τισ Ν Μεταβλητεσ ώςτε οι αντιςτοιχεσ Διαςπορεσ Να διαταςςονται κατϊ φθινουςα ςειρα: > > ς ς (Ορθεσ μοναδεσ μετρηςησ) ( ς ) Για 2 Ανεξαρτητεσ Μεταβλητεσ Φ Τ: ( ) ( ) ( )
Μπορω να Μεταςχηματιςω τισ Μεταβλητεσ ςε Ν Ανεξαρτητεσ μεταβλητεσ με τισ ιδιεσ Διαςπορεσ? Bεβαιωσ! Μεςω τησ Διαγωνιοποιηςησ του Πινακα υνδιαςπορασ ς (Μη Αρνητικοσ υμμετρικοσ αρα Διαγωνιοποιηςιμοσ). ς ς ( Ζ) ( ς ) (, ( )
U is the N N matrix with columns the eigenvectors, ν=1,2,,ν of A the ν-column is the eigenvector (, of A: ( Ζ) Τ Τ ( + o Πιναξ δεδομενων ηων Μεηαβληηων Τ Τ Τ που οριζονται από τον Γραμμικο Μεταςχηματιςμο (, (, (, (,
Οριςμοσ Κυριεσ υνιςτωςεσ (Principal Components) του Πινακα υνδιαςπορασ Οι Υαςματικεσ υνιςτωςεσ που οριζονται απο τα ιδιοανυςματα Σου N x N Πινακα υνδιακυμανςησ Για κϊθε Διανςζμα Μεηπηζηρ ηων Ν Μεηαβληηων: ( + Οριζω Κυριεσ υνιςτωςεσ (Principal Components) του Οι Υαςματικεσ υνιςτωςεσ του χ ωσ προσ τα ιδιοανυςματα Σου N x N Πινακα υνδιακυμανςησ
Αναπτυγμα ςε Κυριεσ υνιςτωςεσ του Σο Υαςματικο Αναπτυγμα του του χ ωσ τουσ αξονεσ των ιδιανυςματων του N x N Πινακα υνδιακυμανςησ
Κυριεσ υνιςτωςεσ ημαςια 1) Σα ιδιοανυςματα προκυπτουν απο (Ν-διαςτατη) ςτροφη 2) Οι Πρωτεσ Κυριεσ υνιςτωςεσ φερουν την μεγαλυτερη και ςημαντικοτερη Πληροφορια 3) Οι Μεταβλητεσ Τ Τ Τ οριζουν τισ ςυντεταγμενεσ των Μετρηςεων ςτισ Κυριεσ υνιςτωςεσ
Παραδειγμα Πιναξ υνδιαςπορασ 2 Μεταβλητων (2 dim Covariance Matrix) ( ) ( ) ( [ ] ) [ ] ( [ ] [ ] [ ] [ ] ( ) * ( ) ( ) ( )
Προβλημα Ιδιοτιμων του Πινακα υνδιαςπορασ : Eigenvalues Eigenvectors ς ( ) 2 4 ( ς ς ) ς ( ) 2 4 ( ς ς ) ( ς ς ) ( )
Σα ορθογωνια ιδιοανυςματα και οριζουν τισ Κατευθυνςεισ μεγιςτησ και ελαχιςτησ ςυνδιαςπορασ Oι προβολεσ ενόσ διανυςματοσ μετρηςησ ( ) ςτισ κατευθυνςεισ των ιδιοανυςματων και ειναι Οι Κυριεσ υνιςτωςεσ (Principal Components) του
Λημμα Φαζμαηικη Αναλςζη Διαγωνιζιμων Πινακων α α (, (, ( ) υμβαςη: Οι ιδιοτιμεσ διαταςςονται κατϊ φθινουςα ςειρα: α α α ( ) (, = Ο Modal Matrix ηος Α U is the N N matrix with columns the eigenvectors, ν=1,2,,ν of A the ν-column is the eigenvector (, of A:
( ) η ν-οζηη γπαμμη ηος Ανηιζηποθος Πινακα (, Spectral Decomposition of the Action of A Α(, (, ( ) (, (, ( )
Decomposition of Vectors in Spectral Components (, ( + (, ( + ( ) η ν-φαςματικη ςυνιςτωςα (Spectral component) του διανυςματοσ (,
Normal Matrices: The Eigenvector basis is Orthogonal Unitary (Normal) Matrices: Eigenvalues on the complex unit circle ( α α, Hermitian (Normal) Matrices: Eigenvalues Real U is Unitary Matrix Real Symmetric (Normal) Matrices: Eigenvalues Real ( α α, Q is Orthogonal Matrix
Diagonalization of ( + Eigenvalues Eigenvectors ( + ( + ( +
Μηκη : u1 = ( ) ( ) ( ) u2 = ( ) u3 = ( ) ( ) are not Orthogonal: ( + ( + ( + ( + ( + ( +
Diagonalizing Matrix: ( ) ( + ( + Diagonalization ( + ( + ( + ( +
Spectral Decomposition οf Α (3 2 + ( 2 2 + (3 2 + ( 2 + 3 ( + ( ) 2 ( + (2 ) ( + ( ) Spectral Decomposition of the Action of A Α( + 3 ( + ( ) ( + 2 ( + (2 ) ( + ( + ( ) ( + Α( + 3( ) ( + 2(2 ) ( + ( ) ( + Α( + 3 ( + 2 ( 2 + ( 2 +
Decomposition of Vectors in Spectral Components ( + ( + ( 2 + ( 2 + ( + η 1 η -φαςματικη ςυνιςτωςα (Spectral component) του διανυςματοσ ( + ( 2 + η 2 η -φαςματικη ςυνιςτωςα (Spectral component) του διανυςματοσ ( + ( 2 + η 3 η -φαςματικη ςυνιςτωςα (Spectral component) του διανυςματοσ ( +
Markov Matrix A=( 3 7 ) Προβλημα Ιδιοτιμων, Aψ=αψ: Ιδιοτιμη Ιδιοδιανυςμα α1 = 1 u1= ( ) ( α2 = 0.6 u2= ( ) ( 3 7 ) ( ) ( ) 3 7 ) ( ) ( )
Σα διανυςματα u1, u2 δεν είναι μοναδιαια u1 = ( ) ( ) 7 u2 = 2 Σα διανυςματα u1, u2 δεν είναι ορθογωνια < u1, u2 > = 0
Diagonalizing Matrix U = ( ) ( 75 ) U -1 = ( 25 75 ), A Non-Symmetric Non-Normal ςτον H R 2 Diagonalization ( 25 75 ) ( 3 7 ) ( 75 ) ( 6 )
Spectral Decomposition οf Α ( 6 ) ( 75 * ( 6 ) ( 25 75 ) ( ) ( ) ( ) ( 25 75) Spectral Decomposition of the Action of A Α( ) ( * ( ) ( ) ( ) ( 25 75) ( ) Α( ) ( * ( ) ( ) ( 25 75 ) Α( ) ( * ( 25 75 25 75 *
Decomposition of Vectors in Spectral Components ( ) ( * ( 25 75 25 75 * ( * η η -φαςματικη ςυνιςτωςα (Spectral component) του διανυςματοσ ( ) ( 25 75 25 75 * η 2η -φαςματικη ςυνιςτωςα (Spectral component) του διανυςματοσ ( )
Mποπω να αναλςζω ηον Μ Ν Πινακα Δεδομενων ( + ζε Σςνιζηωζερ για πεπαιηεπω επεξεπγαζια? Θεωπημα ηηρ Αναλςζηρ ζε Ιδιαζοςζερ Τιμερ Πινακων Μ Ν Singular Value Decomposition (SVD) Theorem Αναλςζη Δεδομενων ζε Κςπιερ Σςνιζηωζερ Principal Components Analysis
SVD Theorem Z = U Σ V T = ( ( ) ( ) ( ) ( ), the singular values of the M x N data Matrix Z = The square roots of the (positive) eigenvalues of the NxN Matrix ς r is the rank of ζ
U is the Μ x Μ Orthogonal Modal Matrix of the Μ x Μ Symmetric Matrix (The columns of U are the orthonormal Eigenvectors (, of ) (( ) ( ) ) V is the NxN Οrthogonal Modal Matrix of the N x N Symmetric Matrix (The columns of V are the orthonormal Eigenvectors (, of ) (( ) ( ) )
Ζ = U ( ( ) ( ) ( ) ( ), V T (, ( ( ) ( ) ( ) ( ), (, (, ( ) (, (,
SV Decomposition of the Action of Z on each Measurement Vector Z(, (, ( ) (, (, ( ) Decomposition of Vectors in Spectral Components (, ( ) (, ( ) (, η ν-ιδιαζουςα ςυνιςτωςα (Singular component) του διανυςματοσ (,
ΠΑΡΑΔΕΙΓΜΑ ( ), 2x3 ( + 3x2
( ) ( + ( ) 2x2 Eigenvalue problem of the Symmetric Real Matrix : Eigenvalues Eigenvectors Orthonormal Eigenvectors ( ) ( ) ( ) ( )
( ) 2x2 ( + ( ) ( + 3x3 Eigenvalue problem of the Symmetric Real Matrix :
Eigenvalues Singular Values Eigenvectors ( + ( + Orthonormal Eigenvectors ( ) ( ) ( + ( )
3x3 ( ) 3x3 ( )
( * 2x3 (M<M) ( ) ( ( ) * ( )
Εθαπμογερ data reduction data association exploratory data analysis constructing predictive models. Data compression, data reconstruction
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. 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. Shlens J. 2014, A Tutorial on Principal Component Analysis, http://www.cs.cmu.edu/~elaw/papers/pca.pdf