descriptive statistics
play

Descriptive Statistics DS GA 1002 Probability and Statistics for - PowerPoint PPT Presentation

Descriptive Statistics DS GA 1002 Probability and Statistics for Data Science http://www.cims.nyu.edu/~cfgranda/pages/DSGA1002_fall17 Carlos Fernandez-Granda Descriptive statistics Techniques to visualize and summarize data Can often be


  1. Descriptive Statistics DS GA 1002 Probability and Statistics for Data Science http://www.cims.nyu.edu/~cfgranda/pages/DSGA1002_fall17 Carlos Fernandez-Granda

  2. Descriptive statistics Techniques to visualize and summarize data Can often be interpreted within a probabilistic framework Often probabilistic assumptions do not hold, but techniques are still useful We describe them from a deterministic point of view

  3. Histogram Empirical mean and variance Order statistics Empirical covariance Empirical covariance matrix

  4. Histogram Technique to visualize one-dimensional data Bin range of the data, then count the number of instances in each bin The width of the bins can be adjusted to yield higher or lower resolution Approximation to their pmf or pdf if data are iid

  5. Temperature in Oxford 45 January 40 August 35 30 25 20 15 10 5 0 0 5 10 15 20 25 30 Degrees (Celsius)

  6. GDP per capita of different countries 90 80 70 60 50 40 30 20 10 0 0 50 100 150 200 Thousands of dollars

  7. Histogram Empirical mean and variance Order statistics Empirical covariance Empirical covariance matrix

  8. Empirical mean Let { x 1 , x 2 , . . . , x n } be a set of real-valued data The empirical mean is defined as n av ( x 1 , x 2 , . . . , x n ) := 1 � x i n i = 1 Temperature data: 6.73 ◦ C in January and 21.3 ◦ C in August GDP per capita: $16 500

  9. Empirical mean Let { � x 1 , � x 2 , . . . , � x n } be a set of d -dimensional real-valued data The empirical mean is defined as n x n ) := 1 � av ( � x 1 , � x 2 , . . . , � � x i n i = 1

  10. Centering Let { � x 1 , � x 2 , . . . , � x n } be a set of d -dimensional real-valued data To center the data set we: 1. Compute the empirical mean 2. Subtract it from each vector y i := � x i − av ( � x n ) , 1 ≤ i ≤ n � x 1 , � x 2 , . . . , � � y 1 , . . . , � y n are centered at the origin

  11. Centering Uncentered data Centered data

  12. Empirical variance Let { x 1 , x 2 , . . . , x n } be a set of real-valued data The empirical variance is defined as n 1 � ( x i − av ( x 1 , x 2 , . . . , x n )) 2 var ( x 1 , x 2 , . . . , x n ) := n − 1 i = 1 The empirical standard deviation is the square root of the empirical variance Temperature data: 1.99 ◦ C in January and 1.73 ◦ C in August GDP per capita: $25 300

  13. Histogram Empirical mean and variance Order statistics Empirical covariance Empirical covariance matrix

  14. Temperature dataset In January the temperature in Oxford is around 6.73 ◦ C give or take 2 ◦ C

  15. GDP dataset Countries typically have a GDP per capita of about $16 500 give or take $25 300

  16. Quantiles and percentiles Let x ( 1 ) ≤ x ( 2 ) ≤ . . . ≤ x ( n ) denote the ordered elements of a dataset { x 1 , x 2 , . . . , x n } The q quantile of the data for 0 < q < 1 is x ([ q ( n + 1 )]) [ q ( n + 1 )] is the closest integer to q ( n + 1 ) The 100 p quantile is known as the p percentile

  17. Quartiles and median The 0 . 25 and 0 . 75 quantiles are the first and third quartiles The 0 . 5 quantile is the empirical median If n is even, the empirical median is usually set to x ( n / 2 ) + x ( n / 2 + 1 ) 2 The difference between the 3rd and 1st quartiles is the interquartile range (IQR)

  18. Quartiles and median ◮ Temperature data (January): ◮ Sample mean: 6.73 ◦ C ◮ Median: 6.80 ◦ C ◮ Interquartile range: 2.9 ◦ C ◮ Temperature data (August): ◮ Sample mean: 21.3 ◦ C ◮ Median: 21.2 ◦ C ◮ Interquartile range: 2.1 ◦ C

  19. Quartiles and median ◮ GDP per capita: ◮ Sample mean: $16 500 (71% of the countries have lower GDP per capita!) ◮ Median: $6 350 ◮ Interquartile range: $18 200 ◮ Five-number summary: $130, $1 960, $6 350, $20 100, $188 000

  20. Boxplot of temperature data 30 25 20 Degrees (Celsius) 15 10 5 0 5 January April August November

  21. Boxplot of GDP data 60 50 Thousands of dollars 40 30 20 10 0

  22. Histogram Empirical mean and variance Order statistics Empirical covariance Empirical covariance matrix

  23. Multidimensional data Each dimension represents a feature We can visualize two-dimensional data using scatter plots

  24. Scatter plot 20 18 16 April 14 12 10 8 16 18 20 22 24 26 28 August

  25. Scatter plot 20 Minimum temperature 15 10 5 0 5 10 5 0 5 10 15 20 25 30 Maximum temperature

  26. Empirical covariance Data: { ( x 1 , y 1 ) , ( x 2 , y 2 ) , . . . , ( x n , y n ) } The empirical covariance is defined as n 1 � cov (( x 1 , y 1 ) , . . . , ( x n , y n )) := ( x i − av ( x 1 , . . . , x n )) ( y i − av ( y 1 , . . . , y n )) n − 1 i = 1

  27. Empirical correlation coefficient Data: { ( x 1 , y 1 ) , ( x 2 , y 2 ) , . . . , ( x n , y n ) } The empirical correlation coefficient is defined as cov (( x 1 , y 1 ) , . . . , ( x n , y n )) ρ (( x 1 , y 1 ) , . . . , ( x n , y n )) := std ( x 1 , . . . , x n ) std ( y 1 , . . . , y n ) a , � Cauchy-Schwarz inequality: for any � b a T � � b − 1 ≤ ≤ 1 || a || 2 || b || 2 Consequence: − 1 ≤ ρ (( x 1 , y 1 ) , . . . , ( x n , y n )) ≤ 1

  28. ρ = 0 . 269 20 18 16 April 14 12 10 8 16 18 20 22 24 26 28 August

  29. ρ = 0 . 962 20 Minimum temperature 15 10 5 0 5 10 5 0 5 10 15 20 25 30 Maximum temperature

  30. Histogram Empirical mean and variance Order statistics Empirical covariance Empirical covariance matrix

  31. Empirical covariance matrix Data: { � x 1 , � x 2 , . . . , � x n } ( d features) The empirical covariance matrix is defined as n 1 � x n )) T Σ ( � x 1 , . . . , � x n ) := ( � x i − av ( � x 1 , . . . , � x n )) ( � x i − av ( � x 1 , . . . , � n − 1 i = 1 The ( i , j ) entry, 1 ≤ i , j ≤ d , is given by � var (( � x 1 ) i , . . . , ( � x n ) i ) if i = j , Σ ( � x n ) ij = x 1 , . . . , � �� � � �� cov ( � x 1 ) i , ( � x 1 ) j , . . . , ( � x n ) i , ( � x n ) j if i � = j .

  32. Empirical variance in a certain direction Let � v be a unit-norm vector aligned with a direction of interest � � v T � v T � var � x 1 , . . . , � x n

  33. Empirical variance in a certain direction Let � v be a unit-norm vector aligned with a direction of interest � � v T � v T � var � x 1 , . . . , � x n n 1 �� 2 � � � v T � v T � v T � = � x i − av � x 1 , . . . , � x n n − 1 i = 1

  34. Empirical variance in a certain direction Let � v be a unit-norm vector aligned with a direction of interest � � v T � v T � var � x 1 , . . . , � x n n 1 �� 2 � � � v T � v T � v T � = � x i − av � x 1 , . . . , � x n n − 1 i = 1 n 1 � 2 � v T ( � � = � x i − av ( � x 1 , . . . , � x n )) n − 1 i = 1

  35. Empirical variance in a certain direction Let � v be a unit-norm vector aligned with a direction of interest � � v T � v T � var � x 1 , . . . , � x n n 1 �� 2 � � � v T � v T � v T � = � x i − av � x 1 , . . . , � x n n − 1 i = 1 n 1 � 2 � v T ( � � = � x i − av ( � x 1 , . . . , � x n )) n − 1 i = 1 � n � 1 � x n )) T v T = � ( � x i − av ( � x 1 , . . . , � x n )) ( � x i − av ( � x 1 , . . . , � � v n − 1 i = 1

  36. Empirical variance in a certain direction Let � v be a unit-norm vector aligned with a direction of interest � � v T � v T � var � x 1 , . . . , � x n n 1 �� 2 � � � v T � v T � v T � = � x i − av � x 1 , . . . , � x n n − 1 i = 1 n 1 � 2 � v T ( � � = � x i − av ( � x 1 , . . . , � x n )) n − 1 i = 1 � n � 1 � x n )) T v T = � ( � x i − av ( � x 1 , . . . , � x n )) ( � x i − av ( � x 1 , . . . , � � v n − 1 i = 1 v T Σ ( � = � x 1 , . . . , � x n ) � v

  37. Eigendecomposition of the covariance matrix Let � v be a unit-norm vector aligned with a direction of interest x n ) = U Λ U T Σ ( � x 1 , . . . , �  0 · · · 0  λ 1 0 λ 2 · · · 0 � T � � �   � � = · · · · · · u 1 u 2 � � u n u 1 u 2 � u n �   · · ·   0 0 · · · λ n

  38. Eigendecomposition of the covariance matrix For any symmetric matrix A ∈ R n with normalized eigenvectors � u 1 , � u 2 , . . . , � u n and corresponding eigenvalues λ 1 ≥ λ 2 ≥ . . . ≥ λ n v T A � λ 1 = max v || 2 = 1 � v || � v T A � u 1 = arg max � v || 2 = 1 � v || � v T A � λ k = max � v || � v || 2 = 1 ,� u ⊥ � u 1 ,...,� u k − 1 v T A � u k = arg max � � v || � v || 2 = 1 ,� u ⊥ � u 1 ,...,� u k − 1

  39. Principal component analysis Compute eigenvectors of empirical covariance matrix to determine directions of maximum variation

  40. Example: 2D data σ 1 σ 2 √ n = 0 . 705 √ n = 0 . 690 u 1 u 2

  41. Example: 2D data σ 1 σ 2 √ n = 0 . 9832 √ n = 0 . 3559 u 1 u 2

  42. Example: 2D data σ 1 σ 2 √ n = 1 . 3490 √ n = 0 . 1438 u 1 u 2

  43. Centering is important! σ 1 σ 2 √ n = 5 . 077 √ n = 0 . 889 u 1 u 2

  44. Centering is important! σ 1 σ 2 √ n = 1 . 261 √ n = 0 . 139 u 2 u 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