Beyond three dimensions Non Cartesian representations R.W. Oldford
Beyond three dimensions Hey! I’m a starfish! Moving from 0 to 1 to 2 to 3 dimensions have all been advances which have required an adjustment in our thinking. It has allowed us to “visualize” more, and more complex, information. Each step requires training.
Cartesian coordinates Cartesian coordinates use orthogonal axes and a grid system to place each point in space. Cartesian coordinates René Descartes (1596-1650) ≥ 4 d? When we have n individual cases each one with its own values for each of p variates, we typically represent the i th case mathematically as a vector x i . The collection of data form a “cloud” of n points in a p -dimensional space. Mathematics doesn’t care what value p > 0 takes. How can a point cloud be visualized in more than three dimensions?
Four dimensional data - example Edgar Anderson’s Iris data: 150 flowers, 50 from each of three different species Iris Virginica Iris Versicolor Iris Setosa Four measurements ◮ sepal width ◮ sepal height ◮ petal width ◮ petal height
Four dimensional data - example Learning from maps, we could use glyphs, especially ones that meaningfully convey the information in the data (provide an ostensive “pictorial form”). Edgar Anderson proposed:
Four dimensional data - example Iris Setosa: Centre glyph is the average.
Four dimensional data - example Iris Versicolor: Centre glyph is the average.
Four dimensional data - example Using averages to compare and locate species Anderson’s real interest lay not in discriminating between species but in whether the middle species (in terms of number of chromosomes and habitat) had relative distance of 1:2 from the two extreme species. This proportion roughly matched the chromosome ratios.
Higher dimensional glyphs Anderson’s nested rectangular glyphs were natural for his problem. They were in a sense actually cartoon versions of the flower parts themselves. So, what might be the most natural glyph for us? We know, for example, that for a variety of reasons including possibly ◮ distinguishing predators and prey, ◮ distinguishing friend from foe ◮ identifying close relations ◮ recognizing mood, reaction ◮ social interaction of all kinds that we have evolved to be very good at recognizing, distinguishing, and reading faces. And that our parts of our brain are “wired” to deal with faces. In 1973 Herman Chernoff suggested we use faces as glyphs .
Chernoff faces Herman Chernoff Constructing a Chernoff face Variate values are assigned to different cartoon face features. A variety of faces have been implemented since Chernoff’s original proposal.
Chernoff faces Original Chernoff Faces, 1973.
Chernoff faces There are a couple of R packages that draw cartoon faces (i.e. variations on Chernoff faces). The first we woll look at is the TeachingDemos package. library (TeachingDemos) The faces2(...) function can accommodate (up to) 18 dimensions as follows: The face features are assigned for columns 1 to (at most) 18 1. Width of center 2. Top vs. Bottom width (height of split) 3. Height of Face 4. Width of top half of face 5. Width of bottom half of face 6. Length of Nose 7. Height of Mouth 8. Curvature of Mouth (abs < 9) 9. Width of Mouth 10. Height of Eyes 11. Distance between Eyes (.5-.9) 12. Angle of Eyes/Eyebrows 13. Circle/Ellipse of Eyes 14. Size of Eyes 15. Position Left/Right of Eyeballs/Eyebrows 16. Height of Eyebrows 17. Angle of Eyebrows 18. Width of Eyebrows
Chernoff faces To demonstrate, we first scale the data to be weetween 0 and 1 for each variate data <- iris[,1 : 4] # the four measurements on Anderson's irises scale01 <- function (x) { xrange <- range (x) (x - min (xrange)) /diff (xrange) } data <- apply (data, 2, scale01) faces2 (data[ c (1, 51, 101), ], which= c (8, 13, 14, 17), scale = "none", nrows=1, ncols=3)
Chernoff faces With the appropriate packages, we can explore how variable these features are library (tkrplot) ## Loading required package: tcltk if ( interactive ()){ tke2 <- rep ( list ( list ('slider',from=0,to=1,init=0.5,resolution=0.1)), 18) names (tke2) <- c ('CenterWidth','TopBottomWidth','FaceHeight','TopWidth', 'BottomWidth','NoseLength','MouthHeight','MouthCurve','MouthWidth', 'EyesHeight','EyesBetween','EyeAngle','EyeShape','EyeSize','EyeballPos', 'EyebrowHeight','EyebrowAngle','EyebrowWidth') tkfun2 <- function (...){ tmpmat <- rbind (Min=0,Adjust= unlist ( list (...)),Max=1) faces2 (tmpmat, scale='none') } tkexamp ( tkfun2, list (tke2), plotloc='left', hscale=2, vscale=2 ) }
Chernoff faces We could choose different variate to feature mappings data <- iris[,1 : 4] # the four measurements on Anderson's irises scale01 <- function (x) { xrange <- range (x) (x - min (xrange)) /diff (xrange) } data <- apply (data, 2, scale01) faces2 (data[ c (1, 51, 101), ], which= c (6, 7, 8, 12), scale = "none", nrows=1, ncols=3)
Chernoff faces For all of the irises (in random order) n <- nrow (data) faces2 (data[ sample (1 : n, n, replace =FALSE), ], which= c (6, 7, 8, 12), nrow=10, ncol=15)
Chernoff faces The olive data (150 randomly selected from 572; 8 dimensions) faces2 (data[ sample (1 :nrow (data), 150, replace = FALSE), ], nrows=10, ncols=15, which= c (1, 2, 3, 4, 6, 7, 8, 12), scale = "none")
Chernoff faces Problems with faces ◮ Eye movements (saccades). ◮ Some facial features are more important than others. ◮ Grouping will depend on which variates are matched to features. ◮ Not so useful for exploratory work, OK (with care) for infographic.
Florence Nightingale’s rose plot Areas (centre to edge) are proportional to value. Time series.
Florence Nightingale’s rose plot E.g. The Atlas of Britain and Northern Ireland, 1963. Note colour used to identify variate. Area proportional to magnitude.
Florence Nightingale’s rose plot There is a function in R called stars(...) which will produce Nightingale’s rose style glyphs. n <- nrow (data) stars (data[ sample (1 : n, n, replace =FALSE), ], nrow=10, ncol=15, main = "Nightingale Roses (almost)", draw.segments=TRUE, cex=1.2)
Florence Nightingale’s rose plot Iris data Nightingale Roses (almost)
Florence Nightingale’s rose plot Olive data Nightingale Roses (almost)
Florence Nightingale’s rose plot Note that our use here is very different from Nightingale’s ◮ Nightingale used overlapping segments (hence the rose) ◮ represented time series (typically strong positive correlation between neighbouring wedges) ◮ i.e. large beside/near large, small beside/near small ◮ very few roses In contrast: ◮ our use is more like that of the 1963 British Atlas example, ◮ no overlapping segments ◮ different variates shown at each wedge ◮ no expectation of correlation’s sign ◮ many “stars” or “roses” ◮ looking to group like looking shapes. Nightingale’s Crimean war could have been represented as stars with 3 segments (one for each cause of death) and a separate star for each month.
Radial Axes Sepal.Width Petal.Length Sepal.Length Petal.Width Axes as equi-angular radii of a circle.
Radial Axes Sepal.Width Petal.Length Sepal.Length Petal.Width Data scaled with dataset’s minimum value at centre, maximum at end (for each variate).
Radial Axes Sepal.Width Petal.Length Sepal.Length Petal.Width One flower. Four measurements.
Radial Axes Sepal.Width Petal.Length Sepal.Length Petal.Width All of the setosa data at once. Correlations?
Radial Axes Sepal.Width Petal.Length Sepal.Length Petal.Width All of the versicolor data at once. Correlations?
Radial Axes Sepal.Width Petal.Length Sepal.Length Petal.Width All of the virginica data at once. Correlations?
Radial Axes Iris Setosa Iris Versicolor Iris Virginica Sepal.Width Sepal.Width Sepal.Width Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Width Petal.Width Petal.Width All three species. Comments?
Radial Axes Iris Setosa Iris Versicolor Iris Virginica Averages Sepal.Width Sepal.Width Sepal.Width Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Width Petal.Width Petal.Width All three species. Comments?
Radial Axes Iris Setosa Iris Versicolor Iris Virginica Altogether Sepal.Width Sepal.Width Sepal.Width Sepal.Width Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Width Petal.Width Petal.Width Petal.Width All three species. Comments?
Radial Axes Averages and Individuals Iris Setosa Iris Versicolor Iris Virginica Sepal.Width Sepal.Width Sepal.Width Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Width Petal.Width Petal.Width Sepal.Width Sepal.Width Sepal.Width Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Length Sepal.Length Petal.Width Petal.Width Petal.Width All three species. Comments?
Radial Axes Data explorations using stars(...) again stars (data[ran.order,], lwd=1.25, labels=NULL, radius=FALSE, col.lines = rep ("steelblue", n), nrow=10, ncol = 15, key.loc= c (12, - 0.5), main="Iris data")
Radial Axes Iris data Sepal.Width Petal.Length Sepal.Length Petal.Width
Recommend
More recommend