Information Technology Reference
In-Depth Information
is that the orthogonal projections of all the rows of X onto the two dimensions v 1 and
v 2 , given by the first two columns of V , are given by the rows of
XV 2 V 2 .
(2.6)
The projections (2.6) are points expressed in terms of the coordinates of the original p
dimensions. When they are referred to the coordinates of the orthogonal vectors v 1 and
v 2 they become
XV 2 .
(2.7)
We can now construct a scatterplot of the two-dimensional approximation of X by plotting
the samples as the rows of (2.7) as is shown in Figure 2.3. The R code for obtaining
these scatterplots is as follows:
> aircraft.mat.centered <- scale(aircraft.mat, center = TRUE,
scale = FALSE)
> svd.X.centered <- svd(aircraft.mat.centered)
> x <- aircraft.mat.centered %*% svd.X.centered$v[,1]
> y <- aircraft.mat.centered %*% svd.X.centered$v[,2]
> plot(x = x, y = y, xlim = c(-6,4), ylim = c(-2,2), pch = 15,
col = "green", cex = 1.2, xlab = "V1", ylab = "V2",
frame.plot = FALSE)
> text(x = x, y = y, label = dimnames(aircraft.mat)[[1]],
pos = 1)
> windows()
> PCAbipl(cbind(x,y), colours = c("green",rep("black",8)),
pch.samples = 15, exp.factor = 14, n.int = c(5,3),
offset = c(0, 0, 0.5, 0.5), pos.m = c(1,4),
offset.m = c(-0.25, -0.25))
The scatterplot in the bottom panel of Figure 2.3 is similar to that appearing in the top
panel except for the translation of the ordination axes to pass through the origin and for
the aspect ratio of unity. The effect of the difference in aspect ratios is clear. The R
function PCAbipl is discussed in detail in Chapter 3.
Figure 2.3 is not yet a biplot because only the rows of X have a representation, and no
representation of the columns (variables) is given. Chapter 3 gives the detailed algebraic
and geometrical justifications of how to provide for the variables. Here, the following
outline suffices, writing X = AB , then each element of X is given by x ij = a i b j ,the
inner product of a row marker (rows of A ) and a column marker (columns of B ). From
(2.3) we have X = U V , which implies that XV = U . Since (2.7) approximates the
row markers, we set A = U and it follows that B = V . Therefore the columns of X
are approximated by the first two rows of V .
An r -dimensional approximation of X is shown in Figure 2.4 for r = 2. In the top
panel the rows are represented by green markers as in Figure 2.3, together with red
markers for the columns (the variables). Therefore Figure 2.4 is a two-dimensional biplot
of X . In the bottom panel the variables are represented by vectors as suggested by
Search WWH ::




Custom Search