probability and statistics
play

Probability and Statistics for Computer Science cov ( X, - PowerPoint PPT Presentation

Probability and Statistics for Computer Science cov ( X, Y ) = E [( X E [ X ])( Y E [ Y ])] Covariance is coming back in matrix! Credit: wikipedia Hongye Liu,


  1. Probability ¡and ¡Statistics ¡ ì ¡ for ¡Computer ¡Science ¡ ¡ cov ( X, Y ) = E [( X − E [ X ])( Y − E [ Y ])] Covariance ¡is ¡coming ¡back ¡in ¡ matrix! ¡ Credit: ¡wikipedia ¡ Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡10.29.2019 ¡

  2. Last ¡time ¡ ✺ Review ¡of ¡Bayesian ¡inference ¡ ✺ Refresh ¡of ¡some ¡linear ¡algebra ¡ ✺ Visualizing ¡high ¡dimensional ¡data ¡ ✺ Summarizing ¡data ¡and ¡the ¡ covariance ¡matrix ¡ ¡

  3. Content ¡ ✺ Review ¡of ¡Covariance ¡matrix ¡ ✺ Dimension ¡ReducQon ¡ ✺ Principal ¡Component ¡Analysis ¡ ✺ Examples ¡of ¡PCA ¡

  4. Diagonalization ¡of ¡a ¡symmetric ¡matrix ¡ ✺ If ¡A ¡is ¡an ¡ n × n ¡symmetric ¡square ¡matrix, ¡the ¡eigenvalues ¡ are ¡real. ¡ ✺ If ¡the ¡eigenvalues ¡are ¡also ¡disQnct, ¡their ¡eigenvectors ¡ are ¡orthogonal ¡ ✺ We ¡can ¡then ¡scale ¡the ¡eigenvectors ¡to ¡unit ¡length, ¡and ¡ place ¡them ¡into ¡an ¡orthogonal ¡matrix ¡ U ¡ = ¡[ u 1 ¡ u 2 ¡…. ¡ u n ] ¡ ✺ We ¡can ¡write ¡the ¡diagonal ¡matrix ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡such ¡ Λ = U T AU that ¡the ¡diagonal ¡entries ¡of ¡Λ ¡are ¡λ 1 , ¡λ 2 … ¡λ n ¡in ¡that ¡order. ¡ ¡

  5. Q. ¡Is ¡this ¡true? ¡ Transforming ¡a ¡matrix ¡with ¡ orthonormal ¡matrix ¡only ¡rotates ¡the ¡ data ¡ A. ¡Yes ¡ B. ¡No ¡

  6. Q. ¡Is ¡this ¡true? ¡ Transforming ¡a ¡matrix ¡with ¡ orthonormal ¡matrix ¡only ¡rotates ¡the ¡ data ¡ A. ¡Yes ¡ B. ¡No ¡

  7. Covariance ¡ ✺ The ¡covariance ¡of ¡random ¡ variables ¡ X ¡and ¡ Y ¡is ¡ cov ( X, Y ) = E [( X − E [ X ])( Y − E [ Y ])] ✺ Note ¡that ¡ cov ( X, X ) = E [( X − E [ X ]) 2 ] = var [ X ]

  8. Correlation ¡coefficient ¡is ¡ normalized ¡ ¡covariance ¡ ✺ The ¡correlaQon ¡coefficient ¡is ¡ corr ( X, Y ) = cov ( X, Y ) ¡ σ X σ Y ✺ When ¡ X, Y ¡takes ¡on ¡values ¡with ¡equal ¡ probability ¡to ¡generate ¡data ¡sets ¡ {( x,y )}, ¡the ¡correlaQon ¡coefficient ¡will ¡ be ¡as ¡seen ¡in ¡Chapter ¡2. ¡

  9. Covariance ¡seen ¡from ¡scatter ¡plots ¡ Zero ¡ ¡ PosiQve ¡ ¡ NegaQve ¡ ¡ Covariance ¡ Covariance ¡ Covariance ¡ ¡ ¡ Credit: ¡ Prof.Forsyth ¡

  10. Covariance ¡for ¡a ¡pair ¡of ¡components ¡in ¡a ¡ data ¡set ¡ ✺ For ¡the ¡jth ¡and ¡kth ¡components ¡of ¡a ¡data ¡set ¡ {x} ¡ i ( x ( j ) − mean ( { x ( j ) } ))( x ( k ) − mean ( { x ( k ) } )) T � cov ( { x } ; j, k ) = i i ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ N

  11. Covariance ¡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 * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ covariance ¡between ¡ 6 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ different ¡components ¡ 7 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡

  14. Properties ¡of ¡Covariance ¡matrix ¡ { x } Covmat( ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡) ¡ 7×7 ¡ cov ( { x } ; j, k ) = cov ( { x } ; k, j ) 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ ✺ The ¡covariance ¡ 1 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ matrix ¡is ¡ symmetric ! ¡ 2 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ ✺ And ¡it’s ¡ posi7ve ¡ 3 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ semi-­‑definite , ¡that ¡is ¡ 4 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ all ¡λ i ¡≥ ¡0 ¡ 5 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ 6 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ ✺ The ¡matrix ¡is ¡ 7 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ diagonalizable ¡

  15. Properties ¡of ¡Covariance ¡matrix ¡ { x } Covmat( ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡) ¡ ✺ If ¡we ¡define ¡ x c ¡as ¡the ¡ 7×7 ¡ mean ¡centered ¡ 1 ¡ 2 ¡ 3 ¡ 4 ¡ 5 ¡ 6 ¡ 7 ¡ matrix ¡for ¡dataset ¡{x} ¡ 1 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ 2 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ Covmat ( { x } ) = x T c x c 3 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ N 4 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ 5 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ ✺ The ¡covariance ¡ 6 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ matrix ¡is ¡a ¡d×d ¡matrix ¡ 7 ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡ * ¡

  16. Example: ¡covariance ¡matrix ¡of ¡a ¡data ¡set ¡ (I) ¡ Mean ¡centered ¡ X (1) ¡ X (2) ¡     5 − 1 2 − 1 4 1 1 1         A 0 = 3 0 A 1 = 0 0         2 1 − 1 1     1 − 1 − 2 − 1

  17. Example: ¡covariance ¡matrix ¡of ¡a ¡data ¡set ¡ A 2 = A T (I) ¡ Mean ¡centered ¡ (II) ¡ 1 A 1 X (1) ¡ X (2) ¡     5 − 1 2 − 1 Inner ¡product ¡of ¡each ¡pairs: ¡ 4 1 1 1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡[1,1] ¡= ¡10 ¡ A 2         A 0 = 3 0 A 1 = 0 0 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡[2,2] ¡= ¡4 ¡ A 2         2 1 − 1 1 ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡[1,2] ¡= ¡0 ¡     A 2 1 − 1 − 2 − 1 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend