Linear Algebra and Its Applications with R

Now Available on Amazon • Published by CRC Press

Errata

Page 17

Quiz 13: "a 2 matrix" -> "a 2x3 matrix"

Page 18

Quiz 14: "a 2 matrix" -> "a 2x3 matrix"
Quiz 15: "a 3 matrix" -> "a 3x3 matrix"
Quiz 16: "a 3 matrix" -> "a 3x3 matrix"

Page 25

plot(x, Smarket[1:242,2],type="l") should be
plot(x[1:242], Smarket[1:242,2],type="l")

Page 103

Exercise 2.4 (7) CB^T + (-A)^T
Exercise 2.4 (8) (3 C + D) + (2 E - F) F^T
Exercise 2.4 (9) - A^T B (C - 2 D) - (2 C + D) + ((-1) E + 2 F) F^T

Page 113

Theorem 2.7:
(b · c) · A = b · (c · A) = c · (b · A). Lower case c.

Page 164

Just after "3.3.5 Practical Applications":
Section 2.3 -> Section 2.4.

Page 188

In Exercise 3.53, Exercise 3.1 should be Exercise 1.38. Also In Exercise 3.54, Exercise 3.2 should be Exercise 1.39. and so on until Exercise 3.65.

Page 212

In order to run autoplot for prcomp, we need ggfortify. Thus we need to add a line
library(ggfortify)

Page 218

Lines
"Then {\tt R} returns as follows:
> Null(t(A))
[,1]
[1,] 0.1078328
[2,] 0.9704950
[3,] 0.2156655"
should be above Example 101.

Page 225

Exercise 4.19: Exercise 1.38 instead of Exercise 3.1.
Exercise 4.20: Exercise 1.39 instead of Exercise 3.2.
Exercise 4.21: Exercise 1.40 instead of Exercise 3.3.
Exercise 4.22: Exercise 1.41 instead of Exercise 3.4.
Exercise 4.23: Exercise 1.42 instead of Exercise 3.5.
Exercise 4.24: Exercise 1.43 instead of Exercise 3.6.
Exercise 4.25: Exercise 1.44 instead of Exercise 3.7.
Exercise 4.26: Exercise 1.45 instead of Exercise 3.8.
Exercise 4.27: Exercise 1.46 instead of Exercise 3.9.
Exercise 4.28: Exercise 1.47 instead of Exercise 3.10.

Page 356

Ads <- read.csv("http://faculty.marshall.usc.edu/gareth-james/ISL/Advertising.csv")
does not work anymore because the author removed this website. Thus, please change this line to
Ads <- read.csv("http://polytopes.net/Advertising.csv")

Page 357

Ads = pd.read_csv('http://faculty.marshall.usc.edu/gareth-james/ISL/Advertising.csv')
does not work anymore because the author removed this website. Thus, please change this line to
Ads = pd.read_csv('"http://polytopes.net/Advertising.csv')

Page 361

gMOIP package now assumes the non-negative constrains as its default.

A <- matrix(c(1, 1, 1, 7, -1, 1, -1, 0, 0, -1), nrow = 5, ncol = 2, byrow = TRUE)
> b <- c(7, 35, 3, 0, 0)
should be

A <- matrix(c(1, 1, 1, 7, -1, 1), nrow = 3, ncol = 2, byrow = TRUE)
b <- c(7, 35, 3)

Page 362

plotPolytope(
A,
b,
obj,
type = rep("c", ncol(A)),
crit = "max",
faces = rep("c", ncol(A)),
plotFaces = TRUE,
plotFeasible = TRUE,
plotOptimum = FALSE,
labels = "coord"
)
should be (removing obj from the argument)
plotPolytope(
A,
b,
type = rep("c", ncol(A)),
crit = "max",
faces = rep("c", ncol(A)),
plotFaces = TRUE,
plotFeasible = TRUE,
plotOptimum = FALSE,
labels = "coord"
)

Page 362

For the item 2, it should be Theorem 9.5 not Theorem 173.

Corrections by Daniel Dan

1. Theorem 2.14 Suppose A and B are m × n matrices, Then
Instead of a comma, a dot.
2. The package conics is not on CRAN anymore.. I adopted this solution:


library(PlaneGeometry)

v <- c(2, 2, 2, -20, -28, 10)
ell <- EllipseFromEquation(A = 2, B = 2, C = 2, D = -20, E = -28, F = 10)
box <- ell$boundingbox()
plot(NULL, asp = 1, xlim = box$x, ylim = box$y, xlab = NA, ylab = NA)
draw(ell, col = "lightgray")

3. Definition 24 is the same as Theorem 3.1

4. Before Definition 25

a11 · det(A11 ) − a21 · det(A21 ) + a31 det(A31 )

there is a missing dot between a31 and det(A31 )

5. Exercise 3.42 and Exercise 3.43, point 4. det(A · AT missing a closing parenthesis

6. When you calculate the volume of a tetrahedron: the volume of a tetrahedron with vertices
(x1 , y1 , z1 ), (x2 , y2 , z2 ), (x3 , y3 , z3 ), there is one vertex missing, (x4, y4, z4) as well as in the matrix

7. Determinants, page 181, after: volume of a tetrahedron with vertices.

It is missing the fourth vertex (x4, y4, z4) and also missing from the matrix under.

8. Exercise 3.76 Suppose we have five points 0, 0) Missing opening parenthesis.

9. Chapter 4, in the USArrests example, before head(df) it should go df <- scale(USArrests) to be in accordance to the displayed data.

10. Chapter 4, "Pick the number of components explaining 85% or greater of the variation". I think it should be 95% because cumsum of the first 4 components is 0.9697909

11. Mismatch: Example 101 Then R returns as follows:, Example 101 should be after "Then R returns as follows"

12. Page 219, This means the reduced echelon form of the system is, the second equation, instead of 2x2 it should be 2x4.

13. Definition 32, under the definition, it is Row(A), not Col(A)

14. For t = 10 we have the observed table (page 227). It should be For t=0 and not "the observed table", that part should be removed.

15. For t = -3 we have x5 = x0 + v, it should be x5 = x0 - 3v

16: Theorem 4.16, v = c1 · b1 + c2 · v2 + . . . + cd · bd . Instead of v2 there should be a b2

17: Page 259, twice the same thing at the beginning of the page.

18: Page 260: Solving the system of linear equations gives a unique solution, which is c1 = 2, c2 = 2, c4 = −4. (It should be c3)

19: Page 270: Here we have a major redundant set of operations. the function "scale" in R already standardizes so a very quick implementation is:

credit.data <- Default[,3:4]
cd <- scale(credit.data)
pca <- princomp(cd)
pca$loadings

You obtain the same result. Note, there are several things that can be improved in this subsection.

21: Page 271: "a z-scare" into "a z-score"

22: Descamps et.al. (no punctuation after "et" then space then "al."

23. Example 116: Are you introvert or extroverts? it should be singular: extrovert

24: Example 116: H0 : Political affiliation and Introvert/Extrovert are “related”. It should be H1

25: Page 281: Show = c · for a scalar c. in the second row of the demonstration there is an extra dot added three times =c(·u1·v2+·u2v2+·u3v3)

26: Example 126: there is a dot on top of 2u2, exactly on top of u2.

27: Example 129. Then the length of v is (should be the distance between v and u is). In the formula, there is a minus between the square roots, it should be an equal.

28: 5.3.3. "For example, in mechanical physics, we have to measure the angle of the projectile motion in order to predict the distance from traveled." I would review this phrase.

29: Example 139, there is an extra comma "," after the end of b2 before the right-side curly brackets

30: On page 302: Thus any vector in the row space of A can be written as a linear combination of elements in the basis In the formula after this it is missing the first index of alpha which is 1.

31: On the same page 302: Consider an inner product of W and v: W should be lowercase.

32: 5.3.8, pca<- princomp(data.frame(scale(df))) you can omit data.frame because df is already a data frame.

33: Exercise 5.5 4. While ther is no y vector, I assume it is u.

34: Page 315, 6.2.1 5. Learn how to compute an angle between two vectors in a vector space. and also on page 323. This is calculated in the previous chapter.

35: On page 316. For this data, we have the sample size n = 10000. but in the code is

36: On page 319, right hand side should be right-hand side

37: On page 328, The eigen values of σ̂ are 6444.411. It should be 56444.411

38: On page 334 and 335 (two different examples), Suppose we have a 2 × 2 matrix: (while there is a 3 x 3 matrix)

39: On page 339, 6.3.8 Practical Applications, there is a TT in the matrix, it should be only one T.

40: On page 342 Also r, p, g are 2340 × 4160 matrices. It should be "r, b, g".

41: On page 362 The matrix B does not reflect the previous equations in example 153. I suggest to modify the equations in example 153.

42: On page 362, the code is missing obj <- NULL, only obj appears

43: On page 327, because eigen() works on the covariance matrix, it would be useful to use the function scale() to transform the generated points then divide the t(x)%*%x by 999 which is the number of points. as such you get the covariance matrix similar to the one used to create the dataset.

xc <- scale(x, center = TRUE, scale = FALSE)
# covariance matrix
(y <- (1/nrow(xc-1))*(t(xc) %*% xc))

44: Definition 52: A convex hull of a set.. is the smallest convex hull... could be is the smallest polygon or polyhedron.

45: Example 159. sample_gnp() should be preceded by a set.seed(n) where n is a number. The set.seed function is made to preserve reproducibility in random environments so that each person who runs the "random" function can see the same thing as it is presented in the book.

46: Definition 55. "An directed graph N..." should be "A directed graph N..."

47: Example 161. barabasi.game() should be preceded by a set.seed(n) where n is a number.

48: Barabashi should be Barabási or Barabási-Albert.

49: Theorem 9.5 "if there is no isolated vertices" should be either "if there is no isolated vertex" or "if there are no isolated vertices".

50: Page 371, "UKFaculty" should be "UKfaculty"

51: "1. How many are there components in the brain network?" could be How many are the components in the brain network? or something similar...

52: Page 387: "Now we use Theorem 173 and Theorem 9.5" perhaps Example 173?

53: Page 387: "1. How many components in the collaboration network?" the verb "are" is missing

54: Page 387: DF<-degree(UKfaculty) should be DF <- degree(UKfaculty)

55: Page 387: for(i in 1:81)
AAF[i, ] <- AAF[i,]/DF[i]


should be

for(i in 1:81){
AAF[i, ] <- AAF[i,]/DF[i] }