Linear Algebra for Data Science in R
Eric Eager
Data Scientist at Pro Football Focus
The scalar multiplication of $c$ times the vector $\vec{x}$ is denoted by:
$$c \vec{x}$$
which simply multiplies each element of $\vec{x}$ by $c$.
print(x)
3 2 3
c <- 4
c*x
12 8 12
Scalar multiplication can be replicated by a special matrix multiplication:
$$c I \vec{x} = c\vec{x}$$
However, there are many other matrices that, when applied to the correct vector or collection of vectors, act exactly like scalar multiplication.
These scalars and vectors are called eigenvalues and eigenvectors!
print(A)
[,1] [,2] [,3]
[1,] 3 0 0
[2,] 0 3 0
[3,] 0 0 3
x <- c(3, 2, 3)
A%*%x
[,1]
[1,] 9
[2,] 6
[3,] 9
3*x
9 6 9
Linear Algebra for Data Science in R